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.GraphEntityIdentifier (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
AbstractEntityclass.- 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
Identifierentities 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 containingGraphSetreferring 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:labelis considered as a functional property, whilerdf:typeis 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:hasLiteralValueRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[str]
- get_scheme()[source]
Getter method corresponding to the
datacite:usesIdentifierSchemeRDF predicate.- Returns
The requested value if found, None otherwise
- Return type
Optional[URIRef]
- create_oci(string)[source]
Setter method corresponding to both the
literal:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:ocifor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:orcidfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:doifor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:pmidfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:pmcidfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:issnfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:isbnfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:urlfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:intrepidfor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object value datacite:local-resource-identifier-scheme for thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:wikidatafor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:wikipediafor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:crossreffor thedatacite:usesIdentifierSchemeRDF 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:hasLiteralValueand thedatacite:usesIdentifierSchemeRDF predicate. It implicitly sets the object valuedatacite:viaffor thedatacite:usesIdentifierSchemeRDF 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