oc_ocdm.graph.entities.bibliographic.reference_annotation module

class oc_ocdm.graph.entities.bibliographic.reference_annotation.ReferenceAnnotation(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 annotation (short: an): an annotation, attached either to an in-text reference pointer or to a bibliographic reference, describing the related citation. If an in-text reference pointer is annotated, the related citation may be characterized with a citation function (the reason for that citation) specific to the textual location of that in-text reference pointer within the citing entity. If a bibliographic reference is annotated, the related citation may be similarly characterized in a more general way with a citation function (the reason for that citation).

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

Getter method corresponding to the oa:hasBody RDF predicate.

Returns

The requested value if found, None otherwise

Return type

Optional[Citation]

has_body_annotation(ci_res)[source]

Setter method corresponding to the oa:hasBody RDF predicate.

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

The citation to which the annotation relates, that is relevant either to a bibliographic reference or to an in-text reference pointer that denotes such a bibliographic reference.

Parameters

ci_res (Citation) – 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_body_annotation()[source]

Remover method corresponding to the oa:hasBody RDF predicate.

Returns

None

Return type

None