oc_ocdm.metadata.entities.distribution module
- class oc_ocdm.metadata.entities.distribution.Distribution(g, base_iri, dataset_name, m_set, res=None, res_type=None, resp_agent=None, source=None, count=None, label=None, short_name='', preexisting_graph=None)[source]
Bases:
oc_ocdm.metadata.metadata_entity.MetadataEntityDistribution (short: di): an accessible form of a dataset, for example a downloadable file.
Constructor of the
AbstractEntityclass.- Parameters
g (Graph) –
base_iri (str) –
dataset_name (str) –
m_set (MetadataSet) –
res (URIRef) –
res_type (URIRef) –
resp_agent (str) –
source (str) –
count (str) –
label (str) –
short_name (str) –
preexisting_graph (Graph) –
- Return type
None
- merge(other)[source]
The merge operation allows combining two
Distributionentities into a single one, by marking the second entity as to be deleted while also copying its data into the currentDistribution. Moreover, every triple from the containingMetadataSetreferring to the second entity gets “redirected” to the current entity: every other reference contained inside a different source (e.g. a triplestore) must be manually handled by the user!In case of functional properties, values from the current entity get overwritten by those coming from the second entity while, in all other cases, values from the second entity are simply appended to those of the current entity. In this context,
rdfs:labelis considered as a functional property, whilerdf:typeis not.- Parameters
other (Distribution) – The entity which will be marked as to be deleted and whose properties will be merged into the current entity.
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- get_title()[source]
Getter method corresponding to the
dcterms:titleRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_title(string)[source]
Setter method corresponding to the
dcterms:titleRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The title of the distribution.
- Parameters
string (str) – The value that will be set as the object of the property related to this method
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_title()[source]
Remover method corresponding to the
dcterms:titleRDF predicate.- Returns
None
- Return type
None
- get_description()[source]
Getter method corresponding to the
dcterms:descriptionRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_description(string)[source]
Setter method corresponding to the
dcterms:descriptionRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
A short textual description of the content of the distribution.
- Parameters
string (str) – The value that will be set as the object of the property related to this method
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_description()[source]
Remover method corresponding to the
dcterms:descriptionRDF predicate.- Returns
None
- Return type
None
- get_publication_date()[source]
Getter method corresponding to the
dcterms:issuedRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_publication_date(string)[source]
Setter method corresponding to the
dcterms:issuedRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The date of first publication of the distribution.
- Parameters
string (str) – The value that will be set as the object of the property related to this method. It must be a string compliant with the
xsd:dateTimedatatype.- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_publication_date()[source]
Remover method corresponding to the
dcterms:issuedRDF predicate.- Returns
None
- Return type
None
- get_byte_size()[source]
Getter method corresponding to the
dcat:byte_sizeRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_byte_size(string)[source]
Setter method corresponding to the
dcat:byte_sizeRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The size in bytes of the distribution.
- Parameters
string (str) – The value that will be set as the object of the property related to this method. It must be a string compliant with the
xsd:decimaldatatype.- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_byte_size()[source]
Remover method corresponding to the
dcat:byte_sizeRDF predicate.- Returns
None
- Return type
None
- get_license()[source]
Getter method corresponding to the
dcterms:licenseRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_license(thing_res)[source]
Setter method corresponding to the
dcterms:licenseRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The resource describing the license associated with the data in the distribution.
- Parameters
thing_res (URIRef) – The value that will be set as the object of the property related to this method
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_license()[source]
Remover method corresponding to the
dcterms:licenseRDF predicate.- Returns
None
- Return type
None
- get_download_url()[source]
Getter method corresponding to the
dcat:downloadURLRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_download_url(thing_res)[source]
Setter method corresponding to the
dcat:downloadURLRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The URL of the document where the distribution is stored.
- Parameters
thing_res (URIRef) – The value that will be set as the object of the property related to this method
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_download_url()[source]
Remover method corresponding to the
dcat:downloadURLRDF predicate.- Returns
None
- Return type
None
- get_media_type()[source]
Getter method corresponding to the
dcat:mediaTypeRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_media_type(thing_res)[source]
Setter method corresponding to the
dcat:mediaTypeRDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The file type of the representation of the distribution (according to IANA media types).
- Parameters
thing_res (URIRef) – The value that will be set as the object of the property related to this method
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None