Class DcatGenerator
java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatMappingBase
org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatGenerator
DcatGenerator creates the DCAT description of open metadata elements. A DeployedAPI asset is described as a
dcat:DataService and a DataSet asset is described as a dcat:Dataset (or dcat:DatasetSeries) whose distributions are
the assets that supply its data. Any other type of asset is described as a dcat:Dataset with a single distribution
that describes how to get to the asset. A collection is described as a dcat:Catalog.
An element that was catalogued from a DCAT description is given back its original IRI and the properties that were kept in its additional properties. Other elements are identified by an IRI built from their unique identifier.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatMappingBase
ACCESS_RIGHTS, ACCESS_SERVICES_JSON, ACCESS_URL, ACCRUAL_PERIODICITY, ADDITIONAL_PROPERTY_PREFIX, BYTE_SIZE, CATALOG_KIND, CATALOG_QUALIFIED_NAME_PREFIX, CHECKSUM_ALGORITHM, CHECKSUM_VALUE, COMPRESS_FORMAT, CONFORMS_TO_JSON, CONFORMS_TO_LABEL, CONTACT_POINT_JSON, context, CREATORS_JSON, DATA_SERVICE_KIND, DATA_SERVICE_QUALIFIED_NAME_PREFIX, DATASET_KIND, DATASET_QUALIFIED_NAME_PREFIX, DATASET_SERIES_KIND, DESCRIPTION_TRANSLATIONS_JSON, DISTRIBUTION_KIND, DISTRIBUTION_QUALIFIED_NAME_PREFIX, DOCUMENTATION_LABEL, DOWNLOAD_URL, ENDPOINT_DESCRIPTIONS_JSON, FORMAT, GENERATED_IRI_PREFIX, HOMEPAGE, IDENTIFIERS_JSON, IRI, ISSUED, KIND, LANGUAGES_JSON, LICENSE_JSON, MEDIA_TYPE, MODIFIED, OTHER_PROPERTIES_JSON, PACKAGE_FORMAT, PREVIOUS_VERSION, propertyHelper, PUBLISHER_JSON, RESOURCE_TYPE, RIGHTS, SEPARATOR, SPATIAL_JSON, SPATIAL_RESOLUTION_IN_METERS, STATUS, TEMPORAL_JSON, TEMPORAL_RESOLUTION, THEME_TAXONOMIES_JSON, THEMES_JSON, TITLE_TRANSLATIONS_JSON, VERSION_NOTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateAssetDocument(String assetGUID) Generate a DCAT document that describes a single asset.generateCatalog(String collectionGUID, List<DcatResource> members) Generate the DCAT description of a collection as a catalog.generateResource(String assetGUID) Generate the DCAT description of an asset.getDocument(DcatCatalog catalog, List<DcatResource> resources) Assemble a document from a catalog and the resources that it lists.getIRI(OpenMetadataElement element) Return the IRI that identifies an open metadata element in a DCAT description.voidsetDefaultPublisherName(String defaultPublisherName) Set up the name of the publisher to use for resources that are not linked to a publishing organization.Methods inherited from class org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatMappingBase
findElement, findElementGUID, getAdditionalProperties, getBean, getBeanList, getLinkedElementGUIDs, getRelationships, getStringList, getStringProperty, putIfPresent, toJSON
-
Constructor Details
-
DcatGenerator
Constructor- Parameters:
context- the connector context that provides access to open metadata
-
-
Method Details
-
setDefaultPublisherName
Set up the name of the publisher to use for resources that are not linked to a publishing organization.- Parameters:
defaultPublisherName- name of an organization or null for no default publisher
-
getIRI
Return the IRI that identifies an open metadata element in a DCAT description.- Parameters:
element- open metadata element- Returns:
- original IRI if the element was catalogued from a DCAT description; otherwise an IRI based on its unique identifier
-
generateAssetDocument
public DcatDocument generateAssetDocument(String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Generate a DCAT document that describes a single asset.- Parameters:
assetGUID- unique identifier of the asset- Returns:
- document containing one dataset, dataset series or data service
- Throws:
InvalidParameterException- the unique identifier is not known or is not for an asset.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getDocument
Assemble a document from a catalog and the resources that it lists.- Parameters:
catalog- description of the catalog (may be null)resources- descriptions of datasets, dataset series and data services- Returns:
- document
-
generateResource
public DcatResource generateResource(String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Generate the DCAT description of an asset.- Parameters:
assetGUID- unique identifier of the asset- Returns:
- dataset, dataset series or data service
- Throws:
InvalidParameterException- the unique identifier is not known or is not for an asset.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
generateCatalog
public DcatCatalog generateCatalog(String collectionGUID, List<DcatResource> members) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Generate the DCAT description of a collection as a catalog. The members of the catalog are supplied by the caller, which decides which of the collection's members are to be published.- Parameters:
collectionGUID- unique identifier of the collectionmembers- descriptions of the resources to list in the catalog- Returns:
- catalog
- Throws:
InvalidParameterException- the unique identifier is not known or is not for a collection.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-