Export changes as KGCL
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python, typescript
Research direction
Read packages/core/src/types.ts and formatHunk in packages/core/src/i18n.ts, then compare the exporter and argument handling in packages/cli/src/markdown.ts and packages/cli/src/args.ts. Inspect examples/datasets/ontology-release/ and resolve the listed grammar, unsupported-change, CURIE, and package questions in a comment before coding. Done means the example produces a KGCL snapshot accepted by the reference parser, with CLI docs in English and Chinese and a changeset.
Written by the indexing model from the issue text.
Description
Why
KGCL (Knowledge Graph Change Language) is how the OBO
community writes ontology changes down: rename, obsolete … with replacement, move … from … to …, create synonym, create edge, and so on. Ontology editors and bots already read and
apply it. A KGCL export would let a reviewer go from "here is what changed" in kgdiff to a
change list the OBO tooling understands, and makes kgdiff easier to adopt in ontology
repositories.
What
kgdiff a.obo b.obo --kgcl [file] (CLI) and a toKgcl(result) function (library) that write
one KGCL command per change.
docs/delta-format.md already sketches the mapping
(Relation to other formats).
Hunks carry the semantics KGCL has words for (move, merge, rename); the delta carries the
primitive operations for everything else. Roughly:
| kgdiff | KGCL |
|---|---|
rename (node.set label) |
rename X from 'old' to 'new' |
| move hunk | move X from P to Q |
merge hunk, deprecation with replacedBy |
obsolete X with replacement Y |
| alias added / removed | create synonym 'a' for X / remove synonym |
node.add / node.remove |
create node X 'label' / delete X |
edge.add / edge.remove |
create edge X R Y / delete edge X R Y |
Check every command against the current KGCL grammar; the table is a starting point, not the spec.
Open questions (answer them in a comment before writing code)
- Changes KGCL cannot express (attribute edits it has no command for, splits): skip with a
warning, or emit them as comments? - Ids: KGCL wants CURIEs. Full IRIs from RDF inputs need compacting (
compactIriin
@kgdiff/formats), with the file's own prefixes. - Which package:
@kgdiff/corestays format-agnostic and dependency-free, so this probably
belongs next to the CLI'smarkdown.ts, or in a small new package.
Where to start
- Hunk and op types:
packages/core/src/types.ts; how hunks are worded:formatHunkin
packages/core/src/i18n.ts. - An exporter with the same shape:
packages/cli/src/markdown.ts(--markdown), and how
options with an optional file argument are parsed:json/delta/markdownin
packages/cli/src/args.ts. - Test data:
examples/datasets/ontology-release/has merges, a split, moves, renames and
obsoletions.
Done when
- The
ontology-releaseexample exports to KGCL that the reference parser
(kgcl-schema, Python) accepts, checked once by hand and
pinned as a golden snapshot inpackages/cli/test/__snapshots__/. docs/cli.mddocuments the option (en + zh), plus a changeset.
- Dominant language
- TypeScript
- Stars
- 47
- Forks
- 6
- Avg merge
- 2h 32m
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from iiwish/kgdiff
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
accessibility help wanted viewer
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
iiwish/kgdiff#16 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 1/100
iiwish/kgdiff#21 · 1 comment ·
Maintainers usually reply within 1 day
-
cli enhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 57/100
Maintainers usually reply within 1 day
-
documentation help wanted
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
assistant-ui/assistant-ui#10499 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug server-sequentialthinking v2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/servers#5526 · 1 comment ·
Maintainers usually reply within 1 day
-
app-server bug CLI
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainers usually reply within 1 day