ATP URI Scheme
#開発 #ATP
ATプロトコル | Specs | URI Scheme
at URL Scheme は、 ATPネットワーク内のレコードのアドレスに使用されます。
code:ABNF
atp-url = "at://" authority path "#" fragment
authority = reg-name / did
path = [ "/" coll-nsid "/" record-id ]
coll-nsid = nsid
record-id = 1*pchar
didは https://w3c.github.io/did-core/#did-syntax で定義されます。
reg-name は https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2 で定義されます。
nsid は NameSpcaeIDs (NSID)で定義されます。
pchar は https://www.rfc-editor.org/rfc/rfc3986#section-3.3 で定義されます。
fragment は https://www.rfc-editor.org/rfc/rfc3986#section-3.5 で定義されます。
fragment セグメントは、URL がレコードを参照する場合にのみ意味を持ちます。 その値は、以下の「FIeldのパス」に従ってマップされます。
at URLの例
table:at
Repository at://alice.host.com
Repository at://did:plc:bv6ggog3tya2z3vxsub7hnal
Collection at://alice.host.com/io.example.song
Record at://alice.host.com/io.example.song/3yI5-c1z-cc2p-1a
Record Field at://alice.host.com/io.example.song/3yI5-c1z-cc2p-1a#/title
Fieldのパス
APTレコード内のすべての Field は URLのfragment section で JSON Pointer を使ってアドレス指定されます。
code:js
const obj = {
"foo": 10,
"arr": [
{ "key": "value1" },
{ "key": "value2" }
]
}
get(obj, '#/foo') // => 10
get(obj, '#/arr') // => Object, Object
get(obj, '#/arr/0/key') // => "value1"
get(obj, '#/arr/1/key') // => "value2"