Class DcatMappingBase
- Direct Known Subclasses:
DcatGenerator,DcatMapper
The mapping between the two is as follows. A dcat:Dataset is a DataSet asset and each of its dcat:Distributions is a DataFile asset (when it has a download URL) or a DataStore asset (when it only has an access URL) that is anchored to the data set and linked to it with a DataSetContent relationship. A dcat:DatasetSeries is a DataSet asset linked to its member data sets by DataSetContent relationships. A dcat:DataService is a DeployedAPI asset with an Endpoint for each endpoint URL, linked to the data sets it serves by DataSetContent relationships. A dcat:Catalog is a CollectionFolder whose members are its datasets, data services and nested catalogs. Keywords are SearchKeywords, the publisher is an Organization that scopes the element, contact points are ContactDetails, the licence is a LicenseType and the standards and documentation pages are ExternalReferences. The DCAT properties that have no equivalent in open metadata are kept in the additional properties with names that begin "dcat.".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringPrefix of the additional properties that hold values from a DCAT description.static final Stringstatic final Stringstatic final StringPrefix of the qualified name of a collection catalogued from a dcat:Catalog.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringLabel on the ExternalReferenceLink relationship to a standard that the resource conforms to.static final Stringprotected final ConnectorContextBasestatic final Stringstatic final Stringstatic final StringPrefix of the qualified name of a deployed API catalogued from a dcat:DataService.static final Stringstatic final StringPrefix of the qualified name of a data set catalogued from a dcat:Dataset or dcat:DatasetSeries.static final Stringstatic final Stringstatic final Stringstatic final StringPrefix of the qualified name of an asset catalogued from a dcat:Distribution.static final StringLabel on the ExternalReferenceLink relationship to a page that documents the resource.static final Stringstatic final Stringstatic final Stringstatic final StringPrefix of the IRI generated for an open metadata element that was not catalogued from a DCAT description.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final PropertyHelperstatic final Stringstatic final Stringstatic final Stringstatic final StringSeparator used in qualified names.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDcatMappingBase(ConnectorContextBase context) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected OpenMetadataElementfindElement(String qualifiedName) Return the element with the requested qualified name.protected StringfindElementGUID(String qualifiedName) Return the unique identifier of the element with the requested qualified name.Return the additional properties of an element.protected static <T> TRead a bean from a JSON additional property.protected static <T> List<T> Read a list of beans from a JSON additional property.getLinkedElementGUIDs(String elementGUID, int startingAtEnd, String relationshipTypeName) Return the unique identifiers of the elements that are linked to an element by a particular type of relationship.protected List<RelatedMetadataElement> getRelationships(String elementGUID, int startingAtEnd, String relationshipTypeName) Return all the relationships of a particular type that are attached to an element.getStringList(Map<String, String> additionalProperties, String name) Read a list of strings from a JSON additional property.protected StringgetStringProperty(OpenMetadataElement element, String propertyName) Return a string property of an element.protected static voidAdd a value to the additional properties if it is not null.protected static StringConvert a bean, list or map to JSON so that it can be kept in the additional properties.
-
Field Details
-
ADDITIONAL_PROPERTY_PREFIX
Prefix of the additional properties that hold values from a DCAT description.- See Also:
-
SEPARATOR
Separator used in qualified names.- See Also:
-
DATASET_QUALIFIED_NAME_PREFIX
Prefix of the qualified name of a data set catalogued from a dcat:Dataset or dcat:DatasetSeries.- See Also:
-
DISTRIBUTION_QUALIFIED_NAME_PREFIX
Prefix of the qualified name of an asset catalogued from a dcat:Distribution.- See Also:
-
DATA_SERVICE_QUALIFIED_NAME_PREFIX
Prefix of the qualified name of a deployed API catalogued from a dcat:DataService.- See Also:
-
CATALOG_QUALIFIED_NAME_PREFIX
Prefix of the qualified name of a collection catalogued from a dcat:Catalog.- See Also:
-
DATASET_KIND
- See Also:
-
DATASET_SERIES_KIND
- See Also:
-
DISTRIBUTION_KIND
- See Also:
-
DATA_SERVICE_KIND
- See Also:
-
CATALOG_KIND
- See Also:
-
KIND
- See Also:
-
IRI
- See Also:
-
ISSUED
- See Also:
-
MODIFIED
- See Also:
-
RESOURCE_TYPE
- See Also:
-
RIGHTS
- See Also:
-
ACCESS_RIGHTS
- See Also:
-
VERSION_NOTES
- See Also:
-
STATUS
- See Also:
-
PREVIOUS_VERSION
- See Also:
-
IDENTIFIERS_JSON
- See Also:
-
LANGUAGES_JSON
- See Also:
-
THEMES_JSON
- See Also:
-
PUBLISHER_JSON
- See Also:
-
CREATORS_JSON
- See Also:
-
LICENSE_JSON
- See Also:
-
TITLE_TRANSLATIONS_JSON
- See Also:
-
DESCRIPTION_TRANSLATIONS_JSON
- See Also:
-
OTHER_PROPERTIES_JSON
- See Also:
-
ACCRUAL_PERIODICITY
- See Also:
-
SPATIAL_JSON
- See Also:
-
TEMPORAL_JSON
- See Also:
-
SPATIAL_RESOLUTION_IN_METERS
- See Also:
-
TEMPORAL_RESOLUTION
- See Also:
-
ENDPOINT_DESCRIPTIONS_JSON
- See Also:
-
HOMEPAGE
- See Also:
-
THEME_TAXONOMIES_JSON
- See Also:
-
ACCESS_URL
- See Also:
-
DOWNLOAD_URL
- See Also:
-
MEDIA_TYPE
- See Also:
-
FORMAT
- See Also:
-
BYTE_SIZE
- See Also:
-
COMPRESS_FORMAT
- See Also:
-
PACKAGE_FORMAT
- See Also:
-
CONFORMS_TO_JSON
- See Also:
-
CHECKSUM_ALGORITHM
- See Also:
-
CHECKSUM_VALUE
- See Also:
-
ACCESS_SERVICES_JSON
- See Also:
-
CONTACT_POINT_JSON
- See Also:
-
CONFORMS_TO_LABEL
Label on the ExternalReferenceLink relationship to a standard that the resource conforms to.- See Also:
-
DOCUMENTATION_LABEL
Label on the ExternalReferenceLink relationship to a page that documents the resource.- See Also:
-
GENERATED_IRI_PREFIX
Prefix of the IRI generated for an open metadata element that was not catalogued from a DCAT description.- See Also:
-
context
-
propertyHelper
-
-
Constructor Details
-
DcatMappingBase
Constructor- Parameters:
context- the connector context that provides access to open metadata
-
-
Method Details
-
findElement
protected OpenMetadataElement findElement(String qualifiedName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the element with the requested qualified name.- Parameters:
qualifiedName- unique name- Returns:
- element or null if it does not exist
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
findElementGUID
protected String findElementGUID(String qualifiedName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the unique identifier of the element with the requested qualified name.- Parameters:
qualifiedName- unique name- Returns:
- unique identifier or null if the element does not exist
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getRelationships
protected List<RelatedMetadataElement> getRelationships(String elementGUID, int startingAtEnd, String relationshipTypeName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return all the relationships of a particular type that are attached to an element.- Parameters:
elementGUID- unique identifier of the starting elementstartingAtEnd- which end of the relationship the starting element is at (1 or 2)relationshipTypeName- type of relationship to follow- Returns:
- list of relationships with the element at the other end
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getLinkedElementGUIDs
protected Set<String> getLinkedElementGUIDs(String elementGUID, int startingAtEnd, String relationshipTypeName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the unique identifiers of the elements that are linked to an element by a particular type of relationship.- Parameters:
elementGUID- unique identifier of the starting elementstartingAtEnd- which end of the relationship the starting element is at (1 or 2)relationshipTypeName- type of relationship to follow- Returns:
- set of unique identifiers
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getStringProperty
Return a string property of an element.- Parameters:
element- elementpropertyName- name of the property- Returns:
- value or null
-
getAdditionalProperties
Return the additional properties of an element.- Parameters:
element- element- Returns:
- map - empty if the element has no additional properties
-
putIfPresent
protected static void putIfPresent(Map<String, String> additionalProperties, String name, String value) Add a value to the additional properties if it is not null.- Parameters:
additionalProperties- map to add toname- name of the property (without the prefix)value- value (may be null)
-
toJSON
Convert a bean, list or map to JSON so that it can be kept in the additional properties.- Parameters:
bean- bean, list or map (may be null)- Returns:
- JSON string, or null if there is nothing to convert
-
getStringList
Read a list of strings from a JSON additional property.- Parameters:
additionalProperties- additional properties of an elementname- name of the property (without the prefix)- Returns:
- list or null
-
getBeanList
protected static <T> List<T> getBeanList(Map<String, String> additionalProperties, String name, Class<T> beanClass) Read a list of beans from a JSON additional property.- Type Parameters:
T- type of bean- Parameters:
additionalProperties- additional properties of an elementname- name of the property (without the prefix)beanClass- class of the beans- Returns:
- list or null
-
getBean
protected static <T> T getBean(Map<String, String> additionalProperties, String name, Class<T> beanClass) Read a bean from a JSON additional property.- Type Parameters:
T- type of bean- Parameters:
additionalProperties- additional properties of an elementname- name of the property (without the prefix)beanClass- class of the bean- Returns:
- bean or null
-