oc_ocdm.graph.entities.bibliographic.reference_pointer module

class oc_ocdm.graph.entities.bibliographic.reference_pointer.ReferencePointer(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

Reference pointer (long: in-text reference pointer; short: rp): a textual device (e.g. ‘[1]’), denoting a single bibliographic reference, that is embedded in the text of a document within the context of a particular sentence or text chunk. A bibliographic reference can be denoted in the text by one or more in-text reference pointers.

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 ReferencePointer entities into a single one, by marking the second entity as to be deleted while also copying its data into the current ReferencePointer. 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 (ReferencePointer) – 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_content()[source]

Getter method corresponding to the c4o:hasContent RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[str]

has_content(string)[source]

Setter method corresponding to the c4o:hasContent RDF predicate.

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

The literal text of the textual device forming an in-text reference pointer and denoting a single bibliographic reference (e.g. “[1]”).

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

Remover method corresponding to the c4o:hasContent RDF predicate.

Returns

None

Return type

None

get_next_rp()[source]

Getter method corresponding to the oco:hasNext RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[ReferencePointer]

has_next_rp(rp_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 following in-text reference pointer, when included within a single in-text reference pointer list.

Parameters

rp_res (ReferencePointer) – 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_rp()[source]

Remover method corresponding to the oco:hasNext RDF predicate.

Returns

None

Return type

None

get_denoted_be()[source]

Getter method corresponding to the c4o:denotes RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[BibliographicReference]

denotes_be(be_res)[source]

Setter method corresponding to the c4o:denotes RDF predicate.

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

The bibliographic reference included in the list of bibliographic references, denoted by the in-text reference pointer.

Parameters

be_res (BibliographicReference) – 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_denoted_be()[source]

Remover method corresponding to the c4o:denotes RDF predicate.

Returns

None

Return type

None

get_annotations()[source]

Getter method corresponding to the oco:hasAnnotation RDF predicate.

Returns

A list containing the requested values if found, None otherwise

Return type

List[ReferenceAnnotation]

has_annotation(an_res)[source]

Setter method corresponding to the oco:hasAnnotation RDF predicate.

An annotation characterizing the citation to which the in-text reference pointer relates in terms of its citation function (the reason for that citation) specific to the textual location of that in-text reference pointer within the citing entity.

Parameters

an_res (ReferenceAnnotation) – 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_annotation(an_res=None)[source]

Remover method corresponding to the oco:hasAnnotation RDF predicate.

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

Parameters

an_res (ReferenceAnnotation) – 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