Editing entities#
The meta_editor.py script allows you to edit entities. For update, delete and sync, changes are applied to the triplestore and propagated to the RDF files and the provenance. The merge operation instead runs the merge pipeline, which writes RDF and provenance files only: re-index the triplestore from the files afterwards.
Usage#
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>]
Parameters#
Parameter |
Description |
|---|---|
|
Path to the Meta configuration file |
|
Operation to perform: |
|
URI of the entity to modify |
|
Your ORCID (responsible agent for provenance) |
|
Property to modify (for update/delete) |
|
New value (for update) or value to remove (for delete) |
|
Second entity URI (for merge) |
Operations#
Update a property#
Change the value of a property on an entity:
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 entity or property#
Delete an entire entity:
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:
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"
Sync RDF with triplestore#
Regenerate RDF files from triplestore data:
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 two entities#
Merge a duplicate entity into another:
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 through the same pipeline used for batch merges (closure import, container cascade, role-chain handling; see Merge entities). The result is written to the RDF and provenance files only; the triplestore must be re-indexed from the files afterwards.