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 currentIdentifier
. 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 (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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:oci
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:orcid
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:doi
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:pmid
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:pmcid
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:issn
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:isbn
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:url
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:intrepid
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:wikidata
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:wikipedia
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:crossref
for thedatacite: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 thedatacite:usesIdentifierScheme
RDF predicate. It implicitly sets the object valuedatacite:viaf
for thedatacite: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