toJsonLd method

  1. @override
Map<String, dynamic> toJsonLd()
override

Serialize SchemaCreativeWork to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'CreativeWork',
      'about': convertToJsonLd(about),
      'abstract': convertToJsonLd(abstract),
      'accessMode': convertToJsonLd(accessMode),
      'accessModeSufficient': convertToJsonLd(accessModeSufficient),
      'accessibilityAPI': convertToJsonLd(accessibilityAPI),
      'accessibilityControl': convertToJsonLd(accessibilityControl),
      'accessibilityFeature': convertToJsonLd(accessibilityFeature),
      'accessibilityHazard': convertToJsonLd(accessibilityHazard),
      'accessibilitySummary': convertToJsonLd(accessibilitySummary),
      'accountablePerson': convertToJsonLd(accountablePerson),
      'acquireLicensePage': convertToJsonLd(
          acquireLicensePage, (v) => v is SchemaCreativeWork || v is String),
      'aggregateRating': convertToJsonLd(aggregateRating),
      'alternativeHeadline': convertToJsonLd(alternativeHeadline),
      'archivedAt': convertToJsonLd(
          archivedAt, (v) => v is String || v is SchemaWebPage),
      'assesses': convertToJsonLd(
          assesses, (v) => v is SchemaDefinedTerm || v is String),
      'associatedMedia': convertToJsonLd(associatedMedia),
      'audience': convertToJsonLd(audience),
      'audio': convertToJsonLd(
          audio,
          (v) =>
              v is SchemaAudioObject ||
              v is SchemaClip ||
              v is SchemaMusicRecording),
      'author': convertToJsonLd(
          author, (v) => v is SchemaOrganization || v is SchemaPerson),
      'award': convertToJsonLd(award),
      'awards': convertToJsonLd(awards),
      'character': convertToJsonLd(character),
      'citation': convertToJsonLd(
          citation, (v) => v is SchemaCreativeWork || v is String),
      'comment': convertToJsonLd(comment),
      'commentCount': convertToJsonLd(commentCount),
      'conditionsOfAccess': convertToJsonLd(conditionsOfAccess),
      'contentLocation': convertToJsonLd(contentLocation),
      'contentRating': convertToJsonLd(
          contentRating, (v) => v is SchemaRating || v is String),
      'contentReferenceTime': convertToJsonLd(contentReferenceTime),
      'contributor': convertToJsonLd(
          contributor, (v) => v is SchemaOrganization || v is SchemaPerson),
      'copyrightHolder': convertToJsonLd(copyrightHolder,
          (v) => v is SchemaOrganization || v is SchemaPerson),
      'copyrightNotice': convertToJsonLd(copyrightNotice),
      'copyrightYear': convertToJsonLd(copyrightYear),
      'correction': convertToJsonLd(
          correction, (v) => v is SchemaCorrectionComment || v is String),
      'countryOfOrigin': convertToJsonLd(countryOfOrigin),
      'creativeWorkStatus': convertToJsonLd(
          creativeWorkStatus, (v) => v is SchemaDefinedTerm || v is String),
      'creator': convertToJsonLd(
          creator, (v) => v is SchemaOrganization || v is SchemaPerson),
      'creditText': convertToJsonLd(creditText),
      'dateCreated': convertToJsonLd(dateCreated),
      'dateModified': convertToJsonLd(dateModified),
      'datePublished': convertToJsonLd(datePublished),
      'digitalSourceType': convertToJsonLd(digitalSourceType),
      'discussionUrl': convertToJsonLd(discussionUrl),
      'displayLocation': convertToJsonLd(displayLocation),
      'editEIDR': convertToJsonLd(editEIDR),
      'editor': convertToJsonLd(editor),
      'educationalAlignment': convertToJsonLd(educationalAlignment),
      'educationalLevel': convertToJsonLd(
          educationalLevel, (v) => v is SchemaDefinedTerm || v is String),
      'educationalUse': convertToJsonLd(
          educationalUse, (v) => v is SchemaDefinedTerm || v is String),
      'encoding': convertToJsonLd(encoding),
      'encodingFormat': convertToJsonLd(encodingFormat),
      'encodings': convertToJsonLd(encodings),
      'exampleOfWork': convertToJsonLd(exampleOfWork),
      'expires': convertToJsonLd(expires),
      'fileFormat': convertToJsonLd(fileFormat),
      'funder': convertToJsonLd(
          funder, (v) => v is SchemaOrganization || v is SchemaPerson),
      'funding': convertToJsonLd(funding),
      'genre': convertToJsonLd(
          genre, (v) => v is SchemaDefinedTerm || v is String),
      'hasPart': convertToJsonLd(hasPart),
      'headline': convertToJsonLd(headline),
      'inLanguage': convertToJsonLd(
          inLanguage, (v) => v is SchemaLanguage || v is String),
      'interactionStatistic': convertToJsonLd(interactionStatistic),
      'interactivityType': convertToJsonLd(interactivityType),
      'interpretedAsClaim': convertToJsonLd(interpretedAsClaim),
      'isAccessibleForFree': convertToJsonLd(isAccessibleForFree),
      'isBasedOn': convertToJsonLd(
          isBasedOn,
          (v) =>
              v is SchemaCreativeWork || v is SchemaProduct || v is String),
      'isBasedOnUrl': convertToJsonLd(
          isBasedOnUrl,
          (v) =>
              v is SchemaCreativeWork || v is SchemaProduct || v is String),
      'isFamilyFriendly': convertToJsonLd(isFamilyFriendly),
      'isPartOf': convertToJsonLd(
          isPartOf, (v) => v is SchemaCreativeWork || v is String),
      'keywords': convertToJsonLd(
          keywords, (v) => v is SchemaDefinedTerm || v is String),
      'learningResourceType': convertToJsonLd(
          learningResourceType, (v) => v is SchemaDefinedTerm || v is String),
      'license': convertToJsonLd(
          license, (v) => v is SchemaCreativeWork || v is String),
      'locationCreated': convertToJsonLd(locationCreated),
      'mainEntity': convertToJsonLd(mainEntity),
      'maintainer': convertToJsonLd(
          maintainer, (v) => v is SchemaOrganization || v is SchemaPerson),
      'material':
          convertToJsonLd(material, (v) => v is SchemaProduct || v is String),
      'materialExtent': convertToJsonLd(
          materialExtent, (v) => v is SchemaQuantitativeValue || v is String),
      'mentions': convertToJsonLd(mentions),
      'offers': convertToJsonLd(
          offers, (v) => v is SchemaDemand || v is SchemaOffer),
      'pattern': convertToJsonLd(
          pattern, (v) => v is SchemaDefinedTerm || v is String),
      'position': convertToJsonLd(position, (v) => v is String || v is int),
      'producer': convertToJsonLd(
          producer, (v) => v is SchemaOrganization || v is SchemaPerson),
      'provider': convertToJsonLd(
          provider, (v) => v is SchemaOrganization || v is SchemaPerson),
      'publication': convertToJsonLd(publication),
      'publisher': convertToJsonLd(
          publisher, (v) => v is SchemaOrganization || v is SchemaPerson),
      'publisherImprint': convertToJsonLd(publisherImprint),
      'publishingPrinciples': convertToJsonLd(publishingPrinciples,
          (v) => v is SchemaCreativeWork || v is String),
      'recordedAt': convertToJsonLd(recordedAt),
      'releasedEvent': convertToJsonLd(releasedEvent),
      'review': convertToJsonLd(review),
      'reviews': convertToJsonLd(reviews),
      'schemaVersion': convertToJsonLd(schemaVersion),
      'sdDatePublished': convertToJsonLd(sdDatePublished),
      'sdLicense': convertToJsonLd(
          sdLicense, (v) => v is SchemaCreativeWork || v is String),
      'sdPublisher': convertToJsonLd(
          sdPublisher, (v) => v is SchemaOrganization || v is SchemaPerson),
      'size': convertToJsonLd(
          size,
          (v) =>
              v is SchemaDefinedTerm ||
              v is SchemaQuantitativeValue ||
              v is SchemaSizeSpecification ||
              v is String),
      'sourceOrganization': convertToJsonLd(sourceOrganization),
      'spatial': convertToJsonLd(spatial),
      'spatialCoverage': convertToJsonLd(spatialCoverage),
      'sponsor': convertToJsonLd(
          sponsor, (v) => v is SchemaOrganization || v is SchemaPerson),
      'teaches': convertToJsonLd(
          teaches, (v) => v is SchemaDefinedTerm || v is String),
      'temporal': convertToJsonLd(temporal),
      'temporalCoverage': convertToJsonLd(temporalCoverage),
      'text': convertToJsonLd(text),
      'thumbnail': convertToJsonLd(thumbnail),
      'thumbnailUrl': convertToJsonLd(thumbnailUrl),
      'timeRequired': convertToJsonLd(timeRequired),
      'translationOfWork': convertToJsonLd(translationOfWork),
      'translator': convertToJsonLd(
          translator, (v) => v is SchemaOrganization || v is SchemaPerson),
      'typicalAgeRange': convertToJsonLd(typicalAgeRange),
      'usageInfo': convertToJsonLd(
          usageInfo, (v) => v is SchemaCreativeWork || v is String),
      'version': convertToJsonLd(version, (v) => v is String || v is num),
      'video': convertToJsonLd(
          video, (v) => v is SchemaClip || v is SchemaVideoObject),
      'wordCount': convertToJsonLd(wordCount),
      'workExample': convertToJsonLd(workExample),
      'workTranslation': convertToJsonLd(workTranslation),
    });