gws.base.metadata.core¶
Metadata objects: creation, merging and conversion.
Source code: gws.base.metadata.core
Module Contents¶
- class gws.base.metadata.core.Config(*args, **kwargs)¶
Bases:
gws.ConfigMetadata of an object, used in the client and in OWS services.
- accessConstraints: str | None¶
Access constraints, written to AccessConstraints in service capabilities.
- authorityIdentifier: str | None¶
Layer identifier issued by the authority, written to the WMS Identifier element.
- catalogCitationUid: str | None¶
Identifier of the resource, written to the CI_Citation identifier in CSW records.
- contactProviderName: str | None¶
Name of the service provider, written to ServiceProvider/ProviderName.
- contactProviderSite: str | None¶
Website of the service provider, written to ServiceProvider/ProviderSite.
- contactRole: gws.base.metadata.iso.CI_RoleCode | None¶
Role of the contact.
- crs: gws.CrsName | None¶
Reference system of the data, written to MD_ReferenceSystem in CSW records.
- dateCreated: gws.DateStr | None¶
Creation date of the object.
- dateUpdated: gws.DateStr | None¶
Last update date of the object.
- inspireDegreeOfConformity: gws.base.metadata.inspire.IM_DegreeOfConformity | None¶
Degree of conformity with the INSPIRE implementing rules.
- inspireMandatoryKeyword: gws.base.metadata.inspire.IM_MandatoryKeyword | None¶
INSPIRE service type, added to the keywords as the ISO serviceType keyword.
- inspireResourceType: gws.base.metadata.inspire.IM_ResourceType | None¶
INSPIRE resource type.
- inspireSpatialDataServiceType: gws.base.metadata.inspire.IM_SpatialDataServiceType | None¶
INSPIRE spatial data service type.
- inspireSpatialScope: gws.base.metadata.inspire.IM_SpatialScope | None¶
INSPIRE spatial scope.
- inspireTheme: gws.base.metadata.inspire.IM_Theme | None¶
INSPIRE data theme, added to the keywords as a GEMET INSPIRE theme.
- isoMaintenanceFrequencyCode: gws.base.metadata.iso.MD_MaintenanceFrequencyCode | None¶
How often the data is updated.
- isoQualityConformanceSpecificationDate: str | None¶
Publication date of the specification the conformance is tested against.
- isoQualityConformanceSpecificationTitle: str | None¶
Title of the specification the conformance is tested against.
- isoRestrictionCode: gws.base.metadata.iso.MD_RestrictionCode | None¶
Restrictions on access or use of the data.
- isoScope: gws.base.metadata.iso.MD_ScopeCode | None¶
Scope of the metadata.
- isoServiceFunction: gws.base.metadata.iso.SV_ServiceFunction | None¶
ISO service function.
- isoSpatialRepresentationType: gws.base.metadata.iso.MD_SpatialRepresentationTypeCode | None¶
How the data is represented spatially.
- isoTopicCategories: list[gws.base.metadata.iso.MD_TopicCategoryCode] | None¶
ISO 19115 topic categories, added to the keywords.
- keywords: list[str] | None¶
river’.
- Type:
Keywords, optionally prefixed with a vocabulary, e.g. ‘gemet
- metaLinks: list[LinkConfig] | None¶
Links to metadata documents.
- temporalBegin: gws.DateStr | None¶
Start of the temporal extent of the data.
- temporalEnd: gws.DateStr | None¶
End of the temporal extent of the data.
- wgsExtent: gws.Extent | None¶
Geographic extent in WGS84, written to EX_Extent in CSW records.
- gws.base.metadata.core.from_args(*args, **kwargs) gws.Metadata¶
Create a metadata object by merging several sources.
- Parameters:
*args – Dicts or data objects (configs, props, metadata objects), merged in order;
Nonevalues are skipped.**kwargs – Values merged last.
- Returns:
A new metadata object.
- gws.base.metadata.core.from_config(c: gws.Config) gws.Metadata¶
Create a metadata object from a metadata configuration.
- Parameters:
c – Metadata configuration.
- Returns:
A new metadata object.
- gws.base.metadata.core.from_dict(d: dict) gws.Metadata¶
Create a metadata object from a dictionary.
- Parameters:
d – Metadata values by key.
- Returns:
A new metadata object.
- gws.base.metadata.core.from_props(p: gws.Props) gws.Metadata¶
Create a metadata object from metadata props.
- Parameters:
p – Metadata props.
- Returns:
A new metadata object.
- gws.base.metadata.core.keyword_groups(md: gws.Metadata) list[KeywordGroup]¶
Group the keywords of a metadata object by code space and type name.
Keywords without a vocabulary prefix go to a group with an empty code space and type name; keywords with a prefix (
vocabulary:keyword) are currently not included. The INSPIRE theme, the ISO topic categories and the INSPIRE mandatory keyword get groups of their own.- Parameters:
md – Metadata object.
- Returns:
Keyword groups.
- class gws.base.metadata.core.KeywordGroup(*args, **kwargs)¶
Bases:
gws.DataKeywords from one vocabulary, as written to OWS keyword lists.
- class gws.base.metadata.core.LinkConfig(*args, **kwargs)¶
Bases:
gws.ConfigLink to a metadata document or another resource related to the object.
- mimeType: gws.MimeType | None¶
MIME type of the linked resource.
- gws.base.metadata.core.new() gws.Metadata¶
Create an empty metadata object.
The list values
keywords,isoTopicCategoriesandmetaLinksare empty lists, all other values are unset.- Returns:
A new metadata object.
- gws.base.metadata.core.normalize(md: gws.Metadata) gws.Metadata¶
Return a normalized copy of a metadata object.
Dates are parsed to
datetimeobjects, keyword lists are deduplicated and sorted, and the derived language codes and INSPIRE theme names are filled in.- Parameters:
md – Metadata object.
- Returns:
A new metadata object.
- class gws.base.metadata.core.Props(*args, **kwargs)¶
Bases:
gws.PropsRepresents metadata properties.
- gws.base.metadata.core.props(md: gws.Metadata) gws.Props¶
Convert a metadata object to client props.
- Parameters:
md – Metadata object.
- Returns:
Props with the abstract, attribution, dates as ISO date strings, sorted keywords, language and title. Missing values are empty strings.
- gws.base.metadata.core.update(md: gws.Metadata, *args, **kwargs) gws.Metadata¶
Merge values into a metadata object in place.
keywordsandisoTopicCategoriesare added to the existing values, other keys replace them.Nonevalues do not override existing ones.- Parameters:
md – Metadata object to update.
*args – Dicts or data objects, merged in order.
**kwargs – Values merged last.
- Returns:
The updated metadata object.