{"version":3,"file":"specification.mjs","sources":["../../../lib/datasetDetails/properties/specification.ts"],"sourcesContent":["export const dcatFields = `releaseDate,modificationDate,creator,landingPages,sources,\n    languages,publisher,contactPoints,catalogRecord,spatial,\n    spatialResource,conformsTo,provenances,identifiers,otherIdentifiers, resource,\n    frequency,accessRights,accrualPeriodicity,hasVersion,isVersionOf,\n    temporal,versionInfo,versionNotes,attributes,dimensions,numSeries,hasQualityAnnotations,\n    statUnitMeasures,isReferencedBy,qualifiedAttributions,wasGeneratedBy,\n    qualifiedRelations,sample,spatialResolutionInMeters,type,temporalResolution`;\n\nexport const dcatDeFields = `politicalGeocodingLevelURI,politicalGeocodingURI,availability,\n    contributorID,geocodingDescriptionDe,legalBasis,qualityProcessURI,typeDe,\n    references,contributor,originator,maintainer`;\n\n/*\n    Below we have schemata describing how properties should be rendered in DatasetDatailsProperties.vue. A schema is\n    an object where keys correspond to the above defined fields. For each key, the value is an object the format of which\n    we will now describe:\n\n    - type: is the the only required property. Will be evaluated in typeCheckers.ts. It reflects the format of the\n    data item (CALLED \"response\" BELOW!) retrieved by from the search network response (number, string, url, array, object, array of objects).\n    Supported values are:\n        * \"number\": response is a single number\n        * \"first:number\": render response[0] as a number\n        * \"string\": response a simple string\n        * \"uri\": response a simple string, rendered as a link\n        * \"date\": response a simple string, formatted as a date conforming to the current locale\n        * \"translation\": response an object containing locale keys (like \"en\", \"de\"). The value corresponding to the\n            current locale is rendered\n        * \"object\": response an object whose where each key-value pair is rendered on a separate line\n        * \"array\": response an array whose elements are rendered vertically\n        * \"links\": reponse either an array of uri-strings rendered as links, or an\n            array of objects with a label field that is displayed as a link and another field\n            holding the href; that other field is either resource, label or id\n\n    - translate: for a property \"xxx\", we have a bold label and tooltip to the left which comes from\n    an i18n translation; the default i18n keys are: message.tooltip.datasetDetails.xxx for the tooltip and\n    message.metadata.xxx for the displayed label. if instead of xxx, you want to use another key (with the same prefixes),\n    translate can provide it. If translate is two strings separated by commas, the left one applies to the tooltip, the right\n    to the label. Instead of just a replacement for xxx, you can provide i18n keys without the prefixes by starting the string with\n    a slash (example: translate:\"/message.tooltip.yyy,/message.mykey.mylabelkey\"). Instead of translation keys, you can also\n    provide literal values as tooltip or label by enclosing the strings in single quotes.\n\n    - fields: for objects and arrays of objects, this comma-separated value indicates, what keys of the objects should\n    be used for display (filtering out any additional data in the object). If not present, all existent keys will be used.\n    A key given in this comma separated list can be of the form \"x\": just a key, or of the form \"x:y\": key x of type y (where\n    the type is any of \"link\", \"link_blank\", \"date\" or empty; accordingly, a link (possibly target=\"_blank\") or date will be displayed).\n    Also the form \"x:y:z\" is possible, where z is an indication how to translate the key for rendering. If z does not exist,\n    the i18n key message.metadata.x will be translated; if z exists, we use message.metadata.z instead. The additional properties for\n    \"translate\" above can also be applied to z: leading slash or single quotes.\n\n    - track: enable Matomo tracking for a link. track is a string value indicating the key of the data object for which\n    tracking should be enabled.\n\n    - itemstyles: a string of CSS properties that applies to key-value items of a rendered object\n\n    - transform: a function that maps the data to be rendered. Applies after the data has been processed in the value-method of\n    DatsetDetailsProperty.vue\n\n    - preTransform: same as transform, only applied to the raw data value before processing in the value-method\n\n */\n\nexport const dcatSchema = (t) => ({\n    releaseDate: {type: 'date', translate: 'created'},\n    modificationDate: {type: 'date', translate: 'updated'},\n    landingPages: {type: 'links', translate: 'landingPage'},\n    sources: {type: 'links', translate:',sources'},\n    languages: {type: 'links', translate: 'language,languages'},\n    publisher: {type: 'object', fields: 'name,email,homepage'},\n    contactPoints: {type: 'objects', translate:\"/message.tooltip.contactPoints,contactPoints\", fields: \"name::/message.metadata.name,organisation_name::/message.datasetDetails.contactPoints.organizationName,email,telephone,address,url:link\"},\n    catalogRecord: {type: 'object', translate:\"/message.tooltip.catalogRecord,catalogRecord\", fields: \"issued:date:addedToDataEuropaEU,modified:date:updatedOnDataEuropaEU,homepage\"},\n    spatial: {type: 'objects', fields: \"coordinates,type\"},\n    spatialResource: {type: 'links', translate:\",spatialResource\", fields: \"resource:link\"},\n    conformsTo: {type: 'objects', fields: \"title::label,label,resource:link_blank\", track:\"resource\"},\n    provenances: {type: 'objects', translate: 'provenance,provenances', fields: \"label,resource:link\"},\n    // relatedResources: {type: 'links', translate: 'relatedResource,relatedResources'},\n    identifiers: {type: 'links', translate: 'identifier,identifiers'},\n    otherIdentifiers: {type: 'links', translate: 'otherIdentifier,otherIdentifiers', fields:\"identifier:link,resource:link:identifier,scheme:link\"},\n    resource: {type: 'uri', translate: \",'uriRef:'\"},\n    frequency: {type: 'object', fields:\"title,resource:link\"},\n    accessRights: {type: 'object', translate:\"/message.tooltip.datasetDetails.distributions.rights,accessRights\", fields:\"label::\"},\n    accrualPeriodicity: {type: 'object', translate:\"frequency,accrualPeriodicity\", fields:\"label::\"},\n    creator: {type: 'objects', fields:\"type,name,resource:link,email,homepage:link\"},\n    hasVersion: {type: 'links'},\n    isVersionOf: {type: 'links', translate:\"versionOf,isVersionOf\"},\n    temporal: {type: 'objects', translate:\"/message.tooltip.datasetDetails.distributions.temporalResolution,temporal\", fields: \"gte:date:,lte:date:' -'\", itemstyles:\"float:left\"},\n    versionInfo: {type: 'string'},\n    versionNotes: {type: 'translation'},\n    attributes: {type: 'links', translate:\",attributes\"},\n    dimensions: {type: 'links', translate:\",dimensions\"},\n    numSeries: {type: 'number'},\n    hasQualityAnnotations: {type: 'links', translate: \",qualityAnnotations\"},\n    statUnitMeasures: {type: 'links', translate: \"unitsOfMeasurement\"},\n    isReferencedBy: {type: 'links'},\n    qualifiedAttributions: {type: 'links', translate: \"qualifiedAttribution\"},\n    wasGeneratedBy: {type: 'links'},\n    qualifiedRelations: {type: 'objects', translate: \"qualifiedRelation\", fields: \"relation:link,had_role:link:role\"},\n    sample: {type: 'links'},\n    spatialResolutionInMeters: {\n        type: 'number', translate: \"spatialResolutionInMeters,spatialResolutionInMeters.label\",\n            transform: value => t('message.metadata.spatialResolutionInMeters.value', {number: value})\n    },\n    type: {type: 'object', fields: \"label,resource:link_blank\",  preTransform: (value) => ({\n    ...value,\n    name: value?.name ?? value?.label\n  })},\n    temporalResolution: {type: 'string'}\n});\n\nexport const dcatDeSchema = () => ({\n    politicalGeocodingLevelURI: {type: 'objects', fields:\"label,resource:link\"},\n    politicalGeocodingURI: {type: 'objects', fields:\"label,resource:link\"},\n    availability: {type: 'object', translate:\"availabilityDE,availability\", fields:\"label,resource:link\"},\n    contributorID: {type: 'objects', fields:\"label,resource:link\"},\n    geocodingDescriptionDe: {type: 'translation'},\n    legalBasis: {type: 'translation'},\n    qualityProcessURI: {type: 'uri'},\n    typeDe: {type: 'string', translate:\"type,type\"},\n    references: {type: 'uri'},\n    contributor: {type: 'objects', fields:\"name,type,homepage,email,resource\"},\n    originator: {type: 'objects', fields:\"name,type,homepage,email,resource\"},\n    maintainer: {type: 'objects', fields:\"name,type,homepage,email,resource\"}\n});\n"],"names":["dcatFields","dcatDeFields","dcatSchema","value","dcatDeSchema"],"mappings":"AAAO,MAAMA,IAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kFAQbC,IAAe;AAAA;AAAA,mDAqDfC,IAAa,CAAC,OAAO;AAAA,EAC9B,aAAa,EAAC,MAAM,QAAQ,WAAW,UAAS;AAAA,EAChD,kBAAkB,EAAC,MAAM,QAAQ,WAAW,UAAS;AAAA,EACrD,cAAc,EAAC,MAAM,SAAS,WAAW,cAAa;AAAA,EACtD,SAAS,EAAC,MAAM,SAAS,WAAU,WAAU;AAAA,EAC7C,WAAW,EAAC,MAAM,SAAS,WAAW,qBAAoB;AAAA,EAC1D,WAAW,EAAC,MAAM,UAAU,QAAQ,sBAAqB;AAAA,EACzD,eAAe,EAAC,MAAM,WAAW,WAAU,gDAAgD,QAAQ,0IAAyI;AAAA,EAC5O,eAAe,EAAC,MAAM,UAAU,WAAU,gDAAgD,QAAQ,+EAA8E;AAAA,EAChL,SAAS,EAAC,MAAM,WAAW,QAAQ,mBAAkB;AAAA,EACrD,iBAAiB,EAAC,MAAM,SAAS,WAAU,oBAAoB,QAAQ,gBAAe;AAAA,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