Repository navigation
v0.5.0
Minor changes
-
764535e: The terminal summary and the Markdown summary (so the GitHub Action's pull request comment too) list the possible matches: pairings kgdiff considered but did not apply, between a node listed as removed and one listed as added. Until now only the viewer's detail panel showed them, so "removed “Saudi Aramco”, added “Aramco”" gave no hint that the two may be one entity. Each line names both nodes (with their ids when the names are equal), the score, why it was not applied (below
--threshold, or too close to another candidate) and the label and neighbourhood evidence, and a closing line says how to pair one: a synonym, a replacement link or a lower threshold. At most 10 in the terminal (all with--limit 0) and 20 in Markdown;--jsonkeeps every suggestion.@kgdiff/cli -
3f6e7d8: Changes to definitions are flagged ⚑ for review first. A reworded definition can change what existing data means while the diff looks small, and it used to be folded into
~1 attributeamong the other edits. Now a line under the diffstat bar counts the hunks that change one (⚑ Review first: definition changed in 9 hunks, also in--stat), each of their rows says so before its summary (content · ⚑ definition · ~2 attributes), and the Markdown summary, so the GitHub Action's pull request comment too, lists them in a ⚑ Review first block before the phase groups. By default kgdiff watchesdef(OBO),definition(kgdiff JSON),IAO:0000115andskos:definition; the new--watch-attr <key>(repeatable) replaces that list, e.g.--watch-attr rdfs:commentfor schema.org-style vocabularies.TextContextandMarkdownOptionstake the same list aswatch, andDEFAULT_WATCH_ATTRSandwatchedChangesare exported.@kgdiff/cli -
6ed2b9c: HTML reports are smaller: they embed the diff packed (
packDiffJSON, formatkgdiff.diff.packed, schemaschema/diff-packed.v1.json), with its unchanged elements, which are most of a large diff, stored as tables of indices into one string table. For 100k nodes / 300k edges the embedded diff goes from 68.7 MB to 19.3 MB, 6.8 MB to 3.2 MB gzipped, and the report opens as fast.unpackDiffJSONgives theDiffJSONback byte for byte; the viewer reads packed and unpacked payloads (ReportPayload.diffis either), so older reports still open. The standalone viewer bundle budget goes from 100 kB to 105 kB (min + gzip) for the unpacking and the consistency checks ofdiffFromJSON.@kgdiff/cli·@kgdiff/core·@kgdiff/viewer -
f957a49:
diffFromJSONchecks that a diff document is consistent before it returns, and throwsinvalid-inputnaming the first contradiction: an element whose versions do not fit its status (an added node with a before id, a removed edge with an after snapshot), an unchanged element with facets or a hunk, a changed one outside every hunk, a repeated id, an edge whose endpoints are not union nodes or disagree with its snapshots, a hunk that lists elements that are not its own, delta ops owned by two hunks or out of range, hunks out of review order, a summary or stats that do not match the elements, or a delta whose base or target is another graph (by content hash). Until now such a document was read as it was, and a viewer could show wrong counts or export a delta for other graphs. Everything kgdiff writes passes.diffFromJSONis also about 10% faster on large diffs: edges are found by their key instead of by a canonical JSON fingerprint.schema/diff.v1.jsonstates the same rules per element (versions by status; facets and hunk by status).@kgdiff/core -
212c48c:
UnionNodeandUnionEdgeare now unions bystatus, so the types say which versions an element is in: anaddednode hasafterIdandafterand no before version, aremovedone onlybeforeIdandbefore, anunchangedormodifiedone both; the same for edges, where only edges in both versions can havesourceBefore,targetBeforeorpredicateBefore. Narrow onstatusto readbefore/afterwithout?.or casts (AddedUnionNode,RemovedUnionNode,MatchedUnionNodeand the edge counterparts name the cases). The objects themselves are unchanged; code that builds union elements by hand (test fixtures, mocks) now has to give each status the versions it implies.@kgdiff/core
Patch changes
-
86f4583: The bug report link of an unexpected error takes the platform and the Node.js version from
CliIO.runtimeinstead of readingprocessinmain, somainkeeps taking every side effect fromioand runs in hosts other than Node.js.nodeIO()fills it in, so the link is unchanged for thekgdiffcommand; a customiowithoutruntimegets a link that names only the CLI version.@kgdiff/cli -
088671c: Link unexpected CLI errors to a bug-report form prefilled with public version and runtime
metadata, without including error messages or input paths in the URL.@kgdiff/cli -
f02bc72: Similarity matching no longer pairs two same-named nodes on their label alone when their types conflict. With
--match similaritynothing is matched in the first round, so the neighbour evidence was missing for every pair and an equal label outweighed disjoint types: “Mercury” the planet (orbiting the Sun) and “Mercury” the element (with symbol Hg) were reported as one node whose type changed. Such a pair (both nodes typed, no type and no attribute in common, neighbours not matched yet) now waits for the next round, when propagation brings in the neighbours; the two Mercurys share none, so they are reported as removed and added with a possible match below the threshold, as--match autoalready did. A type change that the neighbours confirm is still matched, and nodes without edges are matched as before.@kgdiff/cli·@kgdiff/core -
638c617:
diffFromJSONis about 30% faster on large diffs, so HTML reports open about 20% sooner: a report of 100k nodes / 300k edges is ready in 1.0 s instead of 1.24 s in headless Chrome. Rebuilding the two graphs was most ofdiffFromJSON. The snapshotsdiffToJSONwrites are already canonical, so they are now read straight into graphs, and each union edge keeps the edge it was read into instead of looking it up again. A documentnormalizewould change (parallel edges, a repeated id, a dangling end, a hand-edited snapshot) is normalized as before, as fast as before. The result is the same, field for field and in the same order:diffToJSON(diffFromJSON(j))is stillj, byte for byte, the graph hashes are unchanged, and every consistency check still runs.@kgdiff/core·@kgdiff/viewer -
ed1c3c9: Normalized graphs take about 30% less memory: a graph of 100k nodes and 300k edges now keeps about 111 MB of heap instead of 157 MB. Structural edge keys were built by concatenation, which V8 stores as a rope of many small strings that stays allocated behind every key; they are now built as flat strings, which are also quicker to hash. Keys, diffs, deltas and their JSON are unchanged, byte for byte.
@kgdiff/core -
6d34966: The standalone viewer bundle, which every HTML report inlines, no longer carries the facet names
offacetLabel: they are kept apart from the hunk phrasebooks thatformatHunkreads, which
saves 0.2 kB (min + gzip). Behaviour is unchanged. The bundle's size ceiling goes from 105 kB to
130 kB, so a feature no longer has to raise it, and the HTML report overhead budget (without data
or compute add-on) from 120 kB to 135 kB gzip, so it still covers the bundle.@kgdiff/core·@kgdiff/viewer -
5286e02: The viewer's CSS custom properties are renamed from
--kg-*to--kgdiff-*. They are not documented API yet; a page that set one of the old names on<kgdiff-viewer>sets the new name instead, and the canvas now follows it too, not only the panels. Styles are one shared constructable stylesheet, parsed once for every viewer on the page, instead of<style>elements in each. Inside,<kgdiff-viewer>is now built from a headless session and regions bound to it (RFC 0001, phase 1); its attributes, properties, methods, events and HTML reports are unchanged.@kgdiff/viewer
Every package is at 0.5.0: @kgdiff/cli · @kgdiff/core · @kgdiff/formats · @kgdiff/layout · @kgdiff/scene · @kgdiff/renderer · @kgdiff/viewer · @kgdiff/g6.
GitHub Action: uses: iiwish/kgdiff@v0.5.0.