oc_ocdm.graph.entities.bibliographic.resource_embodiment module
- class oc_ocdm.graph.entities.bibliographic.resource_embodiment.ResourceEmbodiment(g, g_set, res=None, res_type=None, resp_agent=None, source=None, count=None, label=None, short_name='', preexisting_graph=None)[source]
Bases:
oc_ocdm.graph.entities.bibliographic_entity.BibliographicEntity
Resource embodiment (short: re): the particular physical or digital format in which a bibliographic resource was made available by its publisher.
Constructor of the
AbstractEntity
class.- Parameters
g (Graph) –
g_set (GraphSet) –
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
ResourceEmbodiment
entities into a single one, by marking the second entity as to be deleted while also copying its data into the currentResourceEmbodiment
. Moreover, every triple from the containingGraphSet
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 (ResourceEmbodiment) – 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_media_type()[source]
Getter method corresponding to the
dcterms:format
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_media_type(thing_res)[source]
Setter method corresponding to the
dcterms:format
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
It allows one to specify the IANA media type of the embodiment.
- 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_media_type()[source]
Remover method corresponding to the
dcterms:format
RDF predicate.- Returns
None
- Return type
None
- get_starting_page()[source]
Getter method corresponding to the
prism:startingPage
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_starting_page(string)[source]
Setter method corresponding to the
prism:startingPage
RDF predicate.The string gets internally preprocessed by eventually removing dashes and everything that follows them (e.g. ‘22-45’ becomes ‘22’).
WARNING: this is a functional property, hence any existing value will be overwritten!
The first page of the bibliographic resource according to the current embodiment.
- Parameters
string (str) – The value that will be set as the object of the property related to this method. It must be a string that starts with an integer number.
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_starting_page()[source]
Remover method corresponding to the
prism:startingPage
RDF predicate.- Returns
None
- Return type
None
- get_ending_page()[source]
Getter method corresponding to the
prism:endingPage
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- has_ending_page(string)[source]
Setter method corresponding to the
prism:endingPage
RDF predicate.The string gets internally preprocessed by eventually removing dashes and everything that comes before them (e.g. ‘22-45’ becomes ‘45’).
WARNING: this is a functional property, hence any existing value will be overwritten!
The last page of the bibliographic resource according to the current embodiment.
- Parameters
string (str) – The value that will be set as the object of the property related to this method. It must be a string that ends with an integer number.
- Raises
TypeError – if the parameter is of the wrong type
- Returns
None
- Return type
None
- remove_ending_page()[source]
Remover method corresponding to the
prism:endingPage
RDF predicate.- Returns
None
- Return type
None
- get_url()[source]
Getter method corresponding to the
frbr:exemplar
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- has_url(thing_res)[source]
Setter method corresponding to the
frbr:exemplar
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The URL at which the embodiment of the bibliographic resource is available.
- 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_url()[source]
Remover method corresponding to the
frbr:exemplar
RDF predicate.- Returns
None
- Return type
None
- create_digital_embodiment()[source]
Setter method corresponding to the
rdf:type
RDF predicate. It implicitly sets the object valuefabio:DigitalManifestation
.WARNING: the OCDM specification admits at most two types for an entity. The main type cannot be edited or removed. Any existing secondary type will be overwritten!
It identifies the particular type of the embodiment, either digital or print.
- Returns
None
- Return type
None
- create_print_embodiment()[source]
Setter method corresponding to the
rdf:type
RDF predicate. It implicitly sets the object valuefabio:PrintObject
.WARNING: the OCDM specification admits at most two types for an entity. The main type cannot be edited or removed. Any existing secondary type will be overwritten!
It identifies the particular type of the embodiment, either digital or print.
- Returns
None
- Return type
None