Dataset and DatasetSeries#
- class fdp.dataset.Dataset(fair_data_point: FairDataPoint = None, iri: str = None, uuid: str = None, *args, **kwargs)#
Bases:
ResourceClass representing a DCATv3
dcat:Datasetentity.A Dataset is a collection of data available for access or download in one or more distributions.
This class extends
fdp.resource.Resource.- RDF Class
dcat:Dataset- Base Classes
- Supported inherited properties
- Supported Dataset-specific properties
hasQualityMeasurement— quality metrics associated with the datasetinSeries— links the dataset to a parentDatasetSeriesisPartOf— links the dataset to a catalog or another broader dataset that this dataset belongs to
- Example
>>> dataset = Dataset() >>> dataset.title = "Population Data 2024" >>> dataset.version = "1.0"
- add_distribution(distribution: Distribution | Graph | list[Distribution]) None#
Add one or more distributions to the Dataset.
This function accepts either a single
Distributioninstance anrdflib.graph.Graphobject containing distribution data, or a list ofDistributioninstances. The provided distribution(s) are added to the instance RDF graph, creating the corresponding RDF triples as needed.- Parameters:
distribution (Distribution | rdflib.Graph | list[Distribution]) –
The distribution or distributions to add. It can be one of the following:
An
DistributioninstanceAn
rdflib.graph.GraphinstanceA list of
Distributioninstances
- Returns:
None
- Return type:
None
- Raises:
TypeError – If the input type is not supported.
Note
- When a list is provided, each element must be an instance of
Distribution
- When a
rdflib.graph.Graphis provided and it contains more than one distribution description, all distributions found in the graph are added.
- When a
- property distribution: dict#
The
dcat:distributionproperty.The setter for this property is the function
add_distribution.
- property hasQualityMeasurement: dict#
The
dcat:hasQualityMeasurementpropery of the dataset.It provides the quality measurement associated with this resource.
This property links the dataset to a specific quality measurement instance, such as completeness or accuracy.
- Parameters:
value (CompletenessMeasurement) – an instance of
CompletenessMeasurementdescribing dataset quality.- Return type:
CompletenessMeasurement
- Returns:
The
CompletenessMeasurementinstance representing the quality measurement.- Raises:
TypeError – If the provided value is not a
CompletenessMeasurementinstance.
- property inSeries: dict#
The
dcat:inSeriesproperty of the dataset.The link to the dataset series this resource belongs to.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The dataset’s series.
- Returns:
The dataset’s
isPartOfrelationship.- Raises:
TypeError – if the provided value is not a valid IRI, UUID, or NodeIdentifier.
- property isPartOf: dict#
The
dcterms:isPartOfproperty of the dataset.The link to the parent resource, such as a dataset or catalog.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The dataset’s
isPartOfrelationship.- Raises:
TypeError – if the provided value is not a valid IRI, UUID, or NodeIdentifier.
- property temporal: dict#
The temporal coverage propery of the dataset.
This property represents the time period during which the described dataset is collected.
- Parameters:
value (PeriodOfTime) – an instance of
PeriodOfTimerepresenting the time period of the resource.- Returns:
the
PeriodOfTimeinstance describing the temporal coverage.- Return type:
PeriodOfTime
- Raises:
TypeError – if the provided value is not a
PeriodOfTimeinstance
- property creator#
The
dcterms:creatorproperty.- Type:
str,FOAFAgent,Graph- Return type:
- Returns:
The resource’s creator.
- property description#
The
dcterms:descriptionproperty.A free-text description of the resource.
- Type:
str,rdflib.term.Literal,rdflib.graph.Graph- Return type:
str- Returns:
The resource’s description.
- property issued#
The
dcterms:issuedproperty.The date the resource was formally issued or published.
- Type:
str,datetime.date,rdflib.graph.Graph,rdflib.term.Literal,- Return type:
datetime.date- Returns:
The publication or release date in ISO 8601 format.
- property license#
The
dcterms:licenseproperty.The license or rights statement under which the resource is made available.
- Type:
str,rdflib.term.URIRef,rdflib.graph.Graph- Return type:
str- Returns:
A reference to the license resource or a literal text description.
Note
must follow recommendation from: https://joinup.ec.europa.eu/release/dcat-ap-how-refer-licence-documents-and-licence-uris
- property publisher#
The
dcterms:publisherproperty.The entity responsible for making the resource available.
- Type:
str,FOAFAgent,rdflib.graph.Graph- Return type:
- Returns:
The publisher, typically a FOAF Agent.
- property theme#
The
dcat:themeproperty.The main category or subject of the resource.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The resource’s theme.
Note
a list of themes can be found here: https://inspire.ec.europa.eu/theme
Warning
Currently, only a single theme value is supported. The interface may change in future versions to support multiple themes.
- property title#
The
dcterms:titleproperty.The human-readable title of the resource.
- Type:
str,rdflib.term.Literal,rdflib.graph.Graph:rtype:str- Returns:
The preferred label or name of the resource.
- property version#
The
dcat:versionproperty.The version identifier for the resource.
- Type:
str,int, Tuple[int,int,int],fdp.version.Version,rdflib.graph.Graph,rdflib.term.Literal- Return type:
fdp.version.Version- Returns:
The version of the resource in one of the supported formats.
- class fdp.dataset.DatasetSeries(fair_data_point: FairDataPoint = None, iri: str = None, uuid: str = None)#
Bases:
DatasetClass representing a DCATv3 DatasetSerie.
- Variables:
uuid (str) – the uuid that is assigned by the Fair Data Point
- add_distribution(distribution: Distribution | Graph | list[Distribution]) None#
Add one or more distributions to the Dataset.
This function accepts either a single
Distributioninstance anrdflib.graph.Graphobject containing distribution data, or a list ofDistributioninstances. The provided distribution(s) are added to the instance RDF graph, creating the corresponding RDF triples as needed.- Parameters:
distribution (Distribution | rdflib.Graph | list[Distribution]) –
The distribution or distributions to add. It can be one of the following:
An
DistributioninstanceAn
rdflib.graph.GraphinstanceA list of
Distributioninstances
- Returns:
None
- Return type:
None
- Raises:
TypeError – If the input type is not supported.
Note
- When a list is provided, each element must be an instance of
Distribution
- When a
rdflib.graph.Graphis provided and it contains more than one distribution description, all distributions found in the graph are added.
- When a
- property creator#
The
dcterms:creatorproperty.- Type:
str,FOAFAgent,Graph- Return type:
- Returns:
The resource’s creator.
- property description#
The
dcterms:descriptionproperty.A free-text description of the resource.
- Type:
str,rdflib.term.Literal,rdflib.graph.Graph- Return type:
str- Returns:
The resource’s description.
- property distribution: dict#
The
dcat:distributionproperty.The setter for this property is the function
add_distribution.
- property hasQualityMeasurement: dict#
The
dcat:hasQualityMeasurementpropery of the dataset.It provides the quality measurement associated with this resource.
This property links the dataset to a specific quality measurement instance, such as completeness or accuracy.
- Parameters:
value (CompletenessMeasurement) – an instance of
CompletenessMeasurementdescribing dataset quality.- Return type:
CompletenessMeasurement
- Returns:
The
CompletenessMeasurementinstance representing the quality measurement.- Raises:
TypeError – If the provided value is not a
CompletenessMeasurementinstance.
- property inSeries: dict#
The
dcat:inSeriesproperty of the dataset.The link to the dataset series this resource belongs to.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The dataset’s series.
- Returns:
The dataset’s
isPartOfrelationship.- Raises:
TypeError – if the provided value is not a valid IRI, UUID, or NodeIdentifier.
- property isPartOf: dict#
The
dcterms:isPartOfproperty of the dataset.The link to the parent resource, such as a dataset or catalog.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The dataset’s
isPartOfrelationship.- Raises:
TypeError – if the provided value is not a valid IRI, UUID, or NodeIdentifier.
- property issued#
The
dcterms:issuedproperty.The date the resource was formally issued or published.
- Type:
str,datetime.date,rdflib.graph.Graph,rdflib.term.Literal,- Return type:
datetime.date- Returns:
The publication or release date in ISO 8601 format.
- property license#
The
dcterms:licenseproperty.The license or rights statement under which the resource is made available.
- Type:
str,rdflib.term.URIRef,rdflib.graph.Graph- Return type:
str- Returns:
A reference to the license resource or a literal text description.
Note
must follow recommendation from: https://joinup.ec.europa.eu/release/dcat-ap-how-refer-licence-documents-and-licence-uris
- property publisher#
The
dcterms:publisherproperty.The entity responsible for making the resource available.
- Type:
str,FOAFAgent,rdflib.graph.Graph- Return type:
- Returns:
The publisher, typically a FOAF Agent.
- property temporal: dict#
The temporal coverage propery of the dataset.
This property represents the time period during which the described dataset is collected.
- Parameters:
value (PeriodOfTime) – an instance of
PeriodOfTimerepresenting the time period of the resource.- Returns:
the
PeriodOfTimeinstance describing the temporal coverage.- Return type:
PeriodOfTime
- Raises:
TypeError – if the provided value is not a
PeriodOfTimeinstance
- property theme#
The
dcat:themeproperty.The main category or subject of the resource.
- Type:
str,rdflib.term.URIRef- Return type:
str- Returns:
The resource’s theme.
Note
a list of themes can be found here: https://inspire.ec.europa.eu/theme
Warning
Currently, only a single theme value is supported. The interface may change in future versions to support multiple themes.
- property title#
The
dcterms:titleproperty.The human-readable title of the resource.
- Type:
str,rdflib.term.Literal,rdflib.graph.Graph:rtype:str- Returns:
The preferred label or name of the resource.
- property version#
The
dcat:versionproperty.The version identifier for the resource.
- Type:
str,int, Tuple[int,int,int],fdp.version.Version,rdflib.graph.Graph,rdflib.term.Literal- Return type:
fdp.version.Version- Returns:
The version of the resource in one of the supported formats.