> For the complete documentation index, see [llms.txt](https://docs.origintrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origintrail.io/build-with-dkg/okf-tutorial.md).

# Google OKF Tutorial

Bring knowledge from a Google Open Knowledge Format bundle into a graph that agents can query and share. The bundle's concepts and links become contributions you can inspect, connect to other knowledge, and publish with provenance when appropriate.

This tutorial maps two linked concepts to RDF, inspects them in Working Memory, then walks through optional sharing, querying, completeness verification, and export. OKF provides the portable content format; DKG connects that content to a collaborative knowledge lifecycle.

Use a healthy node and create a separate graph:

```bash
dkg context-graph create okf-atlas
CG='<exact ID printed by create>'
```

Download the supplied [`okf-atlas` folder](https://github.com/OriginTrail/dkg/tree/main/examples/docs/okf-atlas/README.md) from the reviewed repository revision. It contains an index and two linked concepts, Atlas and Oxigraph. These are fictional tutorial records, with their own explicit frontmatter. The upstream format reference is [Google's OKF specification](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md).

## Preview, then import privately into WM

```bash
dkg okf import ./okf-atlas --dry-run --print-nquads
dkg okf import ./okf-atlas --context-graph-id "$CG"
```

The preview needs no node mutation. Expect two concepts and a mapped link from Atlas to Oxigraph. The import reports per-concept asset names/IRIs and a lifecycle manifest. Preserve that manifest for resumption. Inspect each reported KA with `dkg ka query <reported-name> -c "$CG"`.

The mapper is deterministic and does not need an LLM. A Markdown link maps to a general relationship unless you configure a typed mapping; it does not automatically become the `usesDatabase` predicate from the RDF quickstart. Query the vocabulary that was actually imported.

## Optionally share and query

Rerun the same import to advance the same concept assets to SWM:

```bash
dkg okf import ./okf-atlas --context-graph-id "$CG" --share
dkg query "$CG" --include-shared-memory -q 'SELECT ?concept ?related WHERE { GRAPH ?g { ?concept <http://schema.org/mentions> ?related } }'
dkg okf verify ./okf-atlas --context-graph-id "$CG"
```

Expect the Atlas-to-Oxigraph link. Verify is a mapped-data completeness check against the selected node view; it does not establish factual truth or an on-chain proof. Match the import's mapping options when verifying. At the 10.0.23 baseline verification is oriented toward SWM; use the current [command guide](https://docs.origintrail.io/operate/okf.md) for version-specific scope options.

Ask your agent to inspect the shared graph and explain the link with the source concept and SWM layer. A general `mentions` relationship supports “Atlas mentions Oxigraph”; deriving a more specific claim requires the concept text or an explicit typed relationship.

## Export

```bash
dkg okf export "$CG" ./okf-atlas-export --view shared-working-memory
```

Inspect the exported concept text, metadata, and links. Use `--view working-memory` to export the private WM view or `--view verifiable-memory` after publication. Do not describe a semantic export as a byte-for-byte copy of every original filesystem artifact.

## Optional publication

After a successful full share, select a reported KA name and follow the [publish guide](https://docs.origintrail.io/operate/publish-and-query.md). There is no implicit import-and-publish step. Check the network, author, funding, access policy, and user intent before publication. Inspect the completed result and UAL; an accepted async job alone is not completion.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.origintrail.io/build-with-dkg/okf-tutorial.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
