forked from apparentlymart/activity-streams-specs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
atomactivity.xml
984 lines (844 loc) · 48.5 KB
/
atomactivity.xml
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
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="exp" docName="atomactivity-00" ipr="none">
<front>
<title abbrev="AtomActivity">Atom Activity Extensions (Draft)</title>
<author fullname="Martin Atkins" initials="M." surname="Atkins">
<organization>Six Apart</organization>
</author>
<author fullname="David Recordon" initials="D." surname="Recordon">
<organization>Facebook</organization>
</author>
<author fullname="Chris Messina" initials="C." surname="Messina">
<organization>Citizen Agency</organization>
</author>
<author fullname="Monica Keller" initials="M." surname="Keller">
<organization>MySpace</organization>
</author>
<author fullname="Ari Steinberg" initials="A." surname="Steinberg">
<organization>Facebook</organization>
</author>
<author fullname="Rob Dolin" initials="R." surname="Dolin">
<organization>Microsoft</organization>
</author>
<date />
<abstract>
<t>This document presents an extension that allows activities on social
objects to be expressed within the Atom Syndication Format.</t>
</abstract>
<note title="Requirements Language">
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <xref
target="RFC2119">RFC 2119</xref>.</t>
</note>
</front>
<middle>
<section title="Introduction">
<t>This document presents an extension that allows activities on social
objects to be expressed within <xref target="RFC4287">the Atom
Syndication Format</xref>.</t>
</section>
<section title="Notational Conventions">
<t>The XML Namespaces URI [W3C.REC-xml-names-19990114] for the XML
elements and attributes described in this specification is: <spanx
style="verb">http://activitystrea.ms/spec/1.0/</spanx>.</t>
<t>In this document, this namespace is referred to as "the AtomActivity
namespace", and the namespace prefix "activity:" is used for the above
namespace URI. The namespace prefix "atom:" is used for the namespace
URI <spanx style="verb">http://www.w3.org/2005/Atom</spanx>. The choices
of namespace prefix are arbitrary and not semantically significant.</t>
<t>This specification uses a shorthand form of terms from the XML
Infoset [W3C.REC-xml-infoset-20040204]. The phrase "Information Item" is
omitted when naming element and attribute information items. Therefore,
when this specification uses the term "element," it is referring to an
element information item in infoset terms. Likewise, when this
specification uses the term "attribute," it is referring to an attribute
information item.</t>
<t>This specification allows the use of IRIs [RFC3987]. Every URI
[RFC3986] is also an IRI, so a URI may be used wherever an IRI is named.
When an IRI that is not also a URI is given for dereferencing, it MUST
be mapped to a URI using the steps in Section 3.1 of [RFC3987]. When an
IRI is serving as an identifier, it MUST NOT be so mapped.</t>
<t>The text of this specification provides the sole definition of
conformance. Examples in this specification are non-normative.</t>
<t>This specification uses "the Atom specification" to refer to <xref
target="RFC4287"></xref>.</t>
</section>
<section title="Activity Concepts">
<t>For the purpose of this specification, an activity is a description
of an action that was performed (the verb) at some instant in time by
some actor (the actor, as described in <xref
target="activityactor"></xref> ), with some social object (the object).
An activity feed is a feed of such activities.</t>
<t>An activity may also have a target, which is the object into which or
to which the action was done. Whether a target is allowed and the
specific meaning of a target is defined by each verb.</t>
<t>It is expected that in many cases consumers of activity feeds will
use them to turn machine readable descriptions of activities into
human-readable sentences such as "Joanne posted a Photo: 'My Cat'". The
process for forming such sentences is not defined by this
specification.</t>
<section title="Verbs and Object Types">
<t>Verbs and object types are identified by IRIs (verb and object
identifiers) as defined by <xref target="RFC3987"></xref> though these
IRIs MAY not resolve to any useful resource. One verb is defined by
this specification in <xref target="postverb"></xref>.</t>
<t>Other specifications MAY define further verb and object types with
corresponding IRIs. Such specifications MUST define the meaning of
these verb and object identifiers, and SHOULD also describe how any
additional properties of the verb or object type are to be encoded in
an Atom entry.</t>
<t>Verbs and object types MAY derive from other verbs and object
types. The properties required by the parents will also be required by
the derived types. For example, if there is a base object type image
and a derived type of photo, all properties that are defined for image
are also defined for photo. Consumers that do not support the photo
object type may use their recognition of the image object type as a
fallback when processing an object of type photo.</t>
</section>
</section>
<section anchor="activityentries" title="Activity Entries">
<t>An activity entry is an entry element as described by the Atom
specification that represents an activity. The actor of the activity
entry is the author of the entry. The verbs and object of the activity
are identified explicitly in the Activity entry as described in the
following sections. An Atom entry is considered to be an activity entry
if and only if it has at least one <spanx style="verb">activity:verb</spanx>
child element and one or more <spanx style="verb">activity:object</spanx>
child elements as described in the following sections.</t>
<section anchor="titlesummarydetail"
title="Activity Title, Summary and Detail">
<t>In an activity entry, the <spanx style="verb">atom:title</spanx>,
<spanx style="verb">atom:summary</spanx> and <spanx style="verb">atom:content</spanx>
elements as described by <xref target="RFC4287"></xref> MUST contain a
human-readable description of the activity. This text will be used by
general Atom processors that do not understand this extension. This
text MAY also be used by feed processors that do not recognize the
verb. Any other non-activity elements may be used in an activity entry
to effect a desired handling by non-activity processors.</t>
<t>Feed producers MAY use information from outside sources to choose a
suitable language to use for the activity description. For example, a
feed producer responding to an HTTP request might use the HTTP
Accept-Language header or a user preference otherwise determined to
select a language. Feed producers SHOULD use <spanx style="verb">xml:lang</spanx>
as described in <xref target="RFC4287"></xref> section 2 to identify
the language used.</t>
</section>
<section title="Time of the Activity">
<t>The time at which an activity occurred is represented in the
atom:published element within each activity entry. An activity entry
MUST have exactly one atom:published element.</t>
<t>The time stored herein is the time that the activity occurred,
<spanx>not</spanx> the time that the associated activity object was
published. Feed processors MAY use this element to sort a list of
activity entries into chronological order.</t>
</section>
<section title="Activity Link">
<t>An activity entry SHOULD include an atom:link element with a link
relationship of "alternate", a type of "text/html" and a href
attribute containing the URL of an HTML-based representation of this
activity or the associated object. Though this link does not have any
special significance in this specification, general Atom processors
that do not support the activity extensions will often present such a
link to the user.</t>
</section>
<section anchor="activityverbelement" title="Activity Verb">
<t>Verbs are represented using the activity:verb Extension Element.
All activity entries MUST have at least one activity:verb element.</t>
<t>The content of the activity:verb element MUST be a verb identifier
(an IRI as defined by <xref target="RFC3987"></xref>). Note that the
definition of IRI excludes relative references. Although the IRI MAY
use a dereferencable scheme, processors must not assume that it can be
dereferenced.</t>
<t>The verb identifier within this element defines a verb for this
activity. A given activity entry MAY have more than one activity:verb
element, which indicates that there are several verbs describing this
activity. Where multiple verbs are used, all verbs MUST be
generalizations or specializations of one another. For example, the
general verb "to experience" might be specialized by a verb "to listen
to". If a derived verb is used, publishers SHOULD also include all of
its ancestor types so that a consumer may use the most specific verb
it understands.</t>
<t>An activity feed processor SHOULD use the most specific verb it
understands within each entry. If none of the activity's verbs are
understood by the processor, the processor MAY use other information
to infer the verb, or the processor MAY use the content of the
atom:title, atom:summary and/or atom:content to obtain a
human-readable description of the activity as a fallback.</t>
<figure>
<artwork><![CDATA[<entry>
<id>tag:versioncentral.example.org,2009:/commit/1643245</id>
<published>2009-06-01T12:54:00Z</published>
<title>Geraldine committed a change to yate</title>
<content type="html">Geraldine just committed a change to yate on VersionCentral</content>
<link rel="alternate" type="text/html"
href="http://versioncentral.example.org/geraldine/yate/commit/1643245" />
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<activity:verb>http://versioncentral.example.org/activity/commit</activity:verb>
<activity:object>
<activity:object-type>http://versioncentral.example.org/activity/changeset</activity:object-type>
<id>tag:versioncentral.example.org,2009:/change/1643245</id>
<title>Punctuation Changeset</title>
<summary>Fixing punctuation because it makes it more readable.</summary>
<link rel="alternate" type="text/html" href="..." />
</activity:object>
</entry>]]></artwork>
<postamble>Example: This example introduces a "changeset" object
type and a "commit" verb, both ficticious, invented for the
ficticious example service "VersionCentral". Since the "commit" verb
is a derived type of "post", VersionCentral's activity entries
include both the "post" verb and the "commit" verb so that consumers
which do not support their proprietary extension may fall back on
the "post" verb.</postamble>
</figure>
</section>
<section anchor="activityobjectelement" title="Activity Object">
<t>The object is represented using the activity:object extension
element. The activity:object element contains information about the
main object of the activity. All activity entries MUST have one or
more activity:object elements. The content model of activity:object is
identical to that of atom:entry when used in an object entry as
described in <xref target="objectentries"></xref>.</t>
<t>activity:object MUST contain exactly one atom:id element. If this
object is also published in an object entry, the atom:id value MUST be
the same as in the object entry.</t>
<t>activity:object SHOULD contain exactly one atom:title element,
which MAY be used by feed processors to identify the object to the
user -- for example as the text of a link to the HTML representation
of the object.</t>
<t>activity:object SHOULD also contain exactly one atom:link element
with a link relationship of "alternate" and the type "text/html", with
the href attribute containing the URL of the HTML representation of
the object if available.</t>
<t>activity:object MAY also contain an atom:source element, as
described by the Atom specification, describing the object feed where
this object resides, if any. Processors MAY use this information to
give context to the activity. For example, if the source feed has a
title of "Claire's Weblog", a processor may include the text "in
Claire's Weblog" at the end of a sentence describing the activity to
the user.</t>
<t>All other elements included in activity:object SHOULD reflect
elements in the object entry for this Object, if one exists.</t>
<t>An activity entry and its associated object entry MUST NOT share
the same atom:id value.</t>
<t>An activity entry with more than one activity:object element is
considered, for the purposes of activity processing, to be equivalent
in meaning to a sequence of activity entries each with a single
activity:object and the same verb, actor, target and context. Activity
processors SHOULD handle multi-object activities as distinct
activities, though they MAY perform any coalescing of activities they
deem appropriate when displaying activity data to users. Feed
producers MUST NOT create coalesced activity entries except where the
rules in this paragraph hold. Coalesced activity entries hold no
special meaning to activity processors and are supported only for the
benefit of non-activity feed consumers which are not capable of doing
any automatic coalescing.</t>
<section anchor="objecttypeelement"
title="The activity:object-type Extension Element">
<t>The content of the activity:object-type element MUST be an object
identifier (an IRI as defined by <xref target="RFC3987"></xref>).
The definition of IRI excludes relative references. Though the IRI
MAY use a dereferenceable scheme, processors MUST not assume that it
can be dereferenced.</t>
<t>The object identifier within this element gives an object type
for the object described by this object entry. A given object entry
MAY have more than one activity:object-type element, which indicates
that this object has several types. Where multiple types are used,
all types MUST be generalizations or specializations of one another.
For example, the general type "web page" might be specialized by a
type "weblog entry". If a derived type is used, publishers SHOULD
also include all of its ancestor types so that a consumer may use
the most specific type it understands.</t>
<t>An object entry SHOULD have at least one activity:object-type
element.</t>
<t>Activity feed processors SHOULD use the most specific object type
that they understand within each entry. The processor MAY use other
information to infer the object type if it cannot understand any of
the object types given. If it cannot so infer the object type, a
processor MUST act as though no activity:object-type element is
present.</t>
<t>If no activity:object-type element is present, the object has no
specific type. Processors SHOULD refer to such objects only by their
titles. For example, when forming an activity sentence a processor
might say "Johan posted 'My Cat'" rather than "Johan posted a photo:
'My Cat'".</t>
</section>
</section>
<section title="Activity Target">
<t>The activity:target element contains information about the target
of the activity, for verbs that support a target. The target is the
object that the action was done to. The content model of <spanx
style="verb">activity:target</spanx> and the meaning of its child
elements are identical to that of <spanx style="verb">activity:object</spanx>.
The precise meaning of the target as relates to the activity depends
on the verb in use, but its meaning is somewhat similar to the English
preposition "to". The activity:target extension element MUST NOT be
used for indirect objects that are not targets.</t>
<t>In <xref target="activityentrycomplex"></xref> the target is a
photo album to which photos were added.</t>
</section>
<section anchor="activityactor" title="Activity Actor">
<t>The activity:actor element MAY be used to describe the object that
performed the activity. This element, if present, MUST describe the
same object as is described by the atom:author element. The content
model and the meaning of its child elements are identical to that of
<spanx style="verb">activity:object</spanx></t>
<t>In a feed which has an activity:subject element, the activity:actor
element MAY be omitted from one or more activity entries, in which
case the actor is implied to be the subject of the feed. If the feed
has no subject, activity:actor MUST be present.</t>
<t>Each activity entry MUST have zero or one activity:actor
elements.</t>
</section>
<section title="Activity Context">
<t>The activity:context element is a container for additional
contextual information about an activity. This information will often
be orthogonal to the verb and object type and supply additional
information about the situation in which the activity was performed.
For example, an activity entry could contain information about the
actor's location at the time of the activity.</t>
</section>
</section>
<section anchor="objectentries" title="Object Entries">
<t>An object entry is an entry element as described by the Atom
specification that represents the object of an activity. Any entry that
does not meet the criteria for being an activity entry as described in
<xref target="activityentries"></xref> is considered an object entry by
this specification. In particular, this means that valid Atom entries
without any activity annotations are considered to be object entries by
this specification.</t>
<t>Object entries are intended to be used by feeds that describe the
creation of content. In a valid object entry, all Atom elements SHOULD
describe the object that was created or otherwise the object of an
activity, rather than describing the activity itself.</t>
<t>The content model of an object entry is the same as that of an <spanx
style="verb">activity:object</spanx> element used within an activity
entry, as defined in <xref target="activityobjectelement"></xref>.</t>
<section anchor="impliedpost" title="Implied Activity">
<t>When used alone, outside of the context of an explicit activity
entry, an object entry has an implied activity. The implied activity
entry for an object entry is constructed as follows:</t>
<t><list style="numbers">
<t>Create an empty atom:entry element. This is the activity entry
element.</t>
<t>If the object entry has as a child at least one activity:verb
element, copy all such elements into the activity entry element.
Otherwise, insert into the activity entry element a new
activity:verb element containing the verb Identifier of the post
verb as described in <xref target="postverb"></xref>.</t>
<t>Copy the atom:published element from the object entry element
into the activity entry element.</t>
<t>Insert into the activity entry element a new activity:object
element.</t>
<t>Do a deep copy of all child elements of the object entry
element into the activity:object element, excluding activity:verb
and atom:published.</t>
<t>If the activity entry has as a child an activity:verb element
containing the verb Identifier of the post verb, copy the
atom:published element from the object entry to the
activity:object element.</t>
</list></t>
<t>Processors SHOULD generate suitable human-readable descriptions of
the action and insert them as described in <xref
target="titlesummarydetail"></xref>.</t>
<t>If the resulting entry will be published, processors SHOULD
generate suitable values for all other elements that the Atom
specification requires as children of atom:entry. In particular, an
atom:id value SHOULD be generated; this value MUST NOT be the same as
that of the object entry's atom:id.</t>
<t>If the resulting entry is to be published, processors MAY omit
elements from the generated activity:object element to reduce
overhead. Such processors SHOULD bear in mind the requirements in
<xref target="activityobjectelement"></xref>.</t>
<t>Processors expecting activity entries SHOULD apply the above
transformation to any object entries they encounter in order to
process them as activities, or at least act as if they have done
so.</t>
<t>Due to the way it is constructed, there is no way to represent
additional properties for the verb(s) of an implied activity. If a
particular verb requires additional properties then it MUST NOT be
used in an implied activity.</t>
<section title="The verbs for the Implied Activity">
<t>When appearing as a child of an object entry (that is, an entry
that does not also have an activity:object child element), the
content of the <spanx style="verb">activity:verb</spanx> element
MUST be the verb type of the implied activity for the object entry,
as defined in <xref target="impliedpost"></xref>. When used in this
way, the content model is identical to when used in an activity
entry as described in <xref
target="activityverbelement"></xref>.</t>
</section>
</section>
<section anchor="rss" title="Object Entries in RSS">
<t>TODO: this "alternate representation" section should appear after
the full description of the "normal" Atom representation.</t>
<t>For compatibility with existing deployments, this specification
also defines a subset of the activity markup that may be used in <xref
target="RSS_2.0">RSS 2.0</xref> feeds to add verb and object type
annotations to objects published in RSS rather than Atom feeds.</t>
<t>Objects published as RSS 2.0 <spanx style="verb">item</spanx>
elements MAY use the <spanx style="verb">activity:verb</spanx> and
<spanx style="verb">activity:object-type</spanx> elements with
equivalent content models and semantics as described above for their
use in Atom object entries.</t>
<t>Activity processors MUST use the following process to construct the
implied activity for an object entry published as an RSS 2.0 <spanx
style="verb">item</spanx> element, or MUST act as if they have done
so:</t>
<t><list style="numbers">
<t>Create an empty atom:entry element. This is the activity entry
element.</t>
<t>If the object entry has as a child at least one activity:verb
element, copy all such elements into the activity entry element.
Otherwise, insert into the activity entry element a new
activity:verb element containing the verb Identifier of the post
verb as described in <xref target="postverb"></xref>.</t>
<t>If the object entry has a RSS <spanx style="verb">pubDate</spanx>
element as a child, parse its content as per the RSS 2.0
specification to obtain a date and time value. Create an <spanx
style="verb">atom:published</spanx> element whose content is the
serialization of this data and time value as described in <xref
target="RFC3339"></xref>, and insert this element into the
activity entry element.</t>
<t>Insert into the activity entry element a new <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the object entry has as a child an RSS title element, create
an atom:title element whose text content matches the text content
of that element element and insert the new element into the <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the object entry has as a child a <spanx style="verb">content</spanx>
element in the namespace <spanx style="verb">http://purl.org/rss/1.0/modules/content/</spanx>,
create an <spanx style="verb">atom:content </spanx>element whose
text content matches the text content of that element and which
has the attribute <spanx style="verb">type</spanx> with the value
<spanx style="verb">html</spanx>. Otherwise, if the object entry
has as a child an RSS <spanx style="verb">description</spanx>
element, create an <spanx style="verb">atom:content</spanx>
element whose text content matches the text content of that
element and which has the attribute <spanx style="verb">type</spanx>
with the value <spanx style="verb">html</spanx>. In both cases,
insert the created <spanx style="verb">atom:content</spanx>
element into the <spanx style="verb">activity:object</spanx>
element.</t>
<t>If the object entry a RSS <spanx style="verb">link</spanx>
element as as a child, create an <spanx style="verb">atom:link</spanx>
element with a <spanx style="verb">href</spanx> attribute whose
value is the text content of the RSS <spanx style="verb">link</spanx>
element, and with a <spanx style="verb">type</spanx> attribute
whose value is <spanx style="verb">text/html</spanx>. Insert the
<spanx style="verb">atom:link</spanx> element into the <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the object entry has one or more RSS <spanx style="verb">enclosure</spanx>
elements as children, create for each an <spanx style="verb">atom:link</spanx>
element with a <spanx style="verb">href</spanx> attribute whose
value is the text content of the <spanx style="verb">enclosure</spanx>
element's <spanx style="verb">url</spanx> attribute, a <spanx
style="verb">rel</spanx> attribute whose value is <spanx
style="verb">enclosure</spanx>, a <spanx style="verb">type</spanx>
attribute whose value is the text content of the <spanx
style="verb">enclosure</spanx> element's <spanx style="verb">type</spanx>
attribute, and a <spanx style="verb">length</spanx> attribute
whose value is the text content of the <spanx style="verb">enclosure</spanx>
element's <spanx style="verb">length</spanx> attribute. If any of
these attributes are not present on the <spanx style="verb">enclosure</spanx>
element, the equivalent attribute on the <spanx style="verb">atom:link</spanx>
element MUST NOT be created. Insert the created <spanx
style="verb">atom:link</spanx> elements into the <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the object entry has a <spanx>descendent</spanx> one or more
<spanx style="verb">thumbnail</spanx> elements in the namespace
<spanx style="verb">http://search.yahoo.com/mrss/</spanx>, create
for each an <spanx style="verb">atom:link</spanx> element with a
<spanx style="verb">href</spanx> attribute whose value is the text
content of the <spanx style="verb">thumbnail</spanx> element's url
attribute, a <spanx style="verb">rel</spanx> attribute whose value
is <spanx style="verb">preview</spanx>, a <spanx style="verb">width</spanx>
attribute in the namespace <spanx style="verb">http://purl.org/syndication/atommedia</spanx>
whose value is the text content of the <spanx style="verb">thumbnail</spanx>
element's <spanx style="verb">width</spanx> attribute, and a
<spanx style="verb">height</spanx> attribute in the namespace
<spanx style="verb">http://purl.org/syndication/atommedia</spanx>
whose value is the text content of the <spanx style="verb">thumbnail</spanx>
element's <spanx style="verb">height</spanx> attribute. If any of
these attributes are not present on the <spanx style="verb">thumbnail</spanx>
element, the equivalent attribute on the <spanx style="verb">atom:link</spanx>
element MUST NOT be created. Insert the created <spanx
style="verb">atom:link</spanx> elements into the <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the object entry has as a child an RSS <spanx style="verb">guid</spanx>
element, create an <spanx style="verb">atom:id</spanx> element
whose text content matches the text content of that element. If
the <spanx style="verb">guid</spanx> element has an attribute
<spanx style="verb">isPermaLink</spanx> with the value <spanx
style="verb">true</spanx>, additionally create an <spanx
style="verb">atom:link</spanx> element with a <spanx style="verb">href</spanx>
attribute containing the text content of the <spanx style="verb">guid</spanx>
element and a type attribute whose value is <spanx style="verb">text/html</spanx>.
In both cases, insert the created element into the <spanx
style="verb">activity:object</spanx> element.</t>
<t>If the activity entry has as a child an <spanx style="verb">activity:verb</spanx>
element containing the IRI of the post verb, copy the <spanx
style="verb">atom:published</spanx> element from the activity
entry to the <spanx style="verb">activity:object</spanx>
element.</t>
</list></t>
<t>If the above procedure results in an activity entry that is not
valid as per this specification or the Atom specification, processors
MUST treat the result as they would had the invalid entry arrived in a
real feed rather than having been synthesized.</t>
</section>
</section>
<section title="Activity Feeds">
<t>This specification defines no required extensions to the atom:feed
element as defined by the Atom specification. Therefore a standard Atom
feed that contains only activity entries as defined above can be
considered to be an activity feed. Processors MAY create an activity
entry representing the implied post activity of an object entry (see
<xref target="impliedpost"></xref>) in order to synthesize an activity
feed from a traditional Atom feed.</t>
<t>A feed MAY contain both activity and object entries.</t>
<section anchor="activitysubject" title="Feed Subject">
<t>The activity:subject extension element, when used as a child of an
atom:feed element, gives information about the object that the feed is
describing. An atom:feed element MUST have zero or one
activity:subject elements.</t>
<t>The content model of the activity:subject element is the same as
that of the activity:object element as described in <xref
target="activityobjectelement"></xref>.</t>
<t>When the activity:subject extension element is used, the value of
its atom:id element can be compared with the corresponding atom:id
elements in activity:object, activity:actor and activity:target
entry-level elements to determine which role the feed's actor played
in an activity. Publishers MAY, when using activity:subject, publish
activities in which the feed subject is the object or target rather
than the actor; consumers MUST NOT assume that the subject of an
activity feed is the actor in all of its constituent activities.</t>
<t>If no activity:subject element is provided then the feed has no
subject. Consumers MAY make use of information obtained from another
source to determine the subject.</t>
<t>activity:object, activity:target and activity:actor elements which
share the same id as the feed's activity:subject SHOULD include only
the atom:id element; consumers MUST use the elements of the
activity:subject element in place of the elements of the referring
element. This minimizes duplication of information in a feed that is
about a single subject.</t>
<t>activity:subject MAY be used as a child of any element where
feed-level elements are expected, including atom:source. When used in
this way, its relationship to the parent element is the same as that
of other feed-level elements appearing as its sibling elements.</t>
<section title="Example">
<figure>
<artwork><![CDATA[<feed xml:lang="en-US"
xmlns:activity="http://activitystrea.ms/spec/1.0/"
xmlns="http://www.w3.org/2005/Atom">
<title type="text">Recent activities from Geraldine at PhotoPanic</title>
<id>tag:photopanic.example.com,2009:user/4859568/activities</id>
<updated>2009-06-24T03:46:14Z</updated>
<author>
<name>Geraldine</name>
</author>
<activity:subject>
<id>tag:photopanic.example.com,2009:/Person/4859568</id>
<title>Geraldine</title>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<link rel="alternate" type="text/html" href="/geraldine" />
</activity:subject>
.
.
.
</feed>]]></artwork>
<postamble>Example: If we present an atom activity feed which
contain all of the photos that Geraldine has uploaded to
PhotoPanic then PhotoPanic may publish a feed that begins as
illustrated.</postamble>
</figure>
</section>
</section>
<section title="A Note about Legacy Feeds">
<t>This section is non-normative.</t>
<t>The implied post activity as described in <xref
target="impliedpost"></xref>, along with the advice about untyped
object entries in <xref target="objectentries"></xref>, are together
intended to provide a mechanism for processing traditional
non-activity Atom feeds as Activity Feeds. At the time of writing this
specification, most such feeds serve to describe the activity of
posting an item such as a weblog entry or a photo.</t>
<t>It is acknowledged, however, that there exist feeds that have other
meanings, such as a list of a particular user's "favorite" objects.
When applying the advice for processing feeds without activity
extensions to such feeds, a processor will likely misinterpret the
nature of the activity. In practice, however, it seems that most feeds
of this kind include something in the title indicating their nature,
so rendering such a misinterpreted activity to a sentence will lead to
something such as <spanx>Joe posted "Funny Cats" in "Joe's Favorite Videos"</spanx>,
which, while not ideal, is an acceptable result in situations where
activities are primarily for human consumption.</t>
</section>
</section>
<section anchor="postverb" title="The 'post' Verb">
<t>This specification defines a single verb, which has the verb
Identifier IRI <spanx style="verb">http://activitystrea.ms/schema/1.0/post</spanx>.</t>
<t>This verb describes the act of posting or publishing an object on the
web. The implication is that before this activity occurred the object
was not posted, and after the activity has occurred it <spanx>is</spanx>
posted or published.</t>
<t>This verb is used when creating the Implied post activity for a
standalone object entry that has no explicit verb. It MAY also be used
as the value of activity:verb in an explicit activity entry.</t>
<t>In an activity entry which has the 'post' verb, the value of the
atom:published element SHOULD be the same as the atom:published element
in the associated object entry.</t>
<t>If an activity using this verb has an <spanx style="verb">activity:target</spanx>
element, the target object is the collection in which the item was
posted.</t>
<t>The 'post' verb has no additional properties or modifiers.</t>
</section>
<section title="Requirements for Activity Re-publishers">
<t>An activity re-publisher is any system that produces feeds that
contain activities or objects that were obtained from another feed or
feed-like data source. This section contains requirements for such
systems that aim to allow consumers of such feeds to process the
activities described in such feeds in a way similar to how they would
have processed the activities when obtained directly from the source,
and to allow consumers to detect duplicate activities or objects
obtained via multiple feeds.</t>
<t>An activity re-publisher may choose to produce either object entries
or Activity Entries, except where the the re-publisher is re-publishing
an activity entry, in which case the activity entry MUST be produced to
avoid loss of information that cannot be expressed in an object
entry.</t>
<t>Where a re-publisher produces a full activity entry from a source
object entry, the mapping process described in <xref
target="impliedpost"></xref> MUST be used. A re-publisher MAY perform
additional mapping steps when doing this conversion.</t>
<t>Where a re-publisher produces a full activity entry from a source RSS
object entry, the mapping process described in <xref
target="rss"></xref> MUST be used. A re-publisher MAY perform additional
mapping steps when doing this conversion.</t>
<t>If a source object entry does not contain verb or object type
information, a re-publisher MAY use information obtained elsewhere to
synthesize appropriate verb or object type annotations.</t>
<t>When a re-publisher reproduces a source activity entry, the publisher
MUST copy the atom:id and atom:published elements from the source
activity entry without modification, and MUST similarly preserve the
contents of all elements in the AtomActivity namespace where these
elements are used correctly as per this specification.</t>
<t>When a re-publisher reproduces an entry, the atom:source element MUST
be used in accordance with its definition in the Atom specification. A
re-publisher SHOULD include as much information as possible from the
source entry, paying special attention to data that is of significance
to the object type(s) and/or verb(s) used on the entry where these are
known to the re-publisher.</t>
<t>When a re-publisher produces a feed of activities aggregated from
multiple sources but known via some externally-obtained information to
be by the same actor, even if that actor is represented by a different
object in different source feeds, the re-publisher SHOULD create a
feed-level activity:subject element that describes the re-publisher's
representation of the actor and then substitute this representation in
any activity:actor, activity:object or activity:target element known to
represent the same actor.</t>
</section>
<section title="Security Considerations">
<t>As this specification defines an extension to the Atom Syndication
Format, it is subject to the same security considerations defined in
<xref target="RFC4287"></xref>.</t>
<t>[TODO: Write some more here.]</t>
</section>
<section title="IANA Considerations">
<t>None.</t>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC4287">
<front>
<title>The Atom Syndication Format</title>
<author>
<organization></organization>
</author>
<date />
</front>
</reference>
<reference anchor="RFC2119">
<front>
<title>RFC 2119</title>
<author>
<organization></organization>
</author>
<date />
</front>
</reference>
<reference anchor="RFC3987">
<front>
<title>Internationalized Resource Identifiers (IRIs)</title>
<author>
<organization></organization>
</author>
<date />
</front>
</reference>
<reference anchor="RFC3339">
<front>
<title>Date and Time on the Internet: Timestamps</title>
<author fullname="Graham Klyne" initials="G." surname="Klyne">
<organization></organization>
</author>
<date month="July" year="2002" />
</front>
</reference>
<reference anchor="RSS_2.0"
target="http://www.rssboard.org/rss-specification">
<front>
<title>Date and Time on the Internet: Timestamps</title>
<author fullname="Graham Klyne" initials="G." surname="Klyne">
<organization></organization>
</author>
<date month="July" year="2002" />
</front>
</reference>
</references>
<section title="Acknowledgements">
<t>...</t>
</section>
<section title="Examples">
<t>This appendix is non-normative. Where these examples include
fragments of XML documents, assume the namespace declarations <spanx
style="verb">xmlns="http://www.w3.org/2005/Atom" xmlns:activity="http://activitystrea.ms/spec/1.0/"</spanx>
are in scope.</t>
<section anchor="activityentryexample" title="Activity Entry Examples">
<figure anchor="activityentrysimple">
<preamble>A typical activity entry</preamble>
<artwork><![CDATA[<entry>
<id>tag:photopanic.example.com,2008:activity01</id>
<title>Geraldine posted a Photo on PhotoPanic</title>
<published>2008-11-02T15:29:00Z</published>
<link rel="alternate" type="text/html"
href="/geraldine/activities/1" />
<activity:verb>
http://activitystrea.ms/schema/1.0/post
</activity:verb>
<activity:object>
<id>tag:photopanic.example.com,2008:photo01</id>
<title>My Cat</title>
<published>2008-11-02T15:29:00Z</published>
<link rel="alternate" type="text/html"
href="/geraldine/photos/1" />
<activity:object-type>
tag:atomactivity.example.com,2008:photo
</activity:object-type>
<source>
<title>Geraldine's Photos</title>
<link rel="self" type="application/atom+xml"
href="/geraldine/photofeed.xml" />
<link rel="alternate" type="text/html"
href="/geraldine/" />
</source>
</activity:object>
<content type="html">
<p>Geraldine posted a Photo on PhotoPanic</p>
<img src="/geraldine/photo1.jpg">
</content>
</entry>]]></artwork>
<postamble>This example shows a typical activity entry using the
post verb defined by this specification and a hypothetical "photo"
object type. It also demonstrates the use of atom:title and
atom:content to provide fallback content for feed processors that do
not support activity extensions. An activity stream application
might render this entry into the sentence "Geraldine posted a photo
titled 'My Cat' in Geraldine's Photos", with the photo title and the
source feed title presented as links.</postamble>
</figure>
<figure anchor="activityentrycomplex">
<artwork><![CDATA[<entry>
<id>tag:photopanic.example.com,2009:/activity/4859568/PhotoAdd/2519358/2009171</id>
<title type="text">Geraldine added two new photos to the My Pets album.</title>
<published>2009-06-21T00:28:35Z</published>
<author>
<name>Geraldine</name>
<uri>http://photopanic.example.com/</uri>
</author>
<link rel="alternate" type="text/html"
href="/geraldine/activities/1234" />
<content type="xhtml">...</content>
<activity:actor>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<id>tag:photopanic.example.com,2009:/Person/4859568</id>
<title>Geraldine</title>
<link rel="alternate" type="text/html"
href="/geraldine" />
</activity:actor>
<activity:target>
<activity:object-type>http://activitystrea.ms/schema/1.0/photo-album</activity:object-type>
<id>tag:photopanic.example.com,2009:/Photo_Album/2519358</id>
<title>My Pets</title>
<link rel="alternate" type="text/html"
href="/geraldine/albums/pets" />
</activity:target>
<activity:object>
<activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
<activity:object-type>http://activitystrea.ms/schema/1.0/image</activity:object-type>
<id>tag:photopanic.example.com,2009:/Photo/2519358/60764840</id>
<title>My Cat</title>
<link rel="alternate" type="text/html"
href="/geraldine/photos/1643" />
<link rel="preview" type="image/jpeg"
href="/geraldine/photos/1643/thumb.jpg" />
<link rel="enclosure" type="image/jpeg"
href="/geraldine/photos/1643/full.jpg" />
</activity:object>
<activity:object>
<activity:object-type>http://activitystrea.ms/schema/1.0/image</activity:object-type>
<activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
<id>tag:photopanic.example.com,2009:/Photo/2519358/60764844</id>
<title></title>
<link rel="alternate" type="text/html"
href="/geraldine/photos/1634" />
<link rel="preview" type="image/jpeg"
href="/geraldine/photos/1634/thumb.jpg" />
<link rel="enclosure" type="image/jpeg"
href="/geraldine/photos/1634/full.jpg" />
</activity:object>
</entry>]]></artwork>
<postamble>Example: An activity entry showing the use of the actor,
verb, object and target elements. Also illustrated is the use of
multiple objects in a single activity entry, which serves as a
shorthand for publishing multiple consecutive activities with the
same verb and target.</postamble>
</figure>
</section>
<section anchor="objectentryexample" title="Object Entry Example">
<figure>
<preamble>A simple object entry</preamble>
<artwork><![CDATA[<entry>
<id>tag:photopanic.example.com,2008:photo01</id>
<title>My Cat</title>
<published>2008-11-02T15:29:00Z</published>
<link rel="alternate" type="text/html"
href="/geraldine/photos/1" />
<activity:object-type>
tag:atomactivity.example.com,2008:photo
</activity:object-type>
</entry>
]]></artwork>
<postamble>This example shows an object entry describing the object
referred to in the activity from <xref
target="activityentryexample"></xref>. That example would also be an
acceptable implied post activity for this entry, assuming that this
entry were in a feed whose attributes match those of the atom:source
in the activity entry example.</postamble>
</figure>
</section>
</section>
</back>
</rfc>