oc_ocdm.metadata.entities.dataset module
- class oc_ocdm.metadata.entities.dataset.Dataset(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.MetadataEntity
Dataset (short: not applicable and strictly dependent on the implementation of the dataset infrastructure): a set of collected information about something.
Constructor of the
AbstractEntity
class.- 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
Dataset
entities into a single one, by marking the second entity as to be deleted while also copying its data into the currentDataset
. Moreover, every triple from the containingMetadataSet
referring 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:label
is considered as a functional property, whilerdf:type
is not.- Parameters
other (Dataset) – 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:title
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_title(string)[source]
Setter method corresponding to the
dcterms:title
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The title of the dataset.
- 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:title
RDF predicate.- Returns
None
- Return type
None
- get_description()[source]
Getter method corresponding to the
dcterms:description
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_description(string)[source]
Setter method corresponding to the
dcterms:description
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
A short textual description of the content of the dataset.
- 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:description
RDF predicate.- Returns
None
- Return type
None
- get_publication_date()[source]
Getter method corresponding to the
dcterms:issued
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_publication_date(string)[source]
Setter method corresponding to the
dcterms:issued
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The date of first publication of the dataset.
- 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:dateTime
datatype.- 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:issued
RDF predicate.- Returns
None
- Return type
None
- get_modification_date()[source]
Getter method corresponding to the
dcterms:modified
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_modification_date(string)[source]
Setter method corresponding to the
dcterms:modified
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The date on which the dataset has been modified.
- 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:dateTime
datatype.- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_modification_date()[source]
Remover method corresponding to the
dcterms:modified
RDF predicate.- Returns
None
- Return type
None
- get_keywords()[source]
Getter method corresponding to the
dcat:keyword
RDF predicate.- Returns
A list containing the requested values if found, None otherwise
- Return type
List[str]
- has_keyword(string)[source]
Setter method corresponding to the
dcat:keyword
RDF predicate.A keyword or phrase describing the content of the dataset.
- 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_keyword(string=None)[source]
Remover method corresponding to the
dcat:keyword
RDF predicate.WARNING: this is a non-functional property, hence, if the parameter is None, any existing value will be removed!
- Parameters
string (str) – If not None, the specific object value that will be removed from the property related to this method (defaults to None)
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- get_subjects()[source]
Getter method corresponding to the
dcat:theme
RDF predicate.- Returns
A list containing the requested values if found, None otherwise
- Return type
List[URIRef]
- has_subject(thing_res)[source]
Setter method corresponding to the
dcat:theme
RDF predicate.A concept describing the primary subject of the dataset.
- 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_subject(thing_res=None)[source]
Remover method corresponding to the
dcat:theme
RDF predicate.WARNING: this is a non-functional property, hence, if the parameter is None, any existing value will be removed!
- Parameters
thing_res (URIRef) – If not None, the specific object value that will be removed from the property related to this method (defaults to None)
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- get_landing_page()[source]
Getter method corresponding to the
dcat:landingPage
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_landing_page(thing_res)[source]
Setter method corresponding to the
dcat:landingPage
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
An HTML page (indicated by its URL) representing a browsable page for the dataset.
- 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_landing_page()[source]
Remover method corresponding to the
dcat:landingPage
RDF predicate.- Returns
None
- Return type
None
- get_sub_datasets()[source]
Getter method corresponding to the
void:subset
RDF predicate.- Returns
A list containing the requested values if found, None otherwise
- Return type
List[Dataset]
- has_sub_dataset(obj)[source]
Setter method corresponding to the
void:subset
RDF predicate.A link to a subset of the present dataset.
- Parameters
obj (Dataset) – 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_sub_dataset(dataset_res=None)[source]
Remover method corresponding to the
void:subset
RDF predicate.WARNING: this is a non-functional property, hence, if the parameter is None, any existing value will be removed!
- Parameters
dataset_res (Dataset) – If not None, the specific object value that will be removed from the property related to this method (defaults to None)
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- get_sparql_endpoint()[source]
Getter method corresponding to the
void:sparqlEndpoint
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_sparql_endpoint(thing_res)[source]
Setter method corresponding to the
void:sparqlEndpoint
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The link to the SPARQL endpoint for querying the dataset.
- 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_sparql_endpoint()[source]
Remover method corresponding to the
void:sparqlEndpoint
RDF predicate.- Returns
None
- Return type
None
- get_distributions()[source]
Getter method corresponding to the
dcat:distribution
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
List[Distribution]
- has_distribution(obj)[source]
Setter method corresponding to the
dcat:distribution
RDF predicate.A distribution of the dataset.
- Parameters
obj (Distribution) – 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_distribution(di_res=None)[source]
Remover method corresponding to the
dcat:distribution
RDF predicate.WARNING: this is a non-functional property, hence, if the parameter is None, any existing value will be removed!
- Parameters
di_res (Distribution) – If not None, the specific object value that will be removed from the property related to this method (defaults to None)
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None