Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
改行区切りのJSON
Search
circled9
October 14, 2017
Technology
0
1k
改行区切りのJSON
JSON日の金曜日@新潟 9週目で発表した資料です。
circled9
October 14, 2017
Tweet
Share
More Decks by circled9
See All by circled9
キースイッチ入門
circled9
0
97
CloudflareのAI関連の機能さわってみた
circled9
0
820
0.0.0.0 day
circled9
0
120
小数の丸め誤差の話
circled9
0
150
数値の文字列をパースしよう
circled9
0
270
🔥 Hono v4 やってみた
circled9
1
220
JetBrains AI Assistant を試してみた
circled9
1
570
Fresh
circled9
0
270
React Hooks 勉強会 vol.3
circled9
2
460
Other Decks in Technology
See All in Technology
Yahoo!ショッピングのレコメンデーション・システムにおけるML実践の一例
lycorptech_jp
PRO
1
190
Claude Codeが爆速進化してプラグイン追従がつらいので半自動化した話 ver.2
rfdnxbro
0
490
元エンジニアPdM、IDEが恋しすぎてCursorに全業務を集約したら、スライド作成まで爆速になった話
doiko123
1
580
楽しく学ぼう!ネットワーク入門
shotashiratori
3
2.6k
us-east-1 に障害が起きた時に、 ap-northeast-1 にどんな影響があるか 説明できるようになろう!
miu_crescent
PRO
13
4.2k
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
280
Kubernetesにおける推論基盤
ry
1
290
AWS DevOps Agent vs SRE俺 / AWS DevOps Agent vs me, the SRE
sms_tech
3
530
非情報系研究者へ送る Transformer入門
rishiyama
11
7k
楽しく学ぼう!コミュニティ入門 AWSと人が つむいできたストーリー
hiroramos4
PRO
1
190
技術的負債の泥沼から組織を救う3つの転換点
nwiizo
8
3.6k
堅牢.py#2 LT資料
t3tra
0
120
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
78
Believing is Seeing
oripsolob
1
79
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
480
Practical Orchestrator
shlominoach
191
11k
The Spectacular Lies of Maps
axbom
PRO
1
610
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
100
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How to make the Groovebox
asonas
2
2k
Transcript
վߦ۠ΓͷJSON @circled9 2017-10-13 #friday13json
ࣗݾհ.json { "name": "Matsui Masashi", "twitter": ["@circled9", "@ma_2_i"], "language": ["javascript",
"ruby"], }
Agenda • ͡Ίʹ • େମڞ௨ͯ͠Δ͜ͱ • ֤ϑΥʔϚοτͷհ • ·ͱΊ
͡Ίʹ
վߦ۠ΓͷJSON • վߦΛ۠Γจࣈͱͯ͠ѻ͏ϑΥʔϚοτ • ֤ߦvalidͳJSONͷ͕ॻ͔Ε͍ͯΔ • վߦ͠ͳ͍ͷͰɺՄಡੑ͋·Γॏࢹ͍ͯ͠ ͳ͍
վߦ۠ΓͷJSONͷαϯϓϧ {"some":"thing"} {"foo":17,"bar":false,"quux":true} {"may":{"include":"nested","objects":["and","arrays"]}}
ͳͥվߦͰ۠Δͷ͔ • JSONΛύʔε͢ΔʹɺϑΝΠϧͷ࠷ޙ·Ͱ ಡΈࠐ·ͳ͍ͱ͍͚ͳ͍ • վߦจࣈͰ۠Δ͜ͱʹΑͬͯɺϑΝΠϧΛ ෦తʹύʔεͰ͖ΔΑ͏ʹͳΔ
ϝϦοτ • ฒߦॲཧͰͷಡΈॻ͖͕͘͢͠ͳΔ • ֤ߦࠓ·ͰͷJSONͱมΘΒͳ͍ͷͰɺطଘ ͷࢿ࢈͕ੜ͔͍͢͠ • CSV/TSVͱൺֱ͢Δͱɺ֤ߦ͕දݱͰ͖Δ ༰͕ॊೈʹͳΔ
େମڞ௨ͯ͠Δ͜ͱ
ڞ௨͢Δܾ·Γ͝ͱ • ۠Γจࣈվߦจࣈ • ֤ߦվߦΛؚ·ͳ͍validͳJSONͷ • ΤϯίʔσΟϯάUTF-8
վߦจࣈ • LF (\n) ʹ͓͚ͯ͠ແ • CR+LF (\r\n) Ͱͳ͍ •
CR (\r) ͩͱ·͍ͣ͜ͱ͕͋Γͦ͏ • Mac OS 9ͳΜͯී௨ͬͯ·ͤΜͶ
վߦจࣈ • CRΛ۠Γจࣈͱͯ͠ѻ͏͔ɺ֤ϑΥʔϚο τʹΑͬͯҟͳΔ • ͔͠͠ɺҎԼͷཧ༝͔ΒCR+LFͰ࣮࣭ͳ͍ • ۭߦແࢹ͢Δͷ͕௨ྫ • JSONͷύʔε࣌ʹۭനจࣈআڈ͞ΕΔ
֤ϑΥʔϚοτͷհ
֤ϑΥʔϚοτͷհ • NDJSON • LDJSON • JSON Lines • NDJ
NDJSON • MediaType application/x-ndjson • ֦ுࢠ .ndjson • CRվߦͱͯ͠ݟͳ͢
LDJSON • NDJSONͷաڈͷݺͼ໊ • MediaType application/x-ldjson • ֦ுࢠ .ldjson
JSON Lines • MediaType ಛʹݴٴͳ͠ • ֦ுࢠ .jsonl • ѹॖͯ͠
.jsonl.gz .jsonl.bz2 ͱͯ͠৴ ͢Δ͜ͱਪͯ͠Δ • CRվߦͱͯ͠ݟͳ͞ͳ͍
NDJ • MediaType ಛʹݴٴͳ͠ • ֦ுࢠ .ndj • ࠷ॳͷ1ߦʹ //
Ͱίϝϯτ͕ॻ͚Δ • CRվߦͱͯ͠ݟͳ͞ͳ͍
·ͱΊ
·ͱΊ • վߦ۠ΓͷJSONͩͱฒߦॲཧͱ͔͕ḿΔ • վߦ۠ΓͷJSON͍͔ͭ͘ϑΥʔϚοτ͕ ͋Δ • ॻ͖ํͷ༷େମಉ͡
[EOF]
ࢀߟURL • NDJSON • http://specs.okfnlabs.org/ndjson/ • LDJSON • https://github.com/ndjson/ndjson-spec/commit/ c658c26ba15bea718228b5a3d54f0d4db22ec0ba
• JSON Lines • http://jsonlines.org/ • NDJ • http://jimbojw.com/t/index.php?title=Newline_delimited_JSON