oc_ocdm.graph.entities.bibliographic.pointer_list module

class oc_ocdm.graph.entities.bibliographic.pointer_list.PointerList(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

Pointer list (short: pl): a textual device (e.g. ‘[1, 2, 3]’ or ‘[4-9]’) which includes a number of reference pointers denoting the specific bibliographic references to which the list pertains.

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

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

Getter method corresponding to the co:element RDF predicate.

Returns

A list containing the requested values if found, None otherwise

Return type

List[ReferencePointer]

contains_element(rp_res)[source]

Setter method corresponding to the co:element RDF predicate.

The in-text reference pointer that is part of the in-text reference pointer list present at a particular location within the body of the citing work.

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_contained_element(rp_res=None)[source]

Remover method corresponding to the co:element RDF predicate.

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

Parameters

rp_res (ReferencePointer) – 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