oc_ocdm.graph.entities.bibliographic_entity module

class oc_ocdm.graph.entities.bibliographic_entity.BibliographicEntity(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.graph_entity.GraphEntity

The base class for each bibliographic entity of the OpenCitations DataModel (OCDM).

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]

WARNING: BibliographicEntity is an abstract class that cannot be instantiated at runtime. As such, it’s only possible to execute this method on entities generated from BibliographicEntity’s subclasses. Please, refer to their documentation of the merge method.

Parameters

other (BibliographicEntity) – 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_identifiers()[source]

Getter method corresponding to the datacite:hasIdentifier RDF predicate.

Returns

A list containing the requested values if found, None otherwise

Return type

List[Identifier]

has_identifier(id_res)[source]

Setter method corresponding to the datacite:hasIdentifier RDF predicate.

In addition to the internal dataset identifier assigned to the entity upon initial curation (format: [entity short name]/[local identifier]), other external third-party identifiers can be specified through this attribute (e.g. DOI, ORCID, PubMedID).

Parameters

id_res (Identifier) – 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_identifier(id_res=None)[source]

Remover method corresponding to the datacite:hasIdentifier RDF predicate.

WARNING: this is a non-functional property, hence, if the parameter is None, any existing value will be removed!

Parameters

id_res (Identifier) – 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

remove_duplicated_identifiers()[source]

Utility function that automatically scans the list of Identifier entities associated to the current bibliographic entity (through the datacite:hasIdentifier RDF predicate) and it removes duplicated entries.

Two distinct Identifier entities are considered the same if they share both the scheme (datacite:usesIdentifierScheme) and the literal value (literal:hasLiteralValue).

Returns

None

Return type

None