-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
1023 lines (930 loc) · 50.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html dir="ltr" lang="en"><head><meta charset="utf-8"><meta name="generator" content="ReSpec 19.0.1"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><style>/* --- ISSUES/NOTES --- */
div.issue-title, div.note-title , div.ednote-title, div.warning-title {
padding-right: 1em;
min-width: 7.5em;
color: #b9ab2d;
}
div.issue-title { color: #e05252; }
div.note-title, div.ednote-title { color: #2b2; }
div.warning-title { color: #f22; }
div.issue-title span, div.note-title span, div.ednote-title span, div.warning-title span {
text-transform: uppercase;
}
div.note, div.issue, div.ednote, div.warning {
margin-top: 1em;
margin-bottom: 1em;
}
.note > p:first-child, .ednote > p:first-child, .issue > p:first-child, .warning > p:first-child { margin-top: 0 }
.issue, .note, .ednote, .warning {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
}
div.issue, div.note , div.ednote, div.warning {
padding: 1em 1.2em 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
span.note, span.ednote, span.issue, span.warning { padding: .1em .5em .15em; }
.issue {
border-color: #e05252;
background: #fbe9e9;
}
.note, .ednote {
border-color: #52e052;
background: #e9fbe9;
}
.warning {
border-color: #f11;
border-width: .2em;
border-style: solid;
background: #fbe9e9;
}
.warning-title:before{
content: "⚠"; /*U+26A0 WARNING SIGN*/
font-size: 3em;
float: left;
height: 100%;
padding-right: .3em;
vertical-align: top;
margin-top: -0.5em;
}
li.task-list-item {
list-style: none;
}
input.task-list-item-checkbox {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
</style>
<title>Post Type Discovery</title>
<link rel="webmention" href="https://webmention.io/w3c/webmention">
<style id="respec-mainstyle">/*****************************************************************
* ReSpec 3 CSS
* Robin Berjon - http://berjon.com/
*****************************************************************/
/* Override code highlighter background */
.hljs {
background: transparent !important;
}
/* --- INLINES --- */
h1 abbr,
h2 abbr,
h3 abbr,
h4 abbr,
h5 abbr,
h6 abbr,
a abbr {
border: none;
}
dfn {
font-weight: bold;
}
a.internalDFN {
color: inherit;
border-bottom: 1px solid #99c;
text-decoration: none;
}
a.externalDFN {
color: inherit;
border-bottom: 1px dotted #ccc;
text-decoration: none;
}
a.bibref {
text-decoration: none;
}
cite .bibref {
font-style: normal;
}
code {
color: #c83500;
}
th code {
color: inherit;
}
/* --- TOC --- */
.toc a,
.tof a {
text-decoration: none;
}
a .secno,
a .figno {
color: #000;
}
ul.tof,
ol.tof {
list-style: none outside none;
}
.caption {
margin-top: 0.5em;
font-style: italic;
}
/* --- TABLE --- */
table.simple {
border-spacing: 0;
border-collapse: collapse;
border-bottom: 3px solid #005a9c;
}
.simple th {
background: #005a9c;
color: #fff;
padding: 3px 5px;
text-align: left;
}
.simple th[scope="row"] {
background: inherit;
color: inherit;
border-top: 1px solid #ddd;
}
.simple td {
padding: 3px 10px;
border-top: 1px solid #ddd;
}
.simple tr:nth-child(even) {
background: #f0f6ff;
}
/* --- DL --- */
.section dd > p:first-child {
margin-top: 0;
}
.section dd > p:last-child {
margin-bottom: 0;
}
.section dd {
margin-bottom: 1em;
}
.section dl.attrs dd,
.section dl.eldef dd {
margin-bottom: 0;
}
#issue-summary > ul,
.respec-dfn-list {
column-count: 2;
}
#issue-summary li,
.respec-dfn-list li {
list-style: none;
}
details.respec-tests-details {
margin-left: 1em;
display: inline-block;
vertical-align: top;
}
details.respec-tests-details > * {
padding-right: 2em;
}
details.respec-tests-details[open] {
z-index: 999999;
position: absolute;
border: thin solid #cad3e2;
border-radius: .3em;
background-color: white;
padding-bottom: .5em;
}
details.respec-tests-details[open] > summary {
border-bottom: thin solid #cad3e2;
padding-left: 1em;
margin-bottom: 1em;
line-height: 2em;
}
details.respec-tests-details > ul {
width: 100%;
margin-top: -0.3em;
}
details.respec-tests-details > li {
padding-left: 1em;
}
@media print {
.removeOnSave {
display: none;
}
}
</style><style>/*
github.com style (c) Vasily Polovnyov <[email protected]>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED"><link rel="canonical" href="https://www.w3.org/TR/post-type-discovery/"><script id="initialUserConfig" type="application/json">{
"license": "w3c-software-doc",
"specStatus": "ED",
"shortName": "post-type-discovery",
"edDraftURI": "http://ptd.spec.indieweb.org/",
"editors": [
{
"name": "Tantek Çelik",
"url": "http://tantek.com/",
"w3cid": "1464"
}
],
"wg": "Social Web Working Group",
"wgURI": "https://www.w3.org/Social/WG",
"wgPublicList": "public-socialweb",
"wgPatentURI": "https://www.w3.org/2004/01/pp-impl/72531/status",
"otherLinks": [
{
"key": "Repository",
"data": [
{
"value": "Github",
"href": "https://github.com/tantek/post-type-discovery"
},
{
"value": "Issues",
"href": "https://github.com/tantek/post-type-discovery/issues"
},
{
"value": "Commits",
"href": "https://github.com/tantek/post-type-discovery/commits/master"
}
]
}
],
"localBiblio": {
"AS1": {
"title": "JSON Activity Streams 1.0",
"href": "http://activitystrea.ms/specs/json/1.0/",
"authors": [
"J. Snell",
"M. Atkins",
"W. Norris",
"C. Messina",
"M. Wilkinson",
"R. Dolin"
],
"status": "unofficial",
"publisher": "http://activitystrea.ms"
},
"AS2": {
"title": "Activity Streams 2.0",
"href": "https://www.w3.org/TR/activitystreams-core/",
"authors": [
"J. Snell",
"E. Prodromou"
],
"status": "Candidate Recommendation",
"publisher": "https://www.w3.org/"
},
"AS2-vocab": {
"title": "Activity Vocabulary",
"href": "http://www.w3.org/TR/activitystreams-vocabulary",
"authors": [
"J. Snell",
"E. Prodromou"
],
"status": "Candidate Recommendation",
"publisher": "https://www.w3.org/"
},
"h-entry": {
"title": "h-entry",
"href": "http://microformats.org/wiki/h-entry",
"authors": [
"Tantek Çelik"
],
"status": "Living Specification",
"publisher": "http://microformats.org"
},
"h-event": {
"title": "h-event",
"href": "http://microformats.org/wiki/h-event",
"authors": [
"Tantek Çelik"
],
"status": "Living Specification",
"publisher": "http://microformats.org"
},
"microformats2": {
"title": "Microformats2",
"href": "http://microformats.org/wiki/microformats2",
"authors": [
"Tantek Çelik"
],
"status": "Living Specification",
"publisher": "http://microformats.org"
},
"microformats2-parsing": {
"title": "Microformats2 Parsing",
"href": "http://microformats.org/wiki/microformats2-parsing",
"authors": [
"Tantek Çelik"
],
"status": "Living Specification",
"publisher": "http://microformats.org"
},
"Activitypub": {
"title": "ActivityPub",
"href": "https://www.w3.org/TR/activitypub",
"authors": [
"Christopher Allan Webber",
"Jessica Tallon",
"Owen Shepherd"
],
"status": "Working Draft",
"publisher": "https://www.w3.org"
},
"RSS-2.0": {
"title": "RSS 2.0",
"href": "http://www.rssboard.org/rss-specification",
"authors": [
"Dave Winer"
],
"status": "Stable",
"publisher": "RSS Board"
}
},
"publishISODate": "2018-01-12T00:00:00.000Z",
"generatedSubtitle": "Editor's Draft 12 January 2018"
}</script><meta name="description" content="This section is non-normative."></head>
<body aria-busy="false" class="h-entry"><div class="head">
<p>
<a class="logo" href="https://www.w3.org/"><img src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" alt="W3C" width="72" height="48"></a>
</p>
<p><!--_hyper: 328792065;--></p>
<h1 class="title p-name" id="title">Post Type Discovery</h1>
<h2 id="w3c-editor-s-draft-12-january-2018"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2018-01-12">12 January 2018</time></h2>
<dl>
<dt>This version:</dt>
<dd><a class="u-url" href="http://ptd.spec.indieweb.org/">http://ptd.spec.indieweb.org/</a></dd>
<dt>Latest published version:</dt>
<dd><a href="https://www.w3.org/TR/post-type-discovery/">https://www.w3.org/TR/post-type-discovery/</a></dd>
<dt>Latest editor's draft:</dt>
<dd><a href="http://ptd.spec.indieweb.org/">http://ptd.spec.indieweb.org/</a></dd>
<dt>Editor:</dt>
<dd class="p-author h-card vcard" data-editor-id="1464"><a class="u-url url p-name fn" href="http://tantek.com/">Tantek Çelik</a></dd>
<dt>Repository:</dt>
<dd>
<a href="https://github.com/tantek/post-type-discovery">
Github
</a>
</dd>
<dd>
<a href="https://github.com/tantek/post-type-discovery/issues">
Issues
</a>
</dd>
<dd>
<a href="https://github.com/tantek/post-type-discovery/commits/master">
Commits
</a>
</dd>
</dl>
<p class="copyright">
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
2018
<a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
(<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
<a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="https://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>).
<abbr title="World Wide Web Consortium">W3C</abbr> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
<a rel="license" href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a>
rules apply.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="informative introductory"><h2 id="abstract-0">Abstract</h2><p><em>This section is non-normative.</em></p>
<p>
Post Type Discovery specifies algorithms for determining the type of a post
by what properties it has and potentially what value(s) they have, which helps
avoid the need for explicit post types that are being abandoned by modern post
creation UIs.
</p>
<p>The <a href="#response-algorithm">Response Type Algorithm</a> in particular specifies
how a [<cite><a class="bibref" href="#bib-Webmention">Webmention</a></cite>] receiver determines whether a webmention is a comment, like, repost, RSVP,
or other type of mention, widely implemented in practice by Webmention receivers
to determine when and how to display various peer-to-peer social responses.
</p>
</section>
<section id="sotd" class="introductory"><h2 id="status-of-this-document">Status of This Document</h2>
<p>
<em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at https://www.w3.org/TR/.</em>
</p>
<p>This specification was contributed to the <abbr title="World Wide Web Consortium">W3C</abbr> from the
<a href="https://indieweb.org/">IndieWeb</a> community
and was one of several related specifications being produced by the Social Web Working Group.
Now published as a <abbr title="World Wide Web Consortium">W3C</abbr> Note, the Post Type Discovery living specification is
maintained at <a href="http://ptd.spec.indieweb.org">ptd.spec.indieweb.org</a>.
More history and evolution of Post Type Discovery can be found on the
<a href="https://indieweb.org/post-type-discovery">IndieWeb wiki</a>.
</p>
<p>
This document was published by the <a href="https://www.w3.org/Social/WG">Social Web Working Group</a> as an Editor's Draft.
Comments regarding this document are welcome. Please send them to
<a href="mailto:[email protected]">[email protected]</a>
(<a href="mailto:[email protected]?subject=subscribe">subscribe</a>,
<a href="https://lists.w3.org/Archives/Public/public-socialweb/">archives</a>).
</p>
<p>
Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
Membership. This is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as other than work in
progress.
</p>
<p>
This document was produced by
a group
operating under the
<a href="https://www.w3.org/Consortium/Patent-Policy/"><abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
<abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="https://www.w3.org/2004/01/pp-impl/72531/status" rel="disclosure">public list of any patent
disclosures</a>
made in connection with the deliverables of
the group; that page also includes
instructions for disclosing a patent. An individual who has actual knowledge of a patent
which the individual believes contains
<a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with
<a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section
6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
</p>
<p>This document is governed by the <a id="w3c_process_revision" href="https://www.w3.org/2017/Process-20170301/">1 March 2017 <abbr title="World Wide Web Consortium">W3C</abbr> Process Document</a>.
</p>
</section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#usecases" class="tocxref"><span class="secno">2. </span>Use Cases</a><ol class="toc"><li class="tocline"><a href="#synthesizing" class="tocxref"><span class="secno">2.1 </span>Synthesizing explicit type formats</a></li><li class="tocline"><a href="#aggregating-responses" class="tocxref"><span class="secno">2.2 </span>Aggregating responses by type</a></li><li class="tocline"><a href="#notifications-wording" class="tocxref"><span class="secno">2.3 </span>Notifications wording and filtering</a></li></ol></li><li class="tocline"><a href="#conform" class="tocxref"><span class="secno">3. </span>Conformance</a><ol class="toc"><li class="tocline"><a href="#conformance-keywords" class="tocxref"><span class="secno">3.1 </span>Conformance Keywords</a></li><li class="tocline"><a href="#conformance-classes" class="tocxref"><span class="secno">3.2 </span>Conformance Classes</a><ol class="toc"><li class="tocline"><a href="#type-discovery-function" class="tocxref"><span class="secno">3.2.1 </span>Type Discovery Function</a></li><li class="tocline"><a href="#as2-proxy" class="tocxref"><span class="secno">3.2.2 </span>AS2 Proxy</a></li></ol></li></ol></li><li class="tocline"><a href="#response-algorithm" class="tocxref"><span class="secno">4. </span>Response Type Algorithm</a></li><li class="tocline"><a href="#algorithm" class="tocxref"><span class="secno">5. </span>Post Type Algorithm</a></li><li class="tocline"><a href="#post-types-table" class="tocxref"><span class="secno">6. </span>Post Types Table</a></li><li class="tocline"><a href="#methodology" class="tocxref"><span class="secno">7. </span>Methodology</a><ol class="toc"><li class="tocline"><a href="#scope" class="tocxref"><span class="secno">7.1 </span>Scope</a></li><li class="tocline"><a href="#order" class="tocxref"><span class="secno">7.2 </span>Order</a></li></ol></li><li class="tocline"><a href="#othertypes" class="tocxref"><span class="secno">8. </span>Other Types To Consider</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">9. </span>Examples</a><ol class="toc"><li class="tocline"><a href="#ex-like" class="tocxref"><span class="secno">9.1 </span>Like Post</a></li></ol></li><li class="tocline"><a href="#faq" class="tocxref"><span class="secno">10. </span>FAQ</a><ol class="toc"><li class="tocline"><a href="#what-about-a-photo-reply" class="tocxref"><span class="secno">10.1 </span>What about a photo reply</a></li><li class="tocline"><a href="#is-a-video-tag-sufficient" class="tocxref"><span class="secno">10.2 </span> Is a video tag sufficient </a></li></ol></li><li class="tocline"><a href="#implementations" class="tocxref"><span class="secno">11. </span>Implementations</a><ol class="toc"><li class="tocline"><a href="#granary" class="tocxref"><span class="secno">11.1 </span>Granary</a></li><li class="tocline"><a href="#p3k" class="tocxref"><span class="secno">11.2 </span>p3k</a></li><li class="tocline"><a href="#mf2util" class="tocxref"><span class="secno">11.3 </span>mf2util</a></li></ol></li><li class="tocline"><a href="#change-log" class="tocxref"><span class="secno">A. </span>Change Log</a><ol class="toc"><li class="tocline"><a href="#changes-from-1-august-2017-wd-to-this-version" class="tocxref"><span class="secno">A.1 </span>Changes from <span class="formerLink">1 August 2017 WD</span> to
this version</a></li><li class="tocline"><a href="#changes-from-14-june-2017-wd-to-1-august-2017-wd" class="tocxref"><span class="secno">A.2 </span>Changes from <span class="formerLink">14 June 2017 WD</span> to
<span class="formerLink">1 August 2017 WD</span></a></li><li class="tocline"><a href="#changes-from-1-march-2017-wd-to-14-june-2017-wd" class="tocxref"><span class="secno">A.3 </span>Changes from <span class="formerLink">1 March 2017 WD</span> to
<span class="formerLink">14 June 2017 WD</span></a></li><li class="tocline"><a href="#changes-from-28-october-2016-wd-to-1-march-2017-wd" class="tocxref"><span class="secno">A.4 </span>Changes from <span class="formerLink">28 October 2016 WD</span> to
<span class="formerLink">1 March 2017 WD</span></a></li></ol></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ol class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">B.2 </span>Informative references</a></li></ol></li></ol></nav>
<section class="informative" id="introduction">
<!--OddPage--><h2 id="x1-introduction"><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
<p>
Post type discovery defines explicit algorithms for inferring the type of a post from other properties of that post.
</p>
<p>
Inferring the type of a post helps provide a bridge between formats and protocols without explicit post types
(e.g. [<cite><a class="bibref" href="#bib-h-entry">h-entry</a></cite>], [<cite><a class="bibref" href="#bib-jf2">jf2</a></cite>], [<cite><a class="bibref" href="#bib-micropub">micropub</a></cite>], Atom ([<cite><a class="bibref" href="#bib-RFC4287">RFC4287</a></cite>]), [<cite><a class="bibref" href="#bib-RSS-2.0">RSS-2.0</a></cite>]) to those with explicit post types (e.g. [<cite><a class="bibref" href="#bib-ActivityPub">ActivityPub</a></cite>], [<cite><a class="bibref" href="#bib-AS2">AS2</a></cite>]).
For more details on those specifications see references, and for how they relate, see the overview document [<cite><a class="bibref" href="#bib-social-web-protocols">social-web-protocols</a></cite>].
Post type discovery can apply to any post data structure independent of serialization (e.g. HTML, JSON, etc.)
</p>
</section>
<section id="usecases" class="informative">
<!--OddPage--><h2 id="x2-use-cases"><span class="secno">2. </span>Use Cases</h2><p><em>This section is non-normative.</em></p>
<p>
Both creation user interfaces, and post presentation designs are evolving to
directly use the presence or absence of specific properties (and their values)
directly, rather than depending on any kind of explicit "post type", thus why
bother discovering a post type in the first place? This section documents the
(few) use-case(s) that is/are known to date.
</p>
<section id="synthesizing">
<h3 id="x2-1-synthesizing-explicit-type-formats"><span class="secno">2.1 </span>Synthesizing explicit type formats</h3>
<p>
There are existing formats that require explicit post types
(e.g. ActivityStreams [<cite><a class="bibref" href="#bib-AS1">AS1</a></cite>]), or are based on explicit post types,
(e.g. ActivityStreams2 [<cite><a class="bibref" href="#bib-AS2">AS2</a></cite>]), and code that consumes them expects explicit
post types. Post type discovery enabling automatic synthesizing of such
formats from posts that merely have a set of content related properties.
</p>
</section>
<section id="aggregating-responses">
<h3 id="x2-2-aggregating-responses-by-type"><span class="secno">2.2 </span>Aggregating responses by type</h3>
<p>
Modern social web posting systems implement multiple types of responses
and provide user interfaces that show aggregate counts or collections of
those responses grouped by type, e.g. number of likes, reposts, replies.
</p>
</section>
<section id="notifications-wording">
<h3 id="x2-3-notifications-wording-and-filtering"><span class="secno">2.3 </span>Notifications wording and filtering</h3>
<p>
Many social web implementations provide notifications to a user
with response type specific wording, e.g.
"Alice commented on your photo", "7 people liked your video".
Automatically generating both the specific wording of these notifications,
and deciding which to provide to the user, based on preferences and/or filtering,
requires determining the specific response type.
</p>
</section>
</section>
<section id="conform">
<!--OddPage--><h2 id="x3-conformance"><span class="secno">3. </span>Conformance</h2>
<section id="conformance-keywords">
<h3 id="x3-1-conformance-keywords"><span class="secno">3.1 </span>Conformance Keywords</h3>
<p>As well as sections marked as non-normative, all authoring guidelines, diagrams,
examples, and notes in this specification are non-normative.
Everything else in this specification is normative.</p>
<p>The key words "<em class="rfc2119" title="MAY">MAY</em>", "<em class="rfc2119" title="MUST">MUST</em>", "<em class="rfc2119" title="MUST NOT">MUST NOT</em>", "<em class="rfc2119" title="OPTIONAL">OPTIONAL</em>", "<em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>", "<em class="rfc2119" title="REQUIRED">REQUIRED</em>",
"<em class="rfc2119" title="SHALL">SHALL</em>", "<em class="rfc2119" title="SHALL NOT">SHALL NOT</em>", "<em class="rfc2119" title="SHOULD">SHOULD</em>", and "<em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em>" are to be interpreted as described in
[<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].</p>
</section>
<section id="conformance-classes">
<h3 id="x3-2-conformance-classes"><span class="secno">3.2 </span>Conformance Classes</h3>
<p>There are many possible ways a Post Type Discovery implementation can be used and tested.
This section describes possible conformance classes from existing implementations and use-cases.
</p>
<section id="type-discovery-function">
<h4 id="x3-2-1-type-discovery-function"><span class="secno">3.2.1 </span>Type Discovery Function</h4>
<p>A Type Discovery Function consumes untyped posts from a possibly untyped format or protocol,
(e.g. the h-entry microformat) and outputs the type output
(e.g. a simple one-word string like "note" or "article")
of the algorithm implemented
(either the Response Type Algorithm or the Post Type Algorithm).</p>
</section>
<section id="as2-proxy">
<h4 id="x3-2-2-as2-proxy"><span class="secno">3.2.2 </span>AS2 Proxy</h4>
<p>An AS2 Proxy consumes untyped posts from an untyped format or protocol,
and outputs valid [<cite><a class="bibref" href="#bib-AS2">AS2</a></cite>] JSON using the equivalent AS2 Activity and/or Object Types.
</p>
</section>
</section>
</section>
<section id="response-algorithm">
<!--OddPage--><h2 id="x4-response-type-algorithm"><span class="secno">4. </span>Response Type Algorithm</h2>
<p>
The Response Type Algorithm ("the response algorithm") is for specifically discovering the type of a response,
in particular as a result of receiving a [<cite><a class="bibref" href="#bib-Webmention">Webmention</a></cite>], by analyzing the "source" from the Webmention,
called the "response" in the response algorithm.
It is a proper subset of the general Post Type Algorithm (defined below).
</p>
<ul>
<li>If the response has an "rsvp" property with a valid value (one of "yes", "no", "maybe", "interested"),
<br>Then it is an RSVP.</li>
<li>If the response has a "repost-of" property with a valid URL,
<br>Then it is a repost (AKA share).</li>
<li>If the response has a "like-of" property with a valid URL,
<br>Then it is a like (AKA favorite).</li>
<li>If the response has an "in-reply-to" property with a valid URL,
<br>Then it is a reply (AKA comment).</li>
<li>Else it is a mention.</li>
</ul>
<p>
Quoted property names in the response algorithm are defined in [<cite><a class="bibref" href="#bib-h-entry">h-entry</a></cite>].
</p>
</section>
<section id="algorithm">
<!--OddPage--><h2 id="x5-post-type-algorithm"><span class="secno">5. </span>Post Type Algorithm</h2>
<p>
The Post Type Algorithm ("the algorithm") discovers the type of a
post given a data structure representing an item with a flat set of properties
(e.g. JSON output from [<cite><a class="bibref" href="#bib-microformats2-parsing">microformats2-parsing</a></cite>]),
each with one or more values, by following these steps
until reaching the first "it is a(n) ... post" statement at which point the
"..." is the discovered post type.
</p>
<ul>
<li>If the post is an "event" item (may be a [<cite><a class="bibref" href="#bib-microformats2">microformats2</a></cite>] root class name of [<cite><a class="bibref" href="#bib-h-event">h-event</a></cite>]),
<br>Then it is an event.</li>
<li>If the post has an "rsvp" property with a valid value (one of "yes", "no", "maybe", "interested"),
<br>Then it is an RSVP post.</li>
<li>If the post has a "repost-of" property with a valid URL,
<br>Then it is a repost (AKA "share") post.</li>
<li>If the post has a "like-of" property with a valid URL,
<br>Then it is a like (AKA "favorite") post.</li>
<li>If the post has an "in-reply-to" property with a valid URL,
<br>Then it is a reply post.</li>
<li>If the post has a "video" property with a valid URL,
<br>Then it is a video post. </li>
<li>If the post has a "photo" property with a valid URL,
<br>Then it is a photo post. </li>
<li>If the post has a "content" property with a non-empty value,
<br>Then use its first non-empty value as the content</li>
<li>Else if the post has a "summary" property with a non-empty value,
<br>Then use its first non-empty value as the content</li>
<li>Else it is a note post.</li>
<li>If the post has no "name" property
<br> or has a "name" property with an empty string value (or no value)
<br>Then it is a note post.</li>
<li>Take the first non-empty value of the "name" property</li>
<li>Trim all leading/trailing whitespace</li>
<li>Collapse all sequences of internal whitespace to a single space (0x20) character each</li>
<li>Do the same with the content</li>
<li>If this processed "name" property value is NOT a prefix of the processed content,
<br>Then it is an article post.</li>
<li>Else it is a note post.</li>
</ul>
<p>
Quoted property names in the algorithm are defined in [<cite><a class="bibref" href="#bib-h-entry">h-entry</a></cite>].
</p>
<div class="note"><div role="heading" class="note-title marker" id="h-note" aria-level="3"><span>Note</span></div><p class="">Note: for [<cite><a class="bibref" href="#bib-RFC4287">RFC4287</a></cite>],
use the Atom entry title for the "name" property,
and the Atom entry content for the content as mentioned in the algorithm.
</p></div>
<div class="note"><div role="heading" class="note-title marker" id="h-note-0" aria-level="3"><span>Note</span></div><p class="">Note: for [<cite><a class="bibref" href="#bib-RSS-2.0">RSS-2.0</a></cite>],
use the RSS item title for the "name" property,
and the RSS item description for the content as mentioned in the algorithm.
</p></div>
</section>
<section id="post-types-table">
<!--OddPage--><h2 id="x6-post-types-table"><span class="secno">6. </span>Post Types Table</h2>
<p>The following table documents the conversion from
the output of the algorithms to [<cite><a class="bibref" href="#bib-AS2">AS2</a></cite>] equivalents.</p>
<table>
<tbody><tr><th>Post Type</th> <th>AS2 equivalent</th></tr>
<tr><td>event</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event">Event</a></td></tr>
<tr><td>rsvp</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#motivations-rsvp">Event RSVP</a></td></tr>
<tr><td>repost</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce">Announce</a></td></tr>
<tr><td>like</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like">Like</a></td></tr>
<tr><td>reply</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note">Note</a> with <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-inreplyto">inReplyTo</a></td></tr>
<tr><td>video</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video">Video</a></td></tr>
<tr><td>photo</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-image">Image</a></td></tr>
<tr><td>note</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note">Note</a></td></tr>
<tr><td>article</td> <td><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-article">Article</a></td></tr>
</tbody></table>
</section>
<section id="methodology" class="informative">
<!--OddPage--><h2 id="x7-methodology"><span class="secno">7. </span>Methodology</h2><p><em>This section is non-normative.</em></p>
<p>
There are two important aspects to the methodology of the Post Type Discovery
algorithm: scope (why is something explicitly in the algorithm), and order
(why is something where it is in the algorithm).
</p>
<section id="scope">
<h3 id="x7-1-scope"><span class="secno">7.1 </span>Scope</h3>
<p>
The algorithm could attempt to cover innumerable potential hypothetical post
types, or take an evidence based approach, focusing on real world publishing
practices. This specification does the latter, specifically by placing a
minimum bar of documented real world publishing practices of different visually
apparent post types on the open web at recent (< 1 year old) permalinks, each
with at least three independent implementations that have converged on what
properties (and potentially values thereof) they have to imply their visually
apparent post types. As a result of being evidence based, it is likely this
specification will expand over time as more apparent post types are published by
more convergent implementations.
</p>
</section>
<section id="order">
<h3 id="x7-2-order"><span class="secno">7.2 </span>Order</h3>
<p>
The algorithm must also specify an order (e.g. of precedence) that various
properties (and their values) imply various post types. The algorithm is
ordered by post types that are in general "richer" in terms of content as
well as show greater cognitive effort by the author.
</p>
</section>
</section>
<section id="othertypes" class="informative">
<!--OddPage--><h2 id="x8-other-types-to-consider"><span class="secno">8. </span>Other Types To Consider</h2><p><em>This section is non-normative.</em></p>
<p>
Other types may be included in future iterations
of the algorithms based on convergence of publishing patterns and critical mass
of adoption thereof.
</p>
<p>
See: <a href="https://indieweb.org/posts#Kinds_of_Posts">IndieWeb wiki: Kinds of Posts</a>
for a list of additional possible post types that have growing adoption.
</p>
</section>
<section id="examples" class="informative">
<!--OddPage--><h2 id="x9-examples"><span class="secno">9. </span>Examples</h2><p><em>This section is non-normative.</em></p>
<section id="ex-like">
<h3 id="x9-1-like-post"><span class="secno">9.1 </span>Like Post</h3>
<p>
Here is an example [<cite><a class="bibref" href="#bib-h-entry">h-entry</a></cite>] post from
<a href="http://www.w3.org/TR/activitystreams-vocabulary/#dfn-like">Activity Streams 2.0 Vocabulary examples</a> [<cite><a class="bibref" href="#bib-AS2-vocab">AS2-vocab</a></cite>]:
</p>
<pre aria-busy="false" aria-live="polite" class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"h-entry p-name"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p-author h-card"</span>></span>Sally<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
liked
<span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"u-like-of"</span>
<span class="hljs-attr">href</span>=<span class="hljs-string">"http://example.org/notes/1"</span>></span>
http://example.org/notes/1
<span class="hljs-tag"></<span class="hljs-name">a</span>></span>
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></pre>
<p>
Following the algorithm, the step "If the post has a "like-of" property with
a valid URL" is satisfied and thus the algorithm returns that the post is a
"<a href="https://indieweb.org/like">like</a>" post.
</p>
<p>
Given this semantic, an implementation can generate (or process as if generated
and consumed) the following AS2 JSON, in particular the <code>"@type": "Like"</code>
in this output is what is determined by this algorithm:
</p>
<pre aria-busy="false" aria-live="polite" class="hljs json">{
<span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Like"</span>,
<span class="hljs-attr">"actor"</span>: {
<span class="hljs-attr">"@type"</span>: <span class="hljs-string">"Person"</span>,
<span class="hljs-attr">"displayName"</span>: <span class="hljs-string">"Sally"</span>
},
<span class="hljs-attr">"object"</span>: <span class="hljs-string">"http://example.org/notes/1"</span>
} </pre>
</section>
</section>
<section id="faq" class="informative">
<!--OddPage--><h2 id="x10-faq"><span class="secno">10. </span>FAQ</h2><p><em>This section is non-normative.</em></p>
<section id="what-about-a-photo-reply">
<h3 id="x10-1-what-about-a-photo-reply"><span class="secno">10.1 </span>What about a photo reply</h3>
<p>
Q: What about a reply that includes a photo?
</p>
<p>
A: It's a reply.
</p>
<p>
Q2: Should that show up as a "photo" post?
</p>
<p>
A2: It should show up as a "reply" and not be in a user's published feed of their
photos. The user-centric design here is to treat replies separately, because in
practice, when users post replies to others' posts, and include a photo, the photos
typically assume the context of that other post, and would look odd outside of it
(e.g. in a generic "photos" feed). In addition, by not including reply photos in a
user's feed of their photos, it gives the user the freedom to reply to other posts
with whatever they wish, including photos, and not have those reply-specific photos
pollute their streams of "their stuff" that their followers subscribe to.
</p>
<p>
A2a: From a presentation perspective, a reply should primarily be displayed as a
reply first, and then adapt accordingly to whatever other properties it may have.
</p>
</section>
<section id="is-a-video-tag-sufficient">
<h3 id="x10-2-is-a-video-tag-sufficient"><span class="secno">10.2 </span> Is a video tag sufficient </h3>
<p>
Q: Is a video tag sufficient to imply a video post?
</p>
<p>
A: No, video tags can be used for additional content e.g. inside an article.
Only relying on video tag markup would lead to false positives.
</p>
</section>
</section>
<section id="implementations" class="informative">
<!--OddPage--><h2 id="x11-implementations"><span class="secno">11. </span>Implementations</h2><p><em>This section is non-normative.</em></p>
<p>
Implementations, in progress, partial, or complete, of Post Type Discovery.
</p>
<section id="granary">
<h3 id="x11-1-granary"><span class="secno">11.1 </span>Granary</h3>
<p>
<a href="https://github.com/snarfed/granary/">Granary</a> synthesizes ActivityStreams [<cite><a class="bibref" href="#bib-AS1">AS1</a></cite>],
[<cite><a class="bibref" href="#bib-microformats2">microformats2</a></cite>], and Atom [<cite><a class="bibref" href="#bib-RFC4287">RFC4287</a></cite>] from various input feeds and sources, and
as such has some code that can be considered in progress or even a partial
implementation of Post Type Discovery:
</p>
<ul>
<li>Live public demo site: https://granary-demo.appspot.com/ </li>
<li>Issue(s) related to implementing Post Type Discovery:
<a href="https://github.com/snarfed/granary/issues/41">#41</a></li>
</ul>
</section>
<section id="p3k">
<h3 id="x11-2-p3k"><span class="secno">11.2 </span>p3k</h3>
<p>
<a href="https://indieweb.org/p3k">p3k</a> (a CMS) implements Post Type
Discovery internally within its [<cite><a class="bibref" href="#bib-micropub">micropub</a></cite>] endpoint to automatically add
posts to various collections. E.g.: if this post is a reply, it goes in the
"replies" collection. if it's an RSVP, it goes in the "rsvps" and "replies"
collections.
</p>
<ul>
<li>Live example: http://aaronparecki.com/</li>
</ul>
</section>
<section id="mf2util">
<h3 id="x11-3-mf2util"><span class="secno">11.3 </span>mf2util</h3>
<p>
mf2util exposes a function for post_type_discovery that takes an h-entry and
returns "like", "reply", "note", "article", etc.
</p>
<ul>
<li>Live demo: https://kylewm.com/services/mf2util</li>
</ul>
</section>
</section>
<section class="appendix informative" id="change-log">
<!--OddPage--><h2 id="a-change-log"><span class="secno">A. </span>Change Log</h2><p><em>This section is non-normative.</em></p>
<section id="changes-from-1-august-2017-wd-to-this-version">
<h3 id="a-1-changes-from-1-august-2017-wd-to-this-version"><span class="secno">A.1 </span>Changes from <a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170801/">1 August 2017 WD</a> to
this version</h3>
<ul>
<li>Add Conformance Classes
(<a href="https://github.com/tantek/post-type-discovery/issues/10">#10</a>)
</li>
<li>Add "event" discovery per sufficient implementations
(<a href="https://github.com/tantek/post-type-discovery/issues/19">#19</a>)
</li>
<li>Add informative Atom and RSS handling of their known/unchanging elements for determining
at least "note" vs "article", generalizing beyond mf2
(<a href="https://github.com/tantek/post-type-discovery/issues/2">#2</a>)
</li>
<li>Additional use cases for Response Type Discovery
(<a href="https://github.com/tantek/post-type-discovery/issues/33">#33</a>)
</li>
<li>Add post types to AS2 equivalents table
(<a href="https://github.com/tantek/post-type-discovery/issues/9">#9</a>)
(<a href="https://github.com/tantek/post-type-discovery/issues/15">#15</a>)
</li>
</ul>
</section>
<section id="changes-from-14-june-2017-wd-to-1-august-2017-wd">
<h3 id="a-2-changes-from-14-june-2017-wd-to-1-august-2017-wd"><span class="secno">A.2 </span>Changes from <a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170614/">14 June 2017 WD</a> to
<a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170801/">1 August 2017 WD</a></h3>
<ul>
<li>Response Type: move "reply" to last explicitly recognized response type to enable p-summary fallback use-cases
(<a href="https://github.com/tantek/post-type-discovery/issues/25">#25</a>)</li>
</ul>
</section>
<section id="changes-from-1-march-2017-wd-to-14-june-2017-wd">
<h3 id="a-3-changes-from-1-march-2017-wd-to-14-june-2017-wd"><span class="secno">A.3 </span>Changes from <a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170301/">1 March 2017 WD</a> to
<a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170614/">14 June 2017 WD</a></h3>
<ul>
<li>Added new section Response Type Algorithm
(<a href="https://github.com/tantek/post-type-discovery/issues/24">#24</a>)</li>
<li>Editorial improvements</li>
</ul>
</section>
<section id="changes-from-28-october-2016-wd-to-1-march-2017-wd">
<h3 id="a-4-changes-from-28-october-2016-wd-to-1-march-2017-wd"><span class="secno">A.4 </span>Changes from <a href="https://www.w3.org/TR/2016/WD-post-type-discovery-20161028/">28 October 2016 WD</a> to
<a href="https://www.w3.org/TR/2017/WD-post-type-discovery-20170301/">1 March 2017 WD</a></h3>
<ul>
<li>Explicitly note applies to any post data structure independent of serialization
(<a href="https://github.com/tantek/post-type-discovery/issues/13">#13</a>)</li>
<li>Reference Social Web Protocols
(<a href="https://github.com/tantek/post-type-discovery/issues/16">#16</a>)</li>
<li>End algorithm with explicit "Else"