Skip to main content
Glama
Archive Citation Lookup

Archive Citation Lookup

by defcron
README.md
# Archive citation evidence for DKG

This prototype prepares six RDF facts for storing an exact archive citation in OriginTrail DKG v10 Working Memory. The record preserves the source URL, replay URL, UTC capture time, research note, and the status of the citation. It checks that the replay URL embeds the same source and valid timestamp. The example URLs are synthetic and the tool makes no request to either URL.

Use Node.js 22 or later. From this directory, run:

```sh
node archive-evidence.mjs preview example.json
```

To test the write and read-back path on your own local DKG v10 node, supply its token in `DKG_AUTH_TOKEN` and run `node archive-evidence.mjs write-local example.json`. `DKG_API_URL` defaults to `http://127.0.0.1:9200`. The command uses the public API to write to the `archive-citation-evidence` Context Graph and then reads the same assertion to compare its values. Repeating an identical record targets the same assertion. It performs no Shared Memory promotion or chain publishing.

Install the dependencies with `npm ci`. Configure a stdio MCP client to launch `node mcp-server.mjs` from this directory with the local DKG environment above. The client can call `lookup_archive_citation` with the assertion ID printed by `write-local`. The tool reads an existing citation and has no write operation.

Run `npm test` for the citation validation test. Set `DKG_AUTH_TOKEN` to the bearer token alone and, if needed, set `DKG_API_URL` to also run the integration test with a local DKG 10.1.3 node. The test seeds the synthetic citation, verifies MCP discovery and lookup, and checks that a missing record is reported. After restarting the test node, its embedded store could not retrieve the earlier assertion. Reseeding restored lookup. Retain your source citation separately when using this setup. The npm publication, demo, and registry pull request remain pending.

Contact [Jeremy Carter](mailto:jeremy@jeremycarter.ca).

## Sponsor maintenance

Support maintenance of the archive citation integration through [GitHub Sponsors](https://github.com/sponsors/defcron).