oc_ocdm.graph.entities.bibliographic.agent_role module
- class oc_ocdm.graph.entities.bibliographic.agent_role.AgentRole(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
Agent role (short: ar): a particular role held by an agent with respect to a bibliographic resource.
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
AgentRole
entities into a single one, by marking the second entity as to be deleted while also copying its data into the currentAgentRole
. 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 (AgentRole) – 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_next()[source]
Getter method corresponding to the
oco:hasNext
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[AgentRole]
- has_next(ar_res)[source]
Setter method corresponding to the
oco:hasNext
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The previous role in a sequence of agent roles of the same type associated with the same bibliographic resource (so as to define, for instance, an ordered list of authors).
- Parameters
ar_res (AgentRole) – 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_next()[source]
Remover method corresponding to the
oco:hasNext
RDF predicate.- Returns
None
- Return type
None
- get_is_held_by()[source]
Getter method corresponding to the
pro:isHeldBy
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[ResponsibleAgent]
- is_held_by(ra_res)[source]
Setter method corresponding to the
pro:isHeldBy
RDF predicate.WARNING: this is a functional property, hence any existing value will be overwritten!
The agent holding this role with respect to a particular bibliographic resource.
- Parameters
ra_res (ResponsibleAgent) – 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
- remove_is_held_by()[source]
Remover method corresponding to the
pro:isHeldBy
RDF predicate.- Returns
None
- Return type
None
- get_role_type()[source]
Getter method corresponding to the
pro:withRole
RDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- create_publisher()[source]
Setter method corresponding to the
pro:withRole
RDF predicate. It implicitly sets the object valuepro:publisher
.WARNING: this is a functional property, hence any existing value will be overwritten!
The specific type of role under consideration (e.g. author, editor or publisher).
- Returns
None
- Return type
None
- create_author()[source]
Setter method corresponding to the
pro:withRole
RDF predicate. It implicitly sets the object valuepro:author
.WARNING: this is a functional property, hence any existing value will be overwritten!
The specific type of role under consideration (e.g. author, editor or publisher).
- Returns
None
- Return type
None
- create_editor()[source]
Setter method corresponding to the
pro:withRole
RDF predicate. It implicitly sets the object valuepro:editor
.WARNING: this is a functional property, hence any existing value will be overwritten!
The specific type of role under consideration (e.g. author, editor or publisher).
- Returns
None
- Return type
None