[OCWR] Week 12 - OpenCitations Weekly Report
Week from Oct 19 to Oct 25
Introduction
During the twelfth week, I made some breaking changes to the code of oc_ocdm which lead to the publishing of a new major release 2.0.0. A lot of methods had their names changed and a set of boolean flags was added to the GraphEntity class. Moreover, I had to think about the implementation of new “delete”, “merge” and “import_from_graph” operations applied to GraphEntity instances, which will be concretely done next week.
Report
Methods with new names
With respect to the changes already done last week, a lot of methods had their names changed, following the a rule which says that only those methods that add/remove rdf:type related triples should have a name starting with create_:
- BibliographicReference:
- from
create_annotationtohas_annotation - from
create_contenttohas_content
- from
- Citation:
- from
create_citing_entitytohas_citing_entity - from
create_cited_entitytohas_cited_entity
- from
- DiscourseElement:
- from
create_titletohas_title - from
create_contenttohas_content - from
create_numbertohas_number
- from
- ReferenceAnnotation:
- from
create_body_annotationtohas_body_annotation
- from
- ReferencePointer:
- from
create_annotationtohas_annotation - from
create_contenttohas_content
- from
- PointerList:
- from
create_contenttohas_content
- from
- BibliographicResource:
- from
create_titletohas_title - from
create_subtitletohas_subtitle - from
create_pub_datetohas_pub_date - from
create_numbertohas_number
- from
- ResourceEmbodiment:
- from
create_starting_pagetohas_starting_page - from
create_ending_pagetohas_ending_page
- from
- ResponsibleAgent:
- from
create_nametohas_name - from
create_given_nametohas_given_name - from
create_family_nametohas_family_name
- from
- GraphEntity:
- from
remove_entitytoremove_every_triple
- from
- ProvEntity:
- from
create_generation_timetohas_generation_time - from
create_invalidation_timetohas_invalidation_time - from
create_update_querytohas_update_action - from
create_descriptiontohas_description
- from
Newly added flags to the GraphEntity class
A new Python module called entity_flags.py was written, defining a class containing some important flags that will come in handy next
week when I’ll be working on the implementation of “delete”, “merge” and “import_from_graph” operations. Here’s a list of those flags
with an explanation of their meaning:
is_a_new_entity
It’s used to know if the considered entity is a new entity (it still doesn’t exists) or not. If a “new entity” gets stored anywhere on a persistent support, than it’s no more considered as “new” and the flag value will becomeFalse.preexisting_graph_was_loaded
It’s used to know if the fieldpreexisting_graphof the considered entity was initialized with a graph provided by the user to theGraphEntity’s constructor.to_be_deleted
It’s a flag which is settable by the user in order to mark the considered entity as to be deleted from the persistent storage or not.was_merged
It’s set asTrueif at least one “merge” operation is performed on the considered entity. In such a case, a field containing the list of other entities with which these operations were done (a field which is currently missing) should be kept inside theGraphEntityinstance.