oc_ocdm.graph.entities.identifier module

class oc_ocdm.graph.entities.identifier.Identifier(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

Identifier (short: id): an external identifier (e.g. DOI, ORCID, PubMedID, Open Citation Identifier) associated with the bibliographic entity. Members of this class of metadata are themselves given unique corpus identifiers e.g. ‘id/0420129’.

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 Identifier entities into a single one, by marking the second entity as to be deleted while also copying its data into the current Identifier. Moreover, every triple from the containing GraphSet 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, while rdf:type is not.

Parameters

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

get_literal_value()[source]

Getter method corresponding to the literal:hasLiteralValue RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[str]

get_scheme()[source]

Getter method corresponding to the datacite:usesIdentifierScheme RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[URIRef]

create_oci(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:oci for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_orcid(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:orcid for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_doi(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:doi for the datacite:usesIdentifierScheme RDF predicate.

The string gets internally preprocessed by converting it to lowercase (e.g. ‘DOI:10.1111/HEX.12487’ becomes ‘doi:10.1111/hex.12487’).

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_pmid(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:pmid for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_pmcid(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:pmcid for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_issn(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:issn for the datacite:usesIdentifierScheme RDF predicate.

The string gets internally preprocessed by eventually replacing long dashes with short ones (e.g. ‘1522–4501’ becomes ‘1522-4501’).

WARNING: this is a functional property, hence any existing value will be overwritten!

Parameters

string (str) – The value that will be set as the object of the property related to this method. It must be a string different from ‘0000-0000’.

Raises

TypeError – if the parameter is of the wrong type

Returns

None

Return type

None

create_isbn(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:isbn for the datacite:usesIdentifierScheme RDF predicate.

The string gets internally preprocessed by eventually replacing long dashes with short ones (e.g. ‘817525766–0’ becomes ‘817525766-0’).

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_url(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:url for the datacite:usesIdentifierScheme RDF predicate.

The string gets internally preprocessed both by converting it to lowercase (e.g. ‘https://OPENCITATIONS.NET/’ becomes ‘https://opencitations.net/’) and by applying URL encoding on it (e.g. ‘https://opencitations.net/file name.txt’ becomes ‘https://opencitations.net/file%20name.txt’).

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_xpath(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_intrepid(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:intrepid for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_xmlid(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_wikidata(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:wikidata for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_wikipedia(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:wikipedia for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_crossref(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:crossref for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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

create_viaf(string)[source]

Setter method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate. It implicitly sets the object value datacite:viaf for the datacite:usesIdentifierScheme RDF predicate.

WARNING: this is a functional property, hence any existing value will be overwritten!

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_identifier_with_scheme()[source]

Remover method corresponding to both the literal:hasLiteralValue and the datacite:usesIdentifierScheme RDF predicate.

Returns

None

Return type

None