API reference
Data
Business data and ontology, with per-value state and provenance.
Generated from the public API contract (OpenAPI). Descriptions in the contract are written in Japanese.
Endpoints
Section titled “Endpoints”listTypes
Section titled “listTypes”GET/v1/data/types
有効なバージョンの型・項目・関係・計算の規則
Responses
Section titled “Responses”- 200 —
object: 型 - default —
Problem: RFC 9457 Problem Details
listRecords
Section titled “listRecords”GET/v1/data/records
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
type |
query | string | yes | |
where |
query | string | CEL。変数は record と states(例: record.status == “active”) | |
state |
query | ValueState | この状態の値を持つものに絞る | |
field |
query | string | state で見る項目 | |
limit |
query | integer | ||
cursor |
query | string | ||
include |
query | relations |
relations なら、各レコードに今の関係を含める |
Responses
Section titled “Responses”- 200 —
object: レコード - default —
Problem: RFC 9457 Problem Details
createRecord
Section titled “createRecord”POST/v1/data/records
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
type |
string | yes | |
values |
object | yes |
Responses
Section titled “Responses”- 201 —
Record: レコード - default —
Problem: RFC 9457 Problem Details
getRecord
Section titled “getRecord”GET/v1/data/records/{id}
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes |
Responses
Section titled “Responses”- 200 —
object: レコードと関係と履歴 - default —
Problem: RFC 9457 Problem Details
updateRecord
Section titled “updateRecord”PATCH/v1/data/records/{id}
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
If-Match |
header | string | yes | 取得したときの ETag(version) |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
values |
object | yes | |
reason |
string |
Responses
Section titled “Responses”- 200 —
Record: レコード - default —
Problem: RFC 9457 Problem Details
getValueHistory
Section titled “getValueHistory”GET/v1/data/records/{id}/values/{field}/history
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
field |
path | string | yes |
Responses
Section titled “Responses”- 200 —
object: 値の履歴 - default —
Problem: RFC 9457 Problem Details
confirmValue
Section titled “confirmValue”POST/v1/data/records/{id}/values/{field}/confirm
人の確認で値を確定にする(data:values.confirm と、人の subject が要る)
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
field |
path | string | yes | |
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
note |
string |
Responses
Section titled “Responses”- 200 —
Record: レコード - default —
Problem: RFC 9457 Problem Details
listRecordRelations
Section titled “listRecordRelations”GET/v1/data/records/{id}/relations
data:records.read が必要。終わったものも含めた関係を、記録の新しい順に返す。valid_to のない行が今の関係で、 valid_from が null の行は始まった日が分からない。next_cursor を cursor に渡すと続きを返す
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
type |
query | string | 関係の型 | |
direction |
query | in | out |
このレコードから見た向き | |
cursor |
query | string | ||
limit |
query | integer |
Responses
Section titled “Responses”- 200 —
object: 関係の履歴 - default —
Problem: RFC 9457 Problem Details
createRelation
Section titled “createRelation”POST/v1/data/relations
多対一の有効期間のある関係は、今の関係を valid_from(なければ今日)で閉じ、新しい関係をその日から始める。 今の関係が始まった日より前の valid_from は VALIDATION_FAILED
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
type |
string | yes | |
from |
string | yes | |
to |
string | yes | |
valid_from |
string |
Responses
Section titled “Responses”- 201 —
Relation: 関係 - default —
Problem: RFC 9457 Problem Details
setRelationState
Section titled “setRelationState”POST/v1/data/relations/{id}/state
関係を確かめるか、疑いを記録する。confirmed は data:values.confirm と人の subject が要る。disputed は data:records.write で 書ける。疑いを解くのは confirmed だけで、書いただけの inferred へは戻せない。同じ状態なら何も変えない
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
state |
confirmed | disputed |
yes | |
note |
string |
Responses
Section titled “Responses”- 200 —
Relation: 関係 - default —
Problem: RFC 9457 Problem Details
listImports
Section titled “listImports”GET/v1/data/imports
Responses
Section titled “Responses”- 200 —
object: 取り込みの記録 - default —
Problem: RFC 9457 Problem Details
importCsv
Section titled “importCsv”POST/v1/data/imports
CSV を取り込む。見出しは項目の名前、<項目>@state で状態、@rel:<関係> で相手のキー
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
type |
string | yes | |
csv |
string | yes | |
default_state |
ValueState | ||
label |
string | ||
currency |
string |
Responses
Section titled “Responses”- 201 —
Import: 取り込みの結果 - default —
Problem: RFC 9457 Problem Details
listMigrations
Section titled “listMigrations”GET/v1/data/migrations
definitions:read が必要。release_id の ReleaseBundle を有効にするときに当てる(戻す)Migration と、対象のレコードの数、 backfill の進み具合。戻す Migration が戻せなければ(値を戻す式がなければ)、有効化は止まる
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
release_id |
query | string | yes |
Responses
Section titled “Responses”- 200 —
object: 当てる Migration - default —
Problem: RFC 9457 Problem Details
backfillMigrations
Section titled “backfillMigrations”POST/v1/data/migrations/backfill
definitions:release が必要。有効化の前に、新しい値を計算して置く(レコードの値は有効化まで変えない)。limit 件まで進めて返す。 止まっても、もう一度呼べば続きから進む。有効化のときは、その後に更新されたレコードだけを計算し直す
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
release_id |
string | yes | |
limit |
integer |
Responses
Section titled “Responses”- 200 —
object: backfill の進み具合 - default —
Problem: RFC 9457 Problem Details
listFindings
Section titled “listFindings”GET/v1/data/findings
data:records.read が必要。観点の規則が検出した Finding を新しい順に返す。next を cursor に渡すと続きを返す
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
subject |
query | string | 対象のレコードの ID | |
aspect |
query | string | ||
status |
query | open | closed |
||
cursor |
query | string | ||
limit |
query | integer |
Responses
Section titled “Responses”- 200 —
object: Finding の一覧 - default —
Problem: RFC 9457 Problem Details
getFinding
Section titled “getFinding”GET/v1/data/findings/{id}
data:records.read が必要
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes |
Responses
Section titled “Responses”- 200 —
Finding: Finding - default —
Problem: RFC 9457 Problem Details
closeFinding
Section titled “closeFinding”POST/v1/data/findings/{id}/close
data:records.write が必要で、主体は人に限る(サービスアカウントと Agent は 403)。開いている Finding を人が理由を書いて閉じる。同じ事実の判定では開き直さず、 根拠の値が変わるか当たらなくなった後で検出すると新しい Finding を作る。閉じた Finding は 409 で断る
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | yes | |
Idempotency-Key |
header | string | 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる |
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
reason |
string | yes |
Responses
Section titled “Responses”- 200 —
Finding: 閉じた Finding - default —
Problem: RFC 9457 Problem Details
listAspects
Section titled “listAspects”GET/v1/data/aspects
data:schemas.read が必要。有効なバージョンの観点のすべて(名前・コード・題名)
Responses
Section titled “Responses”- 200 —
object: 観点の一覧 - default —
Problem: RFC 9457 Problem Details
searchKnowledge
Section titled “searchKnowledge”POST/v1/data/knowledge/search
data:schemas.read が必要。有効なバージョンの Axiom と観点を、出典・確からしさ・定義のバージョン付きで引く。 query がなければ一覧を返す。mode を書かなければ、埋め込みのある環境では全文検索と意味検索を合わせ、ない環境では全文検索だけにする
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
query |
string | ||
mode |
keyword | semantic | hybrid |
||
limit |
integer | ||
refs |
string[] |
Responses
Section titled “Responses”- 200 —
object: 知識の一覧 - default —
Problem: RFC 9457 Problem Details
queryOntology
Section titled “queryOntology”POST/v1/data/ontology/query
data:records.read が必要。有効なバージョンの型と関係をたどる型付きの問い合わせ。たどれる関係は 3 段まで、1 回の応答は 100 行まで、 1 回の要求で読むレコードは 1,000 件まで。on は関係の有効な日で、今日より前なら値もその日の終わり(UTC)までに記録したものを返す。 その日の後に Migration が変えた項目は読めず、select や where に書くと CONFLICT。関係が途切れた行は unresolved に段を書く。 truncated が true なら、1 つの起点の道が上限を超えて省かれている。根拠の文書は、呼出し元が今読めるものだけ位置を返す
Request body
Section titled “Request body”application/json — OntologyQuery
| Name | Type | Required | Description |
|---|---|---|---|
from |
object | yes | 起点。id か key で 1 件に絞るか、型のレコードを順に読む |
path |
object[] | ||
on |
string | 読む日。書かなければ今日。今日より前なら値もその日の分を読む | |
limit |
integer | ||
cursor |
string |
Responses
Section titled “Responses”- 200 —
OntologyQueryResult: 問い合わせの結果 - default —
Problem: RFC 9457 Problem Details
listOntologyActions
Section titled “listOntologyActions”GET/v1/data/ontology/types/{type}/actions
data:schemas.read が必要。有効なバージョンで、その型を対象にする行為を定義の順に返す。何ができるかの説明で、ここに出ることは 実行の権限ではない。実行は tool のツールで行い、外への操作は人の承認を通す。定義にない型は 404
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
type |
path | string | yes |
Responses
Section titled “Responses”- 200 —
OntologyActionList: 行為の一覧 - default —
Problem: RFC 9457 Problem Details
resolveOntologyTerm
Section titled “resolveOntologyTerm”POST/v1/data/ontology/resolve
data:schemas.read が必要。言葉を、ID・表示名・別名が完全に一致する型と関係に対応付ける。複数に当たれば ambiguous で候補を並べ、 どれにも当たらなければ unknown を返す
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
term |
string | yes |
Responses
Section titled “Responses”- 200 —
OntologyTermResolution: 用語の候補 - default —
Problem: RFC 9457 Problem Details