forked from activitystreams/json-activity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
draft-snell-activitystreams-02.xml
2027 lines (1769 loc) · 78.3 KB
/
draft-snell-activitystreams-02.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
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc3987 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3987.xml'>
<!ENTITY rfc3986 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml'>
<!ENTITY rfc3339 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3339.xml'>
<!ENTITY rfc4627 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4627.xml'>
<!ENTITY rfc5988 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml'>
<!ENTITY rfc6963 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6963.xml'>
<!ENTITY rfc5646 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5646.xml'>
<!ENTITY rfc5226 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml'>
<!ENTITY jsonld PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.WD-json-ld-20130411.xml'>
]>
<?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="std" ipr="trust200902" docName="draft-snell-activitystreams-02" >
<front>
<title abbrev="ActivityStreams">JSON Activity Streams 2.0</title>
<author fullname="James M Snell" initials="J." surname="Snell" role="editor">
<organization>IBM</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date month="July" year="2013" />
<area>General</area>
<workgroup>Activity Streams (http://activitystrea.ms)</workgroup>
<keyword>JSON</keyword>
<keyword>Activity Streams</keyword>
<abstract>
<t>
This specification details a model for representing potential and
completed activities using the JSON format.
</t>
</abstract>
<note title="Author's Note">
<t>
This draft is heavily influenced by the original JSON
Activity Streams 1.0 specification that was originally co-authored
by Martin Atkins, Will Norris, Chris Messina, Monica Wilkinson,
Rob Dolin and James Snell. The author is very thankful for their
significant contributions and gladly stands on their shoulders.
Some portions of the original text of Activity Streams 1.0 are
used in this document.
</t>
<t>
The Activity Streams 1.0 and 2.0 specifications are works produced
by the Activity Streams Working Group (http://activitystrea.ms/)
operating independently of the IETF. Discussion and feedback about
this specification is invited and should be directed to the Activity
Streams Mailing List (see
https://groups.google.com/forum/#!forum/activity-streams).
</t>
</note>
</front>
<middle>
<section anchor="introduction" title="Introduction">
<t>
In the most basic sense, an "activity" is a semantic description
of potential or completed actions. In the former case,
the activity expresses what can be done with a particular object,
while in the latter case, it expresses what has already been
done.
</t>
<t>
It is the goal of this specification to provide a JSON-based syntax
that is sufficient to express metadata about activities in a rich,
human-friendly, machine-processable and extensible manner. This may
include constructing natural-language descriptions or visual
representations about the activity, associating actionable
information with various types of objects, communicating or recording
activity logs, or delegation of potential actions to other applications.
</t>
<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" />.
</t>
<section title="Relationship to JSON Activity Streams 1.0" anchor="asms-1">
<t>
The <xref target="activitystreams-1.0">JSON Activity
Streams 1.0</xref> specification was published in May
of 2011 and provided a baseline extensible syntax for the expression
of completed activities. This specification builds upon that
initial foundation by incorporating lessons learned through
extensive implementation, community feedback and related work
being performed in other standards development communities.
</t>
<t>
While the syntax defined by this specification diverges somewhat
from that defined by JSON Activity Streams 1.0, the verbs, objectTypes,
extensions and fundamental model defined by that original
specification remain intact.
</t>
</section>
<section title="Relationship to JSON-LD 1.0" anchor="json-ld" >
<t>
The <xref target="W3C.WD-json-ld-20130411">JSON-based Serialization for
Linked Data (JSON-LD)</xref> describes a rich syntax for the
serialization of semantically-rich metadata using the JSON format.
While the updated Activity Streams representation provided by this
document is not defined as a "JSON-LD Vocabulary", the syntax is
designed to be closely compatible with JSON-LD.
</t>
<t>
There are a few differences between JSON-LD and the
serialization syntax described here, specifically:
<list style="symbols">
<t>
JSON-LD uses certain field names with a leading "@" character,
such as "@id" and "@language". In this specification, the
leading "@" is omitted.
</t>
<t>
While JSON-LD allows using relative IRI references
in the values of "id" properties, this specification
limits identifiers to absolute IRIs.
</t>
<t>
While it is possible to derive a JSON-LD "@context" description
for the Activity Streams 2.0 JSON syntax one is not normatively
provided by this specification.
</t>
</list>
</t>
<t>
When processing an Activity Streams document as JSON-LD, the
following rules apply:
<list style="symbols">
<t>
The "objectType" property MUST be treated as an alias of
JSON-LD "@type".
</t>
<t>
The "id" property MUST be treated as an alias of JSON-LD "@id".
</t>
<t>
The "language" property MUST be treated as an alias of JSON-LD
"@language".
</t>
<t>
A JSON array used to convey <xref target="link">Link</xref> values
MUST be treated as an unordered JSON-LD @set (@container = @set).
</t>
<t>
The JSON array value for the "items" property defined in
<xref target="collection" /> MUST be treated as an ordered
JSON-LD @list (@container = @list).
</t>
<t>
The "displayName", "title", "content" and "summary" properties
defined in <xref target="object" /> and <xref target="object-ext" />
MUST be treated as JSON-LD Language Maps (@container = @language).
</t>
</list>
</t>
</section>
<section anchor="serialization" title="Syntax Conventions">
<t>
This specification defines a <xref target="RFC4627">JSON-based</xref>
serialization syntax.
</t>
<t>
When serialized, absent properties are represented by either
(a) setting the property value to null, or (b) by omitting the
property declaration altogether at the option of the publisher;
these representations are semantically equivalent. If a
property has an array value, the absence of any items in that array
MUST be represented by omitting the property entirely or by setting
the value to null.
</t>
<t>
This specification uses IRIs <xref target="RFC3987"/>.
Every URI <xref target="RFC3986" /> is also an IRI, so a URI may be used
wherever an IRI is named. There are two special considerations:
(1) 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
<xref target="RFC3987"/> and (2) when an IRI is serving as
an "id" value, it MUST NOT be so mapped.
</t>
<t>
Unless otherwise specified, all properties with date and
time values MUST conform to the "date-time" production in
<xref target="RFC3339" />, with an uppercase "T" character
used to separate date and time, and an uppercase "Z" character
in the absence of a numeric time zone offset. All such timestamps
SHOULD be represented relative to Coordinated Universal Time (UTC).
</t>
</section>
</section>
<section anchor="examples" title="Example Activities">
<t>
Following are three examples of activities with varying
degrees of detail.
</t>
<section title="Example 1: Minimal Activity">
<t>
Expresses the statement "'urn:example:person:martin' posted
'http://example.org/foo.jpg'". No additional detail is
given.
</t>
<figure>
<artwork><![CDATA[
{
"verb": "post",
"actor": "urn:example:person:martin",
"object": "http://example.org/foo.jpg"
}
]]></artwork>
</figure>
</section>
<section title="Example 2: Basic activity with some additional detail">
<t>
Expresses the statement "Martin Smith posted an article to
the blog 'Martin's Blog' at 3:04 PM GMT on February 2, 2011."
Some additional details about the article, actor and target
blog are given.</t>
<figure><artwork><![CDATA[
{
"verb": "post",
"published": "2011-02-10T15:04:55Z",
"language": "en",
"actor": {
"objectType": "person",
"id": "urn:example:person:martin",
"displayName": "Martin Smith",
"url": "http://example.org/martin",
"image": {
"url": "http://example.org/martin/image.jpg",
"mediaType": "image/jpeg",
"width": 250,
"height": 250
}
},
"object" : {
"objectType": "article",
"id": "urn:example:blog:abc123/xyz"
"url": "http://example.org/blog/2011/02/entry",
"displayName": "Why I love Activity Streams"
},
"target" : {
"objectType": "blog",
"id": "urn:example:blog:abc123",
"displayName": "Martin's Blog",
"url": "http://example.org/blog/"
}
}
]]></artwork></figure>
</section>
<section title="Example 3: An extended activity">
<t>
A more extensive, single-entry "Activity Stream"
follows. In addition to containing a number of required and optional
core properties, the example contains the additional, undefined extension
properties "foo" and "foo2" for illustrative purposes only.
</t>
<figure><artwork><![CDATA[
{
"totalItems": 1,
"items" : [
{
"verb": "post",
"language": "en",
"published": "2011-02-10T15:04:55Z",
"foo": "some extension property",
"generator": "http://example.org/activities-app",
"provider": "http://example.org/activity-stream",
"displayName": {
"en": "Martin posted a new video to his album.",
"ga": "Martin phost le físeán nua a albam."
},
"actor": {
"objectType": "person",
"id": "urn:example:person:martin",
"displayName": "Martin Smith",
"url": "http://example.org/martin",
"foo2": "some other extension property",
"image": {
"url": "http://example.org/martin/image",
"mediaType": "image/jpeg",
"width": 250,
"height": 250
}
},
"object" : {
"objectType": {
"id": "http://example.org/Photo",
"displayName": "Photo"
},
"id": "urn:example:album:abc123/my_fluffy_cat",
"url": "http://example.org/album/my_fluffy_cat.jpg",
"image": {
"url": "http://example.org/album/my_fluffy_cat_thumb.jpg",
"mediaType": "image/jpeg",
"width": 250,
"height": 250
}
},
"target": {
"objectType": {
"id": "http://example.org/PhotoAlbum",
"displayName": "Photo-Album"
},
"id": "urn:example.org:album:abc123",
"url": "http://example.org/album/",
"displayName": {
"en": "Martin's Photo Album",
"ga": "Grianghraif Máirtín"
},
"image": {
"url": "http://example.org/album/thumbnail.jpg",
"mediaType": "image/jpeg",
"width": 250,
"height": 250
}
}
}
]
}
]]></artwork></figure>
</section>
</section>
<section anchor="model" title="Object Model">
<section anchor="object" title="Object">
<t>
The following "core properties" apply to all JSON objects serialized
within an Activity Stream document.
</t>
<texttable>
<ttcol align="left" width="15%">Property</ttcol>
<ttcol align="left" width="21%">Value</ttcol>
<ttcol align="left">Description</ttcol>
<c>id</c>
<c>IRI</c>
<c>
Provides a permanent, universally unique identifier for the
object in the form of an absolute IRI <xref target="RFC3987"/>.
Objects SHOULD contain a single "id" property. If an object
does not contain an "id" property, consumers MAY use the value of
the "url" property as a less-reliable, non-unique identifier.
</c>
<c>objectType</c>
<c><xref target="type-value">Type value</xref></c>
<c>
Identifies the type of object. An object MAY contain a "objectType"
property whose value is a <xref target="type-value">Type value</xref>.
If no "objectType" property is specified, the object has no specific type.
</c>
<c>language</c>
<c><xref target="RFC5646"/> Language Tag</c>
<c>
Establishes the default language assumed for human-readable,
natural-language metadata values included in the object. An
object MAY contain a "language" property whose value MUST be a
<xref target="RFC5646"/> Language-Tag.
</c>
<c>displayName</c>
<c><xref target="lang">Natural Language value</xref></c>
<c>
A simple human-readable, plain-text name for the
object. HTML markup MUST NOT be included. An object MAY contain a
"displayName" property. If the object does not specify a "objectType"
property, the object SHOULD specify a "displayName".
</c>
<c>url</c>
<c>Link</c>
<c>
A <xref target="link">Link</xref> value describing a resource
that provides a representation of the object. An object
MAY contain a "url" property.
</c>
</texttable>
</section>
<section anchor="lang" title="Natural Language Values">
<t>
Natural Language values represent human-readable character
sequences in one or more languages. They are expressed as
either (1) a single JSON string or (2) a JSON dictionary
mapping <xref target="RFC5646" /> Language-Tags to localized,
equivalent translations of the same string value.
</t>
<t>
For instance, the "displayName" property in all objects is a
Natural Language value.
</t>
<figure>
<preamble>A single String value using the default language:</preamble>
<artwork>
{
"language": "en",
"displayName": "This is the title"
}
</artwork>
</figure>
<figure>
<preamble>Multiple, language-specific values:</preamble>
<artwork>
{
"displayName": {
"en": "This is the name",
"fr": "C'est le titre",
"sp": "Este es el título"
}
}
</artwork>
</figure>
<t>
Each key in the JSON dictionary MUST be an <xref target="RFC5646" />
Language Tag. The associated values MUST be Strings.
</t>
</section>
<section anchor="type-value" title="Type Values">
<t>
Type values represent references to or descriptions of an abstract
type. They are expressed as either: (1) a String conforming to
either the "isegment-nz-nc" or "IRI" productions in
<xref target="RFC3987"/> or (2) an <xref target="object">Object</xref>.
When represented as a String, the use of relative references other
than a simple name is not allowed. When represented as an Object,
the "id" property MUST be specified.
</t>
<t>
Within the Activity Streams 2.0, Type values are used only
by the "objectType" and "verb" properties.
</t>
<figure><preamble>Object type as a simple name (isegment-nz-nc):</preamble><artwork>
{
"objectType": "person",
"displayName": "John"
}
</artwork></figure>
<figure><preamble>Object type as an absolute IRI:</preamble><artwork>
{
"objectType": "http://example.org/Person",
"displayName": "John"
}
</artwork></figure>
<figure><preamble>Object type as an object:</preamble><artwork>
{
"objectType": {
"id": "http://example.org/Person",
"displayName": "Person"
},
"displayName": "John"
}
</artwork></figure>
<t>
Because the second and third examples above each specify
"http://example.org/Person", the two examples are considered
to specify the same type.
</t>
<figure><preamble>Verb as a simple name (isegment-nz-nc):</preamble><artwork>
{
"verb": "post",
"actor": "acct:[email protected]",
"object": "http://example.org/123"
}
</artwork></figure>
<figure><preamble>Verb as an absolute IRI:</preamble><artwork>
{
"verb": "http://example.com/Upload",
"actor": "acct:[email protected]",
"object": "http://example.org/123"
}
</artwork></figure>
<figure><preamble>Verb as an object:</preamble><artwork>
{
"verb": {
"id": "http://example.com/Upload",
"displayName": "Upload"
},
"actor": "acct:[email protected]",
"object": "http://example.org/123"
}
</artwork></figure>
<t>
Allowing verbs and object types to be represented as objects rather
than simple names or IRIs is intended to simplify the use of
extensions that an implementation might not have encountered
previously. The object properties provide additional information
and metadata about the new verb or object type.
</t>
<t>
It is important to note that because the "id" property is strictly
limited to absolute IRI values, the object representation cannot
be used to describe types with simple names.
</t>
</section>
<section anchor="link" title="Link Values">
<t>
Link values represent references to other objects and resources.
They are expressed as either: (1) a String containing an
absolute or relative IRI, (2) an <xref target="object">Object</xref>,
or (3) a JSON Array containing a mixture of IRIs or
<xref target="object">Objects</xref>. Link values are closely related
to the conceptual model of Links as established in
<xref target="RFC5988"/>.
</t>
<t>
For example, as defined previously, all
<xref target="object">objects</xref> can contain an
"image" property whose value describes a graphical
representation of the containing object. This property
will typically be used to provide the URL to a JPEG,
GIF or PNG type resource that can be displayed to
the user. Any given object might have multiple such visual
representations -- multiple screenshots, for instance, or
the same image at different resolutions. Using Link values,
there are essentially three ways of describing such
references.
</t>
<figure><preamble>To reference a single image without any
additional metadata, the link value can be expressed as
a simple JSON string containing an absolute or relative
IRI:</preamble><artwork>
{
"objectType": "application",
"id": "http://example.org/application/123",
"displayName": "My Application",
"image": "http://example.org/application/123.png"
}
</artwork></figure>
<figure><preamble>Alternatively, if additional metadata is required,
the link can be expressed as an object containing the url
property.</preamble>
<artwork>
{
"objectType": "application",
"id": "http://example.org/application/123",
"displayName": "My Application",
"image": {
"url": "http://example.org/application/123.png",
"mediaType": "image/png",
"height": 320,
"width": 320
}
}
</artwork>
</figure>
<figure><preamble>If more than one link value is to be expressed,
A JSON Array with a mix of string and object elements can be
used:</preamble><artwork>
{
"objectType": "application",
"id": "http://example.org/application/123",
"displayName": "My Application",
"image": [
"http://example.org/application/abc.gif",
{
"url": "http://example.org/application/123.png",
"mediaType": "image/png",
"height": 320,
"width": 320
}
]
}
</artwork></figure>
<t>
Individual items contained in such an array are independent
of the others and no significance is given to the ordering of
those items.
</t>
<t>
RFC 5988 defines that all Links have a "link relation"
that describes the contextual purpose of the link. Within
an <xref target="object">object</xref>, in the absence of a specific
"rel" property within the link object itself, the name of the
property whose value is a link serves as the "link relation".
Any valid link relation value, as defined by RFC 5988, can be used
as a property with a link value in any Activity Streams object, except
where the link relation might conflict with any other property
defined by this specification.
</t>
<figure><preamble>In the following example, two separate links are
provided. The link relation of the first is "image", while the
link relation of the second is "preview". Both links, however, can
be used as alternative visual representations of the
"application" object.</preamble><artwork><![CDATA[
{
"objectType": "application",
"image": [
"http://example.org/foo.jpg",
{
"url": "http://example.org/screens/1.jpg",
"rel": "preview",
"mediaType": "image/jpeg"
}
]
}
]]></artwork></figure>
<t>
When an <xref target="object">object</xref> is used to represent
a Link value, the following additional properties MAY be used:
</t>
<texttable>
<ttcol align="left" width="15%">Property</ttcol>
<ttcol align="left" width="21%">Value</ttcol>
<ttcol align="left">Description</ttcol>
<c>rel</c>
<c>RFC 5988 Link Relation</c>
<c>
The RFC 5988 Link Relation associated with this link value.
If absent, the name of the property is assumed to specify
the link relation.
</c>
<c>mediaType</c>
<c>MIME Media Type</c>
<c>
The MIME media type of the resource being referenced.
</c>
</texttable>
</section>
<section anchor="activity" title="Activity">
<t>
Activity objects are specializations of the base
<xref target="object">Object</xref> type that provide
metadata about potential or completed actions.
</t>
<t>
Within an Activity object, the "verb" property is used
to identify the type of activity. All existing verb definitions
used in JSON Activity Streams 1.0 implementations can continue
to be used and retain their existing semantics. If the "verb"
is not specified, the "objectType" property MAY be used as an
alternative means of determining the activity type.
</t>
<t>
Activity objects extend the core <xref target="object">object</xref>
definition with the following additional, optional properties:
</t>
<texttable>
<ttcol align="left" width="15%">Property</ttcol>
<ttcol align="left" width="21%">Value</ttcol>
<ttcol align="left">Description</ttcol>
<c>verb</c>
<c><xref target="type-value">Type value</xref></c>
<c>
Identifies the type of activity. An activity SHOULD contain a "verb"
property whose value is a <xref target="type-value">Type value</xref>.
If the "verb" property is not specified, the activity MUST contain a
"objectType" property.
</c>
<c>actor</c>
<c><xref target="link">Link</xref> value</c>
<c>
Describes one or more entities that either peformed or are
expected to perform the activity.
</c>
<c>object</c>
<c><xref target="link">Link</xref> value</c>
<c>
Describes the primary object of the activity. For instance,
in the activity, "John saved a movie to his wishlist", the object
of the activity is "movie". An activity SHOULD contain an
"object" property. If the "object" property is not contained, the
primary object of the activity MAY be implied by context.
</c>
<c>target</c>
<c><xref target="link">Link</xref> value</c>
<c>
Describes the target of the activity. The precise meaning of the
activity's target is dependent on the activities "verb",
but will often be the object the English preposition "to".
For instance, in the activity, "John saved a movie to his
wishlist", the target of the activity is "wishlist". The activity
target MUST NOT be used to identity an indirect object that is
not a target of the activity.
</c>
<c>result</c>
<c><xref target="link">Link</xref> value</c>
<c>
Describes the result of the activity. For instance, if a particular
action results in the creation of a new resource, the "result"
property can be used to describe that new resource.
</c>
<c>priority</c>
<c>Decimal Number between 0.00 and 1.00</c>
<c>
An indicator of the relative priority or importance that
the creator of an activity considers the it to
have. Represented as a numeric decimal between 0.00 and 1.00,
with two decimal places of precision. If the property is
omitted or set to null, the assumption is that a default priority
can be assumed. The value 0.00 represents the lowest possible
priority while 1.00 represents the highest.
</c>
</texttable>
<section title="Considerations on the use of "priority"">
<t>
The presence of the "priority" property does not impose any
specific processing or display requirements on the part of any
entity consuming the activity.
</t>
<t>
Expressing the value as a range of numeric decimal values is intended
to provide the greatest level of flexibility in the expression and
consumption of prioritization detail. It is expected that
implementors consuming activity objects containing "priority" will
utilize and expose the additional information in a number of
different ways depending on the unique requirements of each
application use case.
</t>
<t>
Many existing systems do not represent priority values as
numeric ranges. Such systems might use fixed, labeled brackets
such as "low", "normal" and "high" or "urgent". Similar mechanisms
can be established, by convention, when using the "priority"
property. In typical use, it is RECOMMENDED that implementations
wishing to work with such defined categories treat "priority"
property values in the range 0.00 to 0.25 as "low" priority; values
greater than 0.25 to 0.75 as "normal" priority; and values greater
than 0.75 to 1.00 as "high" priority. Specific implementations are
free to establish alternative conventions for the grouping of
priority values with the caveat that such conventions likely will
not be understood by all implementations.
</t>
</section>
<section anchor="audience-targeting" title="Audience Targeting Properties">
<t>
Every Activity has both a Primary and Secondary audience. The
Primary audience consists of those entities either directly
involved in the performance of the activity or who "own" the
objects involved. The Secondary audience consists of the
collection of entities sharing an interest in the activity but
who are not directly involved (e.g. "followers").
</t>
<t>
For instance, suppose a social network of three individuals:
Bob, Joe and Jane. Bob and Joe are each friends with Jane but
not friends with one another. Bob has chosen to "follow" activities
for which Jane is directly involved. Jane shares a file with Joe.
</t>
<t>
In this example, Jane and Joe are each directly involved in the
file sharing activity and together make up the Primary Audience
for that event. Bob, having an interest in activities involving
Jane, is the Secondary Audience. Knowing this, a system that
produces or consumes the activity can intelligently notify each
person of the event.
</t>
<t>
While there are means, based on the verb, actor, object and
target of the activity, to infer the primary audience for many
types of activities, those do not work in every case and do not
provide a means of identifying the secondary audience. The
"to", "cc", "bto" and "bcc" properties MAY be used within an
Activity to explicitly identify the Primary and Secondary
audiences.
</t>
<texttable>
<ttcol align="left" width="15%">Property</ttcol>
<ttcol align="left" width="21%">Value</ttcol>
<ttcol align="left">Description</ttcol>
<c>to</c>
<c><xref target="link">Link</xref> value</c>
<c>
Specifies the public primary audience.
</c>
<c>cc</c>
<c><xref target="link">Link</xref> value</c>
<c>
Specifies the public secondary audience.
</c>
<c>bto</c>
<c><xref target="link">Link</xref> value</c>
<c>
Specifies the private primary audience.
</c>
<c>bcc</c>
<c><xref target="link">Link</xref> value</c>
<c>
Specifies the private secondary audience.
</c>
</texttable>
<t>
The prototypical use case for an Activity containing these
properties is the publication and redistribution of Activities
through an intermediary. That is, an event source generates the
activity and publishes it to the intermediary which determines
a subset of events to display to specific individual users or
groups. Such a determination can be made, in part, by identifying
the Primary and Secondary Audiences for each activity.
</t>
<t>
When the event source generates the activity and specifies values
for the to and cc fields, the intermediary SHOULD redistribute
that event with the values of those fields intact, allowing any
processor to see who the activity has been targeted to. This is
precisely the same model used by the to and cc fields in email
systems.
</t>
<t>
There are situations, however, in which disclosing the identity
of specific members of the audience may be inappropriate. For
instance, a user may not wish to let other users know that they
are interested in various topics, individuals or types of events.
To support this option, an event source generating an activity
MAY use the "bto" and "bcc" properties to list entities to whom the
activity should be privately targeted. When an intermediary
receives an activity containing these properties, it MUST remove
those values prior to redistributing the activity. The intent is
that systems MUST consider entities listed within the "bto" and
"bcc" properties as part of the Primary and Second audience but
MUST NOT disclose that fact to any other party.
</t>
<t>
Audience targeting information included within an Activity only
describes the intent of the activity creator. With clear exception
given to the appropriate handling of "bto" and "bcc", this
specification leaves it up to implementations to determine how
the audience targeting information is used.
</t>
</section>
</section>
<section anchor="object-ext" title="Additional Object Properties">
<t>
The following "additional properties" MAY be used with any
JSON Object serialized within an Activity Stream document.
</t>
<texttable>
<ttcol align="left" width="15%">Property</ttcol>
<ttcol align="left" width="21%">Value</ttcol>
<ttcol align="left">Description</ttcol>
<c>alias</c>
<c>IRI</c>
<c>
Provides a contextually meaningful alternative label for the
object in addition to the "id". For instance, within some
systems, groups can be identified both by a unique global ID
and a more "human-friendly" label such as "@friends" or "@network".
The value of the "alias" property MUST match either the "isegment-nz-nc"
or the "IRI" production in <xref target="RFC3987"/>. The use of a
relative reference other than a simple name is not allowed.
</c>
<c>attachments</c>
<c><xref target="link">Link</xref> value</c>
<c>
A <xref target="link">Link</xref> value referencing one or more
objects associated with the containing object. These are similiar
in concept to files attached to an email message.
</c>
<c>author</c>
<c><xref target="link">Link</xref> value</c>
<c>
A <xref target="link">Link</xref> value referencing one or more
entity that created or authored the object.
</c>
<c>content</c>
<c><xref target="lang">Natural Language value</xref></c>
<c>
A Natural-language description of the object encoded as a single
JSON String containing HTML markup. Visual elements such as
thumbnail images MAY be included.
</c>
<c>duplicates</c>
<c><xref target="link">Link</xref> value</c>
<c>
A <xref target="link">Link</xref>value referencing one or more
objects that are semantically equivalent to this object or duplicate
this objects content. An object SHOULD contain a "duplicates"
property when there are known objects, possibly in a different
system, that are semantically equivalent or duplicate the content.
</c>