Skip to content

Editing entities

The meta_editor.py script allows you to edit entities directly in the triplestore. Changes are propagated to both the RDF files and the provenance.

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c <config_path> \
-op <operation> \
-s <subject_uri> \
-r <your_orcid> \
[-p <property>] \
[-o <object>] \
[-ot <other_uri>]
ParameterDescription
-c, --configPath to the Meta configuration file
-op, --operationOperation to perform: update, delete, sync, or merge
-s, --subjectURI of the entity to modify
-r, --respYour ORCID (responsible agent for provenance)
-p, --propertyProperty to modify (for update/delete)
-o, --objectNew value (for update) or value to remove (for delete)
-ot, --otherSecond entity URI (for merge)

Change the value of a property on an entity:

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c meta_config.yaml \
-op update \
-s "https://w3id.org/oc/meta/br/0601" \
-p has_title \
-o "New Title" \
-r "https://orcid.org/0000-0002-8420-0696"

Delete an entire entity:

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c meta_config.yaml \
-op delete \
-s "https://w3id.org/oc/meta/br/0601" \
-r "https://orcid.org/0000-0002-8420-0696"

Delete a specific property value:

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c meta_config.yaml \
-op delete \
-s "https://w3id.org/oc/meta/br/0601" \
-p has_identifier \
-o "https://w3id.org/oc/meta/id/0601" \
-r "https://orcid.org/0000-0002-8420-0696"

Regenerate RDF files from triplestore data:

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c meta_config.yaml \
-op sync \
-s "https://w3id.org/oc/meta/br/0601" \
-r "https://orcid.org/0000-0002-8420-0696"

Merge a duplicate entity into another:

Terminal window
uv run python -m oc_meta.run.meta_editor \
-c meta_config.yaml \
-op merge \
-s "https://w3id.org/oc/meta/br/0601" \
-ot "https://w3id.org/oc/meta/br/0602" \
-r "https://orcid.org/0000-0002-8420-0696"

The entity specified with -ot is merged into the entity specified with -s. All references to the merged entity are updated, and the merged entity is marked as deleted.