oc_ocdm.support.support module

oc_ocdm.support.support.create_date(date_list=None)[source]
Parameters

date_list (List[Optional[int]]) –

Return type

Optional[str]

oc_ocdm.support.support.get_datatype_from_iso_8601(string)[source]
Parameters

string (str) –

Return type

Tuple[URIRef, str]

oc_ocdm.support.support.get_ordered_contributors_from_br(br, contributor_type)[source]
Parameters
oc_ocdm.support.support.encode_url(u)[source]
Parameters

u (str) –

Return type

str

oc_ocdm.support.support.create_literal(g, res, p, s, dt=None, nor=True)[source]
Parameters
  • g (Graph) –

  • res (URIRef) –

  • p (URIRef) –

  • s (str) –

  • dt (URIRef) –

  • nor (bool) –

Return type

None

oc_ocdm.support.support.create_type(g, res, res_type)[source]
Parameters
  • g (Graph) –

  • res (URIRef) –

  • res_type (URIRef) –

Return type

None

oc_ocdm.support.support.is_string_empty(string)[source]
Parameters

string (str) –

Return type

bool

oc_ocdm.support.support.get_base_iri(res)[source]
Parameters

res (URIRef) –

Return type

str

oc_ocdm.support.support.get_short_name(res)[source]
Parameters

res (URIRef) –

Return type

str

oc_ocdm.support.support.get_prov_subject_short_name(prov_res)[source]
Parameters

prov_res (URIRef) –

Return type

str

oc_ocdm.support.support.get_prefix(res)[source]
Parameters

res (URIRef) –

Return type

str

oc_ocdm.support.support.get_prov_subject_prefix(prov_res)[source]
Parameters

prov_res (URIRef) –

Return type

str

oc_ocdm.support.support.get_count(res)[source]
Parameters

res (URIRef) –

Return type

str

oc_ocdm.support.support.get_prov_subject_count(prov_res)[source]
Parameters

prov_res (URIRef) –

Return type

str

oc_ocdm.support.support.get_resource_number(res)[source]
Parameters

res (URIRef) –

Return type

int

oc_ocdm.support.support.find_local_line_id(res, n_file_item=1)[source]
Parameters
  • res (URIRef) –

  • n_file_item (int) –

Return type

int

oc_ocdm.support.support.find_paths(res, base_dir, base_iri, default_dir, dir_split, n_file_item, is_json=True)[source]

This function is responsible for looking for the correct JSON file that contains the data related to the resource identified by the variable ‘string_iri’. This search takes into account the organisation in directories and files, as well as the particular supplier prefix for bibliographic entities, if specified. In case no supplier prefix is specified, the ‘default_dir’ (usually set to “_”) is used instead.

Parameters
  • res (URIRef) –

  • base_dir (str) –

  • base_iri (str) –

  • default_dir (str) –

  • dir_split (int) –

  • n_file_item (int) –

  • is_json (bool) –

Return type

Tuple[str, str]

oc_ocdm.support.support.has_supplier_prefix(res, base_iri)[source]
Parameters
  • res (URIRef) –

  • base_iri (str) –

Return type

bool

oc_ocdm.support.support.is_dataset(res)[source]
Parameters

res (URIRef) –

Return type

bool