java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatMappingBase
org.odpi.openmetadata.frameworks.integration.dcat.mapping.DcatGenerator

public class DcatGenerator extends DcatMappingBase
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.

  • Constructor Details

    • DcatGenerator

      public DcatGenerator(ConnectorContextBase context)
      Constructor
      Parameters:
      context - the connector context that provides access to open metadata
  • Method Details

    • setDefaultPublisherName

      public void setDefaultPublisherName(String defaultPublisherName)
      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

      public String getIRI(OpenMetadataElement element)
      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

      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

      public DcatDocument getDocument(DcatCatalog catalog, List<DcatResource> resources)
      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

      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

      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 collection
      members - 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.