From 371100a64d49d83762e38861328af43cb8be3970 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Tue, 6 Jul 2010 18:01:57 -0700 Subject: [PATCH 01/58] first commit --- README | 1 + action.json | 39 ++++++++++++++++++++ activity.json | 55 ++++++++++++++++++++++++++++ object.json | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 README create mode 100644 action.json create mode 100644 activity.json create mode 100644 object.json diff --git a/README b/README new file mode 100644 index 0000000..eef6a23 --- /dev/null +++ b/README @@ -0,0 +1 @@ +http://json-schema.org/ diff --git a/action.json b/action.json new file mode 100644 index 0000000..3c9958b --- /dev/null +++ b/action.json @@ -0,0 +1,39 @@ +{ + "type" : "object", + "title" : "action", + "description" : "An action construct specifies who, did what. Ex: John liked. This is more of a gesture", + "note" : "Reducing the scope of the reaction construct to make it easier to use.", + "properties": { + "actor" : { + "type": "object", + "description": "Identifies the entity that performed the activity. Example: A person", + "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + }, + "verb" : { + "optional" : true, + "type" : "string", + "default": "post", + "description" :"Represents the type of action performed.", + "note" : "Should we only include a subset of verbs which demonstrate the impact on the reader ? \ + The verb post for example does not indicate how the reader perceived the content and is not significant\ + without an object", + "unconstrained":true, + "options" : [ + {'value':'favorite', 'name':'favorited'}, + {'value':'follow', 'name' : 'started following'}, + {'value':'like', 'name' : 'liked'}, + {'value':'post', 'name' : 'posted'}, + {'value':'make-friend', 'name' : 'is friends with'}, + {'value':'join', 'name' : 'joined'}, + {'value':'play', 'name' : 'played'}, + {'value':'tag', 'name' : 'tagged'}, + {'value':'update', 'name' : 'updated'}, + {'value':'save', 'name' : 'saved'}, + {'value':'share', 'name': 'shared'}, + {'value':'rsvp-yes', 'name' : 'will attend'}, + {'value':'rsvp-maybe', 'name' : 'may attend'}, + {'value':'rsvp-no', 'name' : 'will not attend'} + ] + } + } +} diff --git a/activity.json b/activity.json new file mode 100644 index 0000000..219a554 --- /dev/null +++ b/activity.json @@ -0,0 +1,55 @@ +{ + "type" : "object", + "title" : "activity", + "extends": {"$ref":"http://activitystrea.ms/schema/action"}, /*Actor and Verb are defined there*/ + "description" : "An activity construct specifies all the details about an event that occurred in the past. The current focus is on knowledge sharing and social broadcasting.", + "properties": { + "object" : { + "type": "object", + "description" : "Identifies the primary object of the activity. Example: A photo", + "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + }, + "target" : { + "type": "object", + "optional" : true, + "description" : "Represents the object to which the activity was performed. Example: A photo album", + "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + }, + "postedTime" : { + "type" : "string", + "description": "Time at which the activity occurred", + "format" : "date" + }, + "generator" : { + "type": "object", + "description": "Represents the application which created the activity, which may be separate from the service to which the activity is published. For example, a third-party application on a mobile phone may be used to post a photo to a photo sharing service.", + "optional" : true, + "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + }, + "provider" : { + "type": "object", + "description" : "Represents the service which is publishing the activity", + "optional" : true, + "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + }, + "title" : { + "type" : "string", + "description" : "An HTML representation of the natural language title for this activity. Consumers MAY use the value of this field, if set, as a fallback for when none of the provided verbs are recognized", + "format": "html", + "optional" : true + }, + "body" : { + "type" : "string", + "description" : "An HTML representation of a natural language describing this activity including visual elements such as thumbnails. Consumers MAY use the value of this field, if set, as a fallback for when none of the provided verbs are recognized", + "format" : "html", + "optional" : true + }, + "links" : { + "type" : "array", + "optional" : true, + "description" :"Links between an this object and other resources as defined in Web Linking", + "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema.properties", + "properties" : {"$ref" : "http://json-schema.org/links.properties"} + } + } +} diff --git a/object.json b/object.json new file mode 100644 index 0000000..e1b0d21 --- /dev/null +++ b/object.json @@ -0,0 +1,99 @@ +{ + "type" : "object", + "title" : "social object", + "description" : "", + "properties" : { + 'id' : { + "type" : "string" + }, + 'image' : { + "format":"image", + "type":"string", + "optional":true + }, + 'displayName' : { + "type":"string", + "optional":true + }, + 'summary' : { + "type" : "string", + "optional":true + }, + 'link' : { + "type" : "string", + "format" : "url", + "optional":true + }, + 'objectType' :{ + "type" : "string", + "description" : "The type of social object. See note below", + "optional" : true, + "unconstrained" : true, + "note" : "This is done completely wrong. We should just create different\ + types that extend social object so we can leverage the vanilla property\ + validation", + "options": [ + {"value": "article"}, + {"value": "audio"}, + {"value": "bookmark"}, + {"value": "comment"}, + {"value": "file"}, + {"value": "folder"}, + {"value": "group"}, + {"value": "list"}, + {"value": "note"}, + {"value": "person"}, + {"value": "photo"}, + {"value": "photo-album"}, + {"value": "place"}, + {"value": "playlist"}, + {"value": "product"}, + {"value": "review"}, + {"value": "service"}, + {"value": "status"}, + {"value": "video"}, + ] + }, + 'inReplyTo':{ + "optional" : true, + "description" : "The object that this object is in response to.", + "type": "object", + "properties" :{"$ref":"#.properties"} + }, + 'replies':{ + "optional" : true, + "type" : "array", + "items": { + "type" : "object", + "properties" :{"$ref":"#.properties"} + } + }, + 'reactions':{ + "optional" : true, + "type" : "array", + "items": { + "type" : "object", + "properties" :{ + + } + } + }, + 'attachedObjects':{ + "optional" : true, + "type" : "array", + "items": { + "type" : "object", + "properties" :{"$ref":"#.properties"} + } + }, + 'upstreamDuplicates':{"optional" : true, + "type" : "array", + "items": {"type" : "string"} + }, + 'downstreamDuplicates':{ + "optional" : true, + "type" : "array", + "items": {"type" : "string"} + } + } +} \ No newline at end of file From 1ed1903c337920e3b106cbd24c970d383ba3b307 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Tue, 6 Jul 2010 18:05:01 -0700 Subject: [PATCH 02/58] Fixed README --- README | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README b/README index eef6a23..a58bcd6 100644 --- a/README +++ b/README @@ -1 +1,9 @@ +This is a repository which contains json-schema documents which map to all the constructs in +http://activitystrea.ms/head/json-activity.html + +The syntax of the schema is defined at http://json-schema.org/ + +This is work in progress. I will also add a version using orderly +http://orderly-json.org/ + From e43f52732377da1a6afa364417b7c47a09afda09 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Tue, 6 Jul 2010 18:45:18 -0700 Subject: [PATCH 03/58] Changed schema location --- action.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/action.json b/action.json index 3c9958b..7ff665f 100644 --- a/action.json +++ b/action.json @@ -7,7 +7,7 @@ "actor" : { "type": "object", "description": "Identifies the entity that performed the activity. Example: A person", - "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "verb" : { "optional" : true, @@ -19,9 +19,12 @@ without an object", "unconstrained":true, "options" : [ - {'value':'favorite', 'name':'favorited'}, - {'value':'follow', 'name' : 'started following'}, - {'value':'like', 'name' : 'liked'}, + {'value':'favorite', + 'name':'favorited'}, + {'value':'follow', + 'name' : 'started following'}, + {'value':'like', + 'name' : 'liked'}, {'value':'post', 'name' : 'posted'}, {'value':'make-friend', 'name' : 'is friends with'}, {'value':'join', 'name' : 'joined'}, From 70e1f668bec3b2a93aa913465cd7769ce6cfa1b5 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 17:29:48 +0200 Subject: [PATCH 04/58] Added described by rel --- activity.json | 10 +++++----- object.json | 17 ++++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/activity.json b/activity.json index 219a554..728da0f 100644 --- a/activity.json +++ b/activity.json @@ -1,19 +1,19 @@ { "type" : "object", "title" : "activity", - "extends": {"$ref":"http://activitystrea.ms/schema/action"}, /*Actor and Verb are defined there*/ + "extends": {"$ref":"http://activitystrea.ms/json-schema/action"}, /*Actor and Verb are defined there*/ "description" : "An activity construct specifies all the details about an event that occurred in the past. The current focus is on knowledge sharing and social broadcasting.", "properties": { "object" : { "type": "object", "description" : "Identifies the primary object of the activity. Example: A photo", - "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "target" : { "type": "object", "optional" : true, "description" : "Represents the object to which the activity was performed. Example: A photo album", - "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "postedTime" : { "type" : "string", @@ -24,13 +24,13 @@ "type": "object", "description": "Represents the application which created the activity, which may be separate from the service to which the activity is published. For example, a third-party application on a mobile phone may be used to post a photo to a photo sharing service.", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "provider" : { "type": "object", "description" : "Represents the service which is publishing the activity", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "title" : { "type" : "string", diff --git a/object.json b/object.json index e1b0d21..b64ad18 100644 --- a/object.json +++ b/object.json @@ -1,7 +1,7 @@ { "type" : "object", "title" : "social object", - "description" : "", + "description" : "Generic object on the web", "properties" : { 'id' : { "type" : "string" @@ -26,12 +26,9 @@ }, 'objectType' :{ "type" : "string", - "description" : "The type of social object. See note below", + "description" : "The type of social object used to select schema", "optional" : true, "unconstrained" : true, - "note" : "This is done completely wrong. We should just create different\ - types that extend social object so we can leverage the vanilla property\ - validation", "options": [ {"value": "article"}, {"value": "audio"}, @@ -52,6 +49,8 @@ {"value": "service"}, {"value": "status"}, {"value": "video"}, + {"value": "event"}, + {"value": "song"} ] }, 'inReplyTo':{ @@ -74,7 +73,7 @@ "items": { "type" : "object", "properties" :{ - + "$ref":"http://activitystrea.ms/json-schema/action.properties" } } }, @@ -95,5 +94,9 @@ "type" : "array", "items": {"type" : "string"} } - } + }, + "links": [ + {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/{objectType}.json"} + ] + } \ No newline at end of file From 600d820161b82815f90c202bf286eb988a9917e0 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 17:33:05 +0200 Subject: [PATCH 05/58] Added person and event derived types --- action.json => action | 0 activity.json => activity | 0 event | 6 ++++++ object.json => object | 0 person | 6 ++++++ 5 files changed, 12 insertions(+) rename action.json => action (100%) rename activity.json => activity (100%) create mode 100644 event rename object.json => object (100%) create mode 100644 person diff --git a/action.json b/action similarity index 100% rename from action.json rename to action diff --git a/activity.json b/activity similarity index 100% rename from activity.json rename to activity diff --git a/event b/event new file mode 100644 index 0000000..eb39e48 --- /dev/null +++ b/event @@ -0,0 +1,6 @@ +{ + "type" : "object", + "title" : "event", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, + "properties" :{"$ref":"http://www.json-schema.org/calendar.properties"} +} diff --git a/object.json b/object similarity index 100% rename from object.json rename to object diff --git a/person b/person new file mode 100644 index 0000000..481aa11 --- /dev/null +++ b/person @@ -0,0 +1,6 @@ +{ + "type" : "object", + "title" : "person", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, + "properties" :{"$ref":"http://www.json-schema.org/card.properties"} +} From 7b2f0bac8913e9fdf030c065c56d3e7f32a6ec55 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 18:58:51 +0200 Subject: [PATCH 06/58] test for application/json response for person --- .htaccess | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..8576ed6 --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +RewriteEngine on +RewriteRule ^(*person)$ $1 [T=application/json] From bae6e92be96783d5cacee6416091afc5dd515c5a Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 19:00:18 +0200 Subject: [PATCH 07/58] test for application/json response for person --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 8576ed6..e06720e 100644 --- a/.htaccess +++ b/.htaccess @@ -1,2 +1,2 @@ RewriteEngine on -RewriteRule ^(*person)$ $1 [T=application/json] +RewriteRule ^(*person)$ $1 From 19775da35ded5293efabddd430f7143f0ddd37da Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 19:00:52 +0200 Subject: [PATCH 08/58] remove due 501 --- .htaccess | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index e06720e..8b13789 100644 --- a/.htaccess +++ b/.htaccess @@ -1,2 +1 @@ -RewriteEngine on -RewriteRule ^(*person)$ $1 + From a432f93a641831d617a23502053bd52abdf3499d Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 17 Jul 2010 19:01:15 +0200 Subject: [PATCH 09/58] remove due 501 --- .htaccess | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .htaccess diff --git a/.htaccess b/.htaccess deleted file mode 100644 index 8b13789..0000000 --- a/.htaccess +++ /dev/null @@ -1 +0,0 @@ - From 9511acb92af644f7bb417e64fb806747725c3870 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Wed, 21 Jul 2010 03:48:43 +0200 Subject: [PATCH 10/58] Updated JSON extension and references --- action => action.json | 0 activity => activity.json | 12 ++++++------ event => event.json | 3 ++- object => object.json | 8 ++++++-- person => person.json | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) rename action => action.json (100%) rename activity => activity.json (91%) rename event => event.json (53%) rename object => object.json (86%) rename person => person.json (50%) diff --git a/action b/action.json similarity index 100% rename from action rename to action.json diff --git a/activity b/activity.json similarity index 91% rename from activity rename to activity.json index 728da0f..3e863d6 100644 --- a/activity +++ b/activity.json @@ -7,13 +7,13 @@ "object" : { "type": "object", "description" : "Identifies the primary object of the activity. Example: A photo", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} }, "target" : { "type": "object", "optional" : true, "description" : "Represents the object to which the activity was performed. Example: A photo album", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} }, "postedTime" : { "type" : "string", @@ -24,13 +24,13 @@ "type": "object", "description": "Represents the application which created the activity, which may be separate from the service to which the activity is published. For example, a third-party application on a mobile phone may be used to post a photo to a photo sharing service.", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} }, "provider" : { "type": "object", "description" : "Represents the service which is publishing the activity", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} }, "title" : { "type" : "string", @@ -48,8 +48,8 @@ "type" : "array", "optional" : true, "description" :"Links between an this object and other resources as defined in Web Linking", - "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema.properties", - "properties" : {"$ref" : "http://json-schema.org/links.properties"} + "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema#properties", + "properties" : {"$ref" : "http://json-schema.org/links#properties"} } } } diff --git a/event b/event.json similarity index 53% rename from event rename to event.json index eb39e48..7d6f024 100644 --- a/event +++ b/event.json @@ -1,6 +1,7 @@ { "type" : "object", "title" : "event", + "description" : "xCal fromat for vevent", "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, - "properties" :{"$ref":"http://www.json-schema.org/calendar.properties"} + "properties" :{"$ref":"http://www.json-schema.org/calendar#properties"} } diff --git a/object b/object.json similarity index 86% rename from object rename to object.json index b64ad18..e5fecb7 100644 --- a/object +++ b/object.json @@ -9,6 +9,7 @@ 'image' : { "format":"image", "type":"string", + "description" : "A representative image.", "optional":true }, 'displayName' : { @@ -56,15 +57,18 @@ 'inReplyTo':{ "optional" : true, "description" : "The object that this object is in response to.", + "note" : "This should also support replying to activities", "type": "object", - "properties" :{"$ref":"#.properties"} + "properties" :{"$ref":"#properties"} }, 'replies':{ "optional" : true, "type" : "array", + "description": "", + "note" : "Changed it from object to activity so we have time and actor", "items": { "type" : "object", - "properties" :{"$ref":"#.properties"} + "properties" :{"$ref":"http://activitystrea.ms/json-schema/activity#properties"} } }, 'reactions':{ diff --git a/person b/person.json similarity index 50% rename from person rename to person.json index 481aa11..a6d7108 100644 --- a/person +++ b/person.json @@ -1,6 +1,7 @@ { "type" : "object", "title" : "person", + "description" : "vCard Format. Does not match PoCO", "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, - "properties" :{"$ref":"http://www.json-schema.org/card.properties"} + "properties" :{"$ref":"http://www.json-schema.org/card#properties"} } From 0309588aba86733f3ad3310ee4fe99ab0ad6d9d8 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 23 Jul 2010 09:00:16 -0700 Subject: [PATCH 11/58] Fixed references --- action.json | 31 +------------------------------ activity.json | 11 ++++++++++- object.json | 6 ++++-- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/action.json b/action.json index 7ff665f..c558f1d 100644 --- a/action.json +++ b/action.json @@ -7,36 +7,7 @@ "actor" : { "type": "object", "description": "Identifies the entity that performed the activity. Example: A person", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} - }, - "verb" : { - "optional" : true, - "type" : "string", - "default": "post", - "description" :"Represents the type of action performed.", - "note" : "Should we only include a subset of verbs which demonstrate the impact on the reader ? \ - The verb post for example does not indicate how the reader perceived the content and is not significant\ - without an object", - "unconstrained":true, - "options" : [ - {'value':'favorite', - 'name':'favorited'}, - {'value':'follow', - 'name' : 'started following'}, - {'value':'like', - 'name' : 'liked'}, - {'value':'post', 'name' : 'posted'}, - {'value':'make-friend', 'name' : 'is friends with'}, - {'value':'join', 'name' : 'joined'}, - {'value':'play', 'name' : 'played'}, - {'value':'tag', 'name' : 'tagged'}, - {'value':'update', 'name' : 'updated'}, - {'value':'save', 'name' : 'saved'}, - {'value':'share', 'name': 'shared'}, - {'value':'rsvp-yes', 'name' : 'will attend'}, - {'value':'rsvp-maybe', 'name' : 'may attend'}, - {'value':'rsvp-no', 'name' : 'will not attend'} - ] + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object#properties"} } } } diff --git a/activity.json b/activity.json index 3e863d6..98a4b59 100644 --- a/activity.json +++ b/activity.json @@ -1,9 +1,18 @@ { "type" : "object", "title" : "activity", - "extends": {"$ref":"http://activitystrea.ms/json-schema/action"}, /*Actor and Verb are defined there*/ "description" : "An activity construct specifies all the details about an event that occurred in the past. The current focus is on knowledge sharing and social broadcasting.", "properties": { + "actor" : { + "type": "object", + "description": "Identifies the entity that performed the activity. Example: A person", + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + }, + "verb" : { + "optional" : true, + "description" : "The type of action performed", + "type" : {"$ref" : "http://activitystrea.ms/json-schema/verb.json"} + }, "object" : { "type": "object", "description" : "Identifies the primary object of the activity. Example: A photo", diff --git a/object.json b/object.json index e5fecb7..782255e 100644 --- a/object.json +++ b/object.json @@ -64,20 +64,22 @@ 'replies':{ "optional" : true, "type" : "array", + "uniqueItems" : true, "description": "", "note" : "Changed it from object to activity so we have time and actor", "items": { "type" : "object", - "properties" :{"$ref":"http://activitystrea.ms/json-schema/activity#properties"} + "properties" :{"$ref":"http://activitystrea.ms/json-schema/feed.json#properties"} } }, 'reactions':{ "optional" : true, "type" : "array", + "uniqueItems" : true, "items": { "type" : "object", "properties" :{ - "$ref":"http://activitystrea.ms/json-schema/action.properties" + "$ref":"http://activitystrea.ms/json-schema/reactions.json#properties" } } }, From 21cb716b765cef9501886094652184b5c7e8143b Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 23 Jul 2010 09:00:30 -0700 Subject: [PATCH 12/58] Removed action --- action.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 action.json diff --git a/action.json b/action.json deleted file mode 100644 index c558f1d..0000000 --- a/action.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type" : "object", - "title" : "action", - "description" : "An action construct specifies who, did what. Ex: John liked. This is more of a gesture", - "note" : "Reducing the scope of the reaction construct to make it easier to use.", - "properties": { - "actor" : { - "type": "object", - "description": "Identifies the entity that performed the activity. Example: A person", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object#properties"} - } - } -} From 76e2e73e6741f8503d5714d78fb8d10df343e978 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 23 Jul 2010 11:34:17 -0700 Subject: [PATCH 13/58] Expanded the verbs and object types --- activity.json | 30 +++++++++++++---- event.json | 7 ---- feed.json | 33 +++++++++++++++++++ object.json | 64 +++++++++++++++++++----------------- objectTypes/article.json | 11 +++++++ objectTypes/audio.json | 11 +++++++ objectTypes/bookmark.json | 11 +++++++ objectTypes/comment.json | 11 +++++++ objectTypes/event.json | 13 ++++++++ objectTypes/file.json | 11 +++++++ objectTypes/folder.json | 11 +++++++ objectTypes/group.json | 11 +++++++ objectTypes/list.json | 11 +++++++ objectTypes/note.json | 11 +++++++ objectTypes/person.json | 13 ++++++++ objectTypes/photo-album.json | 11 +++++++ objectTypes/photo.json | 15 +++++++++ objectTypes/place.json | 11 +++++++ objectTypes/playlist.json | 11 +++++++ objectTypes/product.json | 11 +++++++ objectTypes/review.json | 11 +++++++ objectTypes/service.json | 11 +++++++ objectTypes/song.json | 11 +++++++ objectTypes/status.json | 11 +++++++ objectTypes/video.json | 11 +++++++ person.json | 7 ---- reactions.json | 49 +++++++++++++++++++++++++++ verbs/favorite.json | 16 +++++++++ verbs/follow.json | 16 +++++++++ verbs/join.json | 16 +++++++++ verbs/like.json | 16 +++++++++ verbs/make-friend.json | 16 +++++++++ verbs/play.json | 16 +++++++++ verbs/post.json | 16 +++++++++ verbs/rsvp-maybe.json | 16 +++++++++ verbs/rsvp-no.json | 16 +++++++++ verbs/rsvp-yes.json | 16 +++++++++ verbs/save.json | 16 +++++++++ verbs/share.json | 16 +++++++++ verbs/tag.json | 16 +++++++++ 40 files changed, 585 insertions(+), 52 deletions(-) delete mode 100644 event.json create mode 100644 feed.json create mode 100644 objectTypes/article.json create mode 100644 objectTypes/audio.json create mode 100644 objectTypes/bookmark.json create mode 100644 objectTypes/comment.json create mode 100644 objectTypes/event.json create mode 100644 objectTypes/file.json create mode 100644 objectTypes/folder.json create mode 100644 objectTypes/group.json create mode 100644 objectTypes/list.json create mode 100644 objectTypes/note.json create mode 100644 objectTypes/person.json create mode 100644 objectTypes/photo-album.json create mode 100644 objectTypes/photo.json create mode 100644 objectTypes/place.json create mode 100644 objectTypes/playlist.json create mode 100644 objectTypes/product.json create mode 100644 objectTypes/review.json create mode 100644 objectTypes/service.json create mode 100644 objectTypes/song.json create mode 100644 objectTypes/status.json create mode 100644 objectTypes/video.json delete mode 100644 person.json create mode 100644 reactions.json create mode 100644 verbs/favorite.json create mode 100644 verbs/follow.json create mode 100644 verbs/join.json create mode 100644 verbs/like.json create mode 100644 verbs/make-friend.json create mode 100644 verbs/play.json create mode 100644 verbs/post.json create mode 100644 verbs/rsvp-maybe.json create mode 100644 verbs/rsvp-no.json create mode 100644 verbs/rsvp-yes.json create mode 100644 verbs/save.json create mode 100644 verbs/share.json create mode 100644 verbs/tag.json diff --git a/activity.json b/activity.json index 98a4b59..6d8f585 100644 --- a/activity.json +++ b/activity.json @@ -1,17 +1,24 @@ { "type" : "object", "title" : "activity", - "description" : "An activity construct specifies all the details about an event that occurred in the past. The current focus is on knowledge sharing and social broadcasting.", + "description" : "An activity construct recounts what an actor did to an object in the past", "properties": { + "id" :{ + "type" : "string", + "description" : "Uniquely identifies each activity within the service", + "default" :"{link}" + }, "actor" : { "type": "object", - "description": "Identifies the entity that performed the activity. Example: A person", + "description": "Identifies the entity that performed the activity. Example: A person or user", "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} }, "verb" : { - "optional" : true, - "description" : "The type of action performed", - "type" : {"$ref" : "http://activitystrea.ms/json-schema/verb.json"} + "title" : "verb", + "type" : "string", + "default": "post", + "optional" : "true", + "description" :"Represents the type of action performed by the actor." }, "object" : { "type": "object", @@ -53,12 +60,21 @@ "format" : "html", "optional" : true }, + 'link' : { + "type" : "string", + "description" : "Permalink to the activity", + "format" : "url", + "optional":true + }, "links" : { "type" : "array", "optional" : true, - "description" :"Links between an this object and other resources as defined in Web Linking", + "description" :"Links between this object and other resources as defined in Web Linking", "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema#properties", "properties" : {"$ref" : "http://json-schema.org/links#properties"} } - } + }, + "links": [ + {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/verbs/{verb}.json"} + ] } diff --git a/event.json b/event.json deleted file mode 100644 index 7d6f024..0000000 --- a/event.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "object", - "title" : "event", - "description" : "xCal fromat for vevent", - "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, - "properties" :{"$ref":"http://www.json-schema.org/calendar#properties"} -} diff --git a/feed.json b/feed.json new file mode 100644 index 0000000..a17bc2d --- /dev/null +++ b/feed.json @@ -0,0 +1,33 @@ +{ + "type" : "object", + "title" : "feed", + "description" : "This is the top level container which is typically the response for the API call. \n\ + A feed contains an array of activities usually related to each other via a subject. Ex: Peter's Lifestream", + "properties" : { + "title" : { + "type" : "string", + "optional" : true, + "description": "Human readable name of the feed" + }, + "subject" : { + "type" : "object", + "description" : "The main object of the feed. All objects default to being inReplyTo this object.\n\ + If not present its the parent object", + "optional" : true, + "properties" :{"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + }, + "items" : { + "type" : "array", + "items": { + "type" : "object", + "properties" :{"$ref":"http://activitystrea.ms/json-schema/activity.json#properties"} + } + }, + "links" : { + "type" : "array", + "optional" : true, + "description" :"Links between an this object and other resources as defined in Web Linking", + "properties" : {"$ref" : "http://json-schema.org/links#properties"} + } + } +} \ No newline at end of file diff --git a/object.json b/object.json index 782255e..c6c7240 100644 --- a/object.json +++ b/object.json @@ -4,17 +4,21 @@ "description" : "Generic object on the web", "properties" : { 'id' : { - "type" : "string" + "type" : "string", + "description" : "Uniquely identifies the object on the service", + "default" : "{link}" }, 'image' : { "format":"image", "type":"string", - "description" : "A representative image.", + "description" : "A representative image of the object such as a profile \n\ + picture for a person", "optional":true }, 'displayName' : { "type":"string", - "optional":true + "description" : "The name of the object. Made required except for photos \n\ + which will have a default" }, 'summary' : { "type" : "string", @@ -23,36 +27,24 @@ 'link' : { "type" : "string", "format" : "url", + "description" : "Permalink to the object.", "optional":true }, 'objectType' :{ "type" : "string", "description" : "The type of social object used to select schema", + "optional" : true + }, + "author" : { + "type" : "object", "optional" : true, - "unconstrained" : true, - "options": [ - {"value": "article"}, - {"value": "audio"}, - {"value": "bookmark"}, - {"value": "comment"}, - {"value": "file"}, - {"value": "folder"}, - {"value": "group"}, - {"value": "list"}, - {"value": "note"}, - {"value": "person"}, - {"value": "photo"}, - {"value": "photo-album"}, - {"value": "place"}, - {"value": "playlist"}, - {"value": "product"}, - {"value": "review"}, - {"value": "service"}, - {"value": "status"}, - {"value": "video"}, - {"value": "event"}, - {"value": "song"} - ] + "description" : "Entity who posted this object", + "properties" : {"$ref":"#properties"} + }, + "postedTime" : { + "type" : "string", + "description": "Time at which the object was created. We should a last updated time.", + "format" : "date" }, 'inReplyTo':{ "optional" : true, @@ -65,8 +57,8 @@ "optional" : true, "type" : "array", "uniqueItems" : true, - "description": "", - "note" : "Changed it from object to activity so we have time and actor", + "description" : "An array of feeds. Each feed has an array of activities \n\ + which were done in response to this object", "items": { "type" : "object", "properties" :{"$ref":"http://activitystrea.ms/json-schema/feed.json#properties"} @@ -74,6 +66,8 @@ }, 'reactions':{ "optional" : true, + "description" : "An array of reactions. A reactions object is itself an \n\ + array of people who all had the same reaction", "type" : "array", "uniqueItems" : true, "items": { @@ -85,24 +79,32 @@ }, 'attachedObjects':{ "optional" : true, + "title" : "Related objects", + "description" : "An array of objects which are related to this object...\n\ + Generally photos for an article. This needs more clarification", "type" : "array", "items": { "type" : "object", "properties" :{"$ref":"#.properties"} } }, - 'upstreamDuplicates':{"optional" : true, + 'upstreamDuplicates':{ + "optional" : true, "type" : "array", + "description" : "When a publisher changes the id they can put the original \n\ + id of the object in this field so consumers can de-duplicate", "items": {"type" : "string"} }, 'downstreamDuplicates':{ "optional" : true, "type" : "array", + "description" : "When a publisher creates a clone object in another system they can put that id\n\ + here in order to let the consumer know how to de-duplicate", "items": {"type" : "string"} } }, "links": [ - {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/{objectType}.json"} + {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/objectType/{objectType}.json"} ] } \ No newline at end of file diff --git a/objectTypes/article.json b/objectTypes/article.json new file mode 100644 index 0000000..64f8912 --- /dev/null +++ b/objectTypes/article.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "article", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "article" + } + } +} diff --git a/objectTypes/audio.json b/objectTypes/audio.json new file mode 100644 index 0000000..c773cc3 --- /dev/null +++ b/objectTypes/audio.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "audio", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "audio" + } + } +} \ No newline at end of file diff --git a/objectTypes/bookmark.json b/objectTypes/bookmark.json new file mode 100644 index 0000000..59f6a4d --- /dev/null +++ b/objectTypes/bookmark.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "bookmark", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "bookmark" + } + } +} \ No newline at end of file diff --git a/objectTypes/comment.json b/objectTypes/comment.json new file mode 100644 index 0000000..8adc41f --- /dev/null +++ b/objectTypes/comment.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "comment", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "comment" + } + } +} \ No newline at end of file diff --git a/objectTypes/event.json b/objectTypes/event.json new file mode 100644 index 0000000..a0cb7d5 --- /dev/null +++ b/objectTypes/event.json @@ -0,0 +1,13 @@ +{ + "type" : "object", + "title" : "event", + "description" : "xCal fromat for vevent", + "extends": [{"$ref":"http://activitystrea.ms/json-schema/object.json"}, + {"$ref":"http://www.json-schema.org/calendar"}], + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "event" + } + } +} diff --git a/objectTypes/file.json b/objectTypes/file.json new file mode 100644 index 0000000..1c15e1d --- /dev/null +++ b/objectTypes/file.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "file", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "file" + } + } +} \ No newline at end of file diff --git a/objectTypes/folder.json b/objectTypes/folder.json new file mode 100644 index 0000000..0bd3ce6 --- /dev/null +++ b/objectTypes/folder.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "folder", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "folder" + } + } +} \ No newline at end of file diff --git a/objectTypes/group.json b/objectTypes/group.json new file mode 100644 index 0000000..b47d5e9 --- /dev/null +++ b/objectTypes/group.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "group", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "group" + } + } +} \ No newline at end of file diff --git a/objectTypes/list.json b/objectTypes/list.json new file mode 100644 index 0000000..d95f2a0 --- /dev/null +++ b/objectTypes/list.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "list", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "list" + } + } +} diff --git a/objectTypes/note.json b/objectTypes/note.json new file mode 100644 index 0000000..8ecb91c --- /dev/null +++ b/objectTypes/note.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "note", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "note" + } + } +} diff --git a/objectTypes/person.json b/objectTypes/person.json new file mode 100644 index 0000000..7ffabff --- /dev/null +++ b/objectTypes/person.json @@ -0,0 +1,13 @@ +{ + "type" : "object", + "title" : "person", + "description" : "vCard Format. Does not match PoCO", + "extends": [{"$ref":"http://activitystrea.ms/json-schema/object.json"}, + {"$ref":"http://www.json-schema.org/card"}], + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "person" + } + } +} diff --git a/objectTypes/photo-album.json b/objectTypes/photo-album.json new file mode 100644 index 0000000..76c7110 --- /dev/null +++ b/objectTypes/photo-album.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "article", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/list.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "photo-album" + } + } +} \ No newline at end of file diff --git a/objectTypes/photo.json b/objectTypes/photo.json new file mode 100644 index 0000000..f7fd732 --- /dev/null +++ b/objectTypes/photo.json @@ -0,0 +1,15 @@ +{ + "type" : "object", + "title" : "photo", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/file.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "photo" + }, + "displayName" : { + "type" : "string", + "default" : "a photo" + } + } +} diff --git a/objectTypes/place.json b/objectTypes/place.json new file mode 100644 index 0000000..7f20aea --- /dev/null +++ b/objectTypes/place.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "place", + "extends": [{"$ref":"http://activitystrea.ms/json-schema/object.json"},{"$ref":"http://www.json-schema.org/address"}], + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "photo" + } + } +} \ No newline at end of file diff --git a/objectTypes/playlist.json b/objectTypes/playlist.json new file mode 100644 index 0000000..9f88983 --- /dev/null +++ b/objectTypes/playlist.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "playlist", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/list.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "playlist" + } + } +} \ No newline at end of file diff --git a/objectTypes/product.json b/objectTypes/product.json new file mode 100644 index 0000000..c7ad707 --- /dev/null +++ b/objectTypes/product.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "product", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "product" + } + } +} \ No newline at end of file diff --git a/objectTypes/review.json b/objectTypes/review.json new file mode 100644 index 0000000..18945da --- /dev/null +++ b/objectTypes/review.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "review", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/article.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "review" + } + } +} \ No newline at end of file diff --git a/objectTypes/service.json b/objectTypes/service.json new file mode 100644 index 0000000..cce3bda --- /dev/null +++ b/objectTypes/service.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "service", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "service" + } + } +} \ No newline at end of file diff --git a/objectTypes/song.json b/objectTypes/song.json new file mode 100644 index 0000000..843fbbd --- /dev/null +++ b/objectTypes/song.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "song", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/audio.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "song" + } + } +} diff --git a/objectTypes/status.json b/objectTypes/status.json new file mode 100644 index 0000000..5074d35 --- /dev/null +++ b/objectTypes/status.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "status", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/note.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "song" + } + } +} \ No newline at end of file diff --git a/objectTypes/video.json b/objectTypes/video.json new file mode 100644 index 0000000..d827a4f --- /dev/null +++ b/objectTypes/video.json @@ -0,0 +1,11 @@ +{ + "type" : "object", + "title" : "video", + "extends": {"$ref":"http://activitystrea.ms/json-schema/objectTypes/file.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "video" + } + } +} diff --git a/person.json b/person.json deleted file mode 100644 index a6d7108..0000000 --- a/person.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "object", - "title" : "person", - "description" : "vCard Format. Does not match PoCO", - "extends": {"$ref":"http://activitystrea.ms/json-schema/object"}, - "properties" :{"$ref":"http://www.json-schema.org/card#properties"} -} diff --git a/reactions.json b/reactions.json new file mode 100644 index 0000000..0dbcea8 --- /dev/null +++ b/reactions.json @@ -0,0 +1,49 @@ +{ + "type" : "object", + "description" : "This type represents a list of people who had the same reaction represented by the verb to the same object", + "properties" : { + "inReplyTo" : { + "optional" : true, + "type" : [ + {"$ref" : "http://activitystrea.ms/json-schema/object.json"}, + {"$ref" : "http://activitystrea.ms/json-schema/activity.json"} + ] + }, + "verb" : { + "type" : "string" + }, + "count" : { + "type" : "number", + "description" : "The total number of people who had the reaction" + }, + "items" : { + "type" : "array", + "uniqueItems" : true, + "description" : "An array of unique people who had the same reaction to the same object. May be a subset", + "items" : { + "type" : "object", + "properties" :{"$ref":"http://activitystrea.ms/json-schema/person.json#properties"} + } + }, + "example" : { + "inReplyTo" : { + "objectType" : "photo", + "link" : "http://www.facebook.com/photo.php?pid=6139638&id=608201527" + }, + "verb" : "like", + "count" : 2, + "items" : [ + { + "displayName" : "Monica", + "objectType" : "person", + "link" : "http://www.facebook.com/ciberch" + }, + { + "displayName" : "Nick", + "objectType" : "person", + "link" : "http://www.facebook.com/nicolasbertrand" + } + ] + } + } +} \ No newline at end of file diff --git a/verbs/favorite.json b/verbs/favorite.json new file mode 100644 index 0000000..8f0e44d --- /dev/null +++ b/verbs/favorite.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Favorite", + "description" : "To mark an object as a favorite", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "favorite" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} marked {object.displayName} as a favorite" + } + } +} diff --git a/verbs/follow.json b/verbs/follow.json new file mode 100644 index 0000000..9293fc7 --- /dev/null +++ b/verbs/follow.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Follow", + "description" : "To start following an object", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "follow" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} started following {object.displayName}" + } + } +} diff --git a/verbs/join.json b/verbs/join.json new file mode 100644 index 0000000..04e7fe3 --- /dev/null +++ b/verbs/join.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Join", + "description" : "To join an object. Usually a group", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "join" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} joined {object.displayName}" + } + } +} diff --git a/verbs/like.json b/verbs/like.json new file mode 100644 index 0000000..30a921a --- /dev/null +++ b/verbs/like.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Like", + "description" : "To like an object", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "like" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} likes {object.displayName}" + } + } +} diff --git a/verbs/make-friend.json b/verbs/make-friend.json new file mode 100644 index 0000000..748a7bc --- /dev/null +++ b/verbs/make-friend.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Befriend", + "description" : "To friend an object. Usually a person", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "make-friend" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} is now friends with {object.displayName}" + } + } +} diff --git a/verbs/play.json b/verbs/play.json new file mode 100644 index 0000000..50dcf90 --- /dev/null +++ b/verbs/play.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Play", + "description" : "To play an object", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "play" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} played {object.displayName}" + } + } +} diff --git a/verbs/post.json b/verbs/post.json new file mode 100644 index 0000000..921d865 --- /dev/null +++ b/verbs/post.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Post", + "description" : "To publish an object", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "post" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} posted {object.displayName}" + } + } +} diff --git a/verbs/rsvp-maybe.json b/verbs/rsvp-maybe.json new file mode 100644 index 0000000..d6e77db --- /dev/null +++ b/verbs/rsvp-maybe.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Rsvp Maybe", + "description" : "To indicate that the actor may attend an event", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "rsvp-maybe" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} may be attending {object.displayName}" + } + } +} diff --git a/verbs/rsvp-no.json b/verbs/rsvp-no.json new file mode 100644 index 0000000..453aa57 --- /dev/null +++ b/verbs/rsvp-no.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Rsvp No", + "description" : "To indicate that the actor will not attend an event", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "rsvp-no" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} will not attend {object.displayName}" + } + } +} diff --git a/verbs/rsvp-yes.json b/verbs/rsvp-yes.json new file mode 100644 index 0000000..73bfb38 --- /dev/null +++ b/verbs/rsvp-yes.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Rsvp Yes", + "description" : "To indicate that the actor will attend an event", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "rsvp-yes" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} is attending {object.displayName}" + } + } +} diff --git a/verbs/save.json b/verbs/save.json new file mode 100644 index 0000000..6917c14 --- /dev/null +++ b/verbs/save.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Save", + "description" : "To save an object", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "save" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} saved {object.displayName}" + } + } +} diff --git a/verbs/share.json b/verbs/share.json new file mode 100644 index 0000000..934fd3a --- /dev/null +++ b/verbs/share.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Share", + "description" : "To share an object.", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "share" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} shared {object.displayName}" + } + } +} diff --git a/verbs/tag.json b/verbs/tag.json new file mode 100644 index 0000000..5d9a6b3 --- /dev/null +++ b/verbs/tag.json @@ -0,0 +1,16 @@ +{ + "type" : "object", + "title" : "Tag", + "description" : "To tag an object. Ex: A person being tagged in a photo", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "tag" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} tagged {object.displayName} in {target.displayName}" + } + } +} From d8983f23c5e7bba850e2699ea6ab3e840e510227 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 23 Jul 2010 12:38:45 -0700 Subject: [PATCH 14/58] Adding base library --- library/jsonschema-b4.js | 217 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 library/jsonschema-b4.js diff --git a/library/jsonschema-b4.js b/library/jsonschema-b4.js new file mode 100644 index 0000000..ac2f471 --- /dev/null +++ b/library/jsonschema-b4.js @@ -0,0 +1,217 @@ +/** + * JSONSchema Validator - Validates JavaScript objects using JSON Schemas + * (http://www.json.com/json-schema-proposal/) + * + * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) + * Licensed under the MIT (MIT-LICENSE.txt) license. +To use the validator call JSONSchema.validate with an instance object and an optional schema object. +If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), +that schema will be used to validate and the schema parameter is not necessary (if both exist, +both validations will occur). +The validate method will return an array of validation errors. If there are no errors, then an +empty list will be returned. A validation error will have two properties: +"property" which indicates which property had the error +"message" which indicates what the error was + */ + +JSONSchema = { + validate : function(/*Any*/instance,/*Object*/schema) { + // Summary: + // To use the validator call JSONSchema.validate with an instance object and an optional schema object. + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). + // The validate method will return an object with two properties: + // valid: A boolean indicating if the instance is valid by the schema + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: + // property: which indicates which property had the error + // message: which indicates what the error was + // + return this._validate(instance,schema,false); + }, + checkPropertyChange : function(/*Any*/value,/*Object*/schema, /*String*/ property) { + // Summary: + // The checkPropertyChange method will check to see if an value can legally be in property with the given schema + // This is slightly different than the validate method in that it will fail if the schema is readonly and it will + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // information. + // + return this._validate(value,schema, property || "property"); + }, + _validate : function(/*Any*/instance,/*Object*/schema,/*Boolean*/ _changing) { + + var errors = []; + // validate a value against a property definition + function checkProp(value, schema, path,i){ + var l; + path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; + function addError(message){ + errors.push({property:path,message:message}); + } + + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function')){ + if(typeof schema == 'function'){ + if(!(value instanceof schema)){ + addError("is not an instance of the class/constructor " + schema.name); + } + }else if(schema){ + addError("Invalid schema/property definition " + schema); + } + return null; + } + if(_changing && schema.readonly){ + addError("is a readonly field, it can not be changed"); + } + if(schema['extends']){ // if it extends another schema, it must pass that schema as well + checkProp(value,schema['extends'],path,i); + } + // validate a value against a type definition + function checkType(type,value){ + if(type){ + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && + !(value instanceof Array && type == 'array') && + !(type == 'integer' && value%1===0)){ + return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; + } + if(type instanceof Array){ + var unionErrors=[]; + for(var j = 0; j < type.length; j++){ // a union type + if(!(unionErrors=checkType(type[j],value)).length){ + break; + } + } + if(unionErrors.length){ + return unionErrors; + } + }else if(typeof type == 'object'){ + var priorErrors = errors; + errors = []; + checkProp(value,type,path); + var theseErrors = errors; + errors = priorErrors; + return theseErrors; + } + } + return []; + } + if(value === undefined){ + if(!schema.optional){ + addError("is missing and it is not optional"); + } + }else{ + errors = errors.concat(checkType(schema.type,value)); + if(schema.disallow && !checkType(schema.disallow,value).length){ + addError(" disallowed value was matched"); + } + if(value !== null){ + if(value instanceof Array){ + if(schema.items){ + if(schema.items instanceof Array){ + for(i=0,l=value.length; i schema.maxItems){ + addError("There must be a maximum of " + schema.maxItems + " in the array"); + } + }else if(schema.properties){ + errors.concat(checkObj(value,schema.properties,path,schema.additionalProperties)); + } + if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ + addError("does not match the regex pattern " + schema.pattern); + } + if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ + addError("may only be " + schema.maxLength + " characters long"); + } + if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ + addError("must be at least " + schema.minLength + " characters long"); + } + if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum && + schema.minimum > value){ + addError("must have a minimum value of " + schema.minimum); + } + if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && + schema.maximum < value){ + addError("must have a maximum value of " + schema.maximum); + } + if(schema['enum']){ + var enumer = schema['enum']; + l = enumer.length; + var found; + for(var j = 0; j < l; j++){ + if(enumer[j]===value){ + found=1; + break; + } + } + if(!found){ + addError("does not have a value in the enumeration " + enumer.join(", ")); + } + } + if(typeof schema.maxDecimal == 'number' && + (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ + addError("may only have " + schema.maxDecimal + " digits of decimal places"); + } + } + } + return null; + } + // validate an object against a schema + function checkObj(instance,objTypeDef,path,additionalProp){ + + if(typeof objTypeDef =='object'){ + if(typeof instance != 'object' || instance instanceof Array){ + errors.push({property:path,message:"an object is required"}); + } + + for(var i in objTypeDef){ + if(objTypeDef.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_')){ + var value = instance[i]; + var propDef = objTypeDef[i]; + checkProp(value,propDef,path,i); + } + } + } + for(i in instance){ + if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ + errors.push({property:path,message:(typeof value) + "The property " + i + + " is not defined in the schema and the schema does not allow additional properties"}); + } + var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; + if(requires && !(requires in instance)){ + errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); + } + value = instance[i]; + if(objTypeDef && typeof objTypeDef == 'object' && !(i in objTypeDef)){ + checkProp(value,additionalProp,path,i); + } + if(!_changing && value && value.$schema){ + errors = errors.concat(checkProp(value,value.$schema,path,i)); + } + } + return errors; + } + if(schema){ + checkProp(instance,schema,'',_changing || ''); + } + if(!_changing && instance && instance.$schema){ + checkProp(instance,instance.$schema,'',''); + } + return {valid:!errors.length,errors:errors}; + }, + /* will add this later + newFromSchema : function() { + } +*/ +} From f33b319dab6f40e87d2615cd1cba1e337d854830 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 23 Jul 2010 13:08:18 -0700 Subject: [PATCH 15/58] Added default and removed code which caused errors --- library/jsonschema-b4.js | 75 ++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/library/jsonschema-b4.js b/library/jsonschema-b4.js index ac2f471..fc33640 100644 --- a/library/jsonschema-b4.js +++ b/library/jsonschema-b4.js @@ -1,15 +1,17 @@ -/** - * JSONSchema Validator - Validates JavaScript objects using JSON Schemas +/** + * JSONSchema Validator - Validates JavaScript objects using JSON Schemas * (http://www.json.com/json-schema-proposal/) * * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) + * Updated by: Monica Wilkinson on 07/23/2010 + * * Licensed under the MIT (MIT-LICENSE.txt) license. To use the validator call JSONSchema.validate with an instance object and an optional schema object. -If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), -that schema will be used to validate and the schema parameter is not necessary (if both exist, -both validations will occur). -The validate method will return an array of validation errors. If there are no errors, then an -empty list will be returned. A validation error will have two properties: +If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), +that schema will be used to validate and the schema parameter is not necessary (if both exist, +both validations will occur). +The validate method will return an array of validation errors. If there are no errors, then an +empty list will be returned. A validation error will have two properties: "property" which indicates which property had the error "message" which indicates what the error was */ @@ -18,13 +20,13 @@ JSONSchema = { validate : function(/*Any*/instance,/*Object*/schema) { // Summary: // To use the validator call JSONSchema.validate with an instance object and an optional schema object. - // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), - // that schema will be used to validate and the schema parameter is not necessary (if both exist, - // both validations will occur). + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). // The validate method will return an object with two properties: // valid: A boolean indicating if the instance is valid by the schema - // errors: An array of validation errors. If there are no errors, then an - // empty list will be returned. A validation error will have two properties: + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: // property: which indicates which property had the error // message: which indicates what the error was // @@ -34,14 +36,14 @@ JSONSchema = { // Summary: // The checkPropertyChange method will check to see if an value can legally be in property with the given schema // This is slightly different than the validate method in that it will fail if the schema is readonly and it will - // not check for self-validation, it is assumed that the passed in value is already internally valid. - // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for // information. // return this._validate(value,schema, property || "property"); }, _validate : function(/*Any*/instance,/*Object*/schema,/*Boolean*/ _changing) { - + var errors = []; // validate a value against a property definition function checkProp(value, schema, path,i){ @@ -50,7 +52,7 @@ JSONSchema = { function addError(message){ errors.push({property:path,message:message}); } - + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function')){ if(typeof schema == 'function'){ if(!(value instanceof schema)){ @@ -70,15 +72,15 @@ JSONSchema = { // validate a value against a type definition function checkType(type,value){ if(type){ - if(typeof type == 'string' && type != 'any' && - (type == 'null' ? value !== null : typeof value != type) && + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && !(value instanceof Array && type == 'array') && !(type == 'integer' && value%1===0)){ return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; } if(type instanceof Array){ var unionErrors=[]; - for(var j = 0; j < type.length; j++){ // a union type + for(var j = 0; j < type.length; j++){ // a union type if(!(unionErrors=checkType(type[j],value)).length){ break; } @@ -88,17 +90,21 @@ JSONSchema = { } }else if(typeof type == 'object'){ var priorErrors = errors; - errors = []; + errors = []; checkProp(value,type,path); var theseErrors = errors; errors = priorErrors; - return theseErrors; - } + return theseErrors; + } } return []; } + // Monica: Added code to check the default + if(value === undefined){ + value = schema["default"]; + } if(value === undefined){ - if(!schema.optional){ + if(!schema.optional){ addError("is missing and it is not optional"); } }else{ @@ -117,7 +123,7 @@ JSONSchema = { for(i=0,l=value.length; i value){ addError("must have a minimum value of " + schema.minimum); } - if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && + if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && schema.maximum < value){ addError("must have a maximum value of " + schema.maximum); } @@ -159,7 +165,7 @@ JSONSchema = { addError("does not have a value in the enumeration " + enumer.join(", ")); } } - if(typeof schema.maxDecimal == 'number' && + if(typeof schema.maxDecimal == 'number' && (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ addError("may only have " + schema.maxDecimal + " digits of decimal places"); } @@ -169,13 +175,14 @@ JSONSchema = { } // validate an object against a schema function checkObj(instance,objTypeDef,path,additionalProp){ - + if(typeof objTypeDef =='object'){ if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } - - for(var i in objTypeDef){ + + // check all the properties are present as required in the schema + for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_')){ var value = instance[i]; var propDef = objTypeDef[i]; @@ -183,6 +190,8 @@ JSONSchema = { } } } + + // check the properties of the instance for(i in instance){ if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ errors.push({property:path,message:(typeof value) + "The property " + i + @@ -193,9 +202,7 @@ JSONSchema = { errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); } value = instance[i]; - if(objTypeDef && typeof objTypeDef == 'object' && !(i in objTypeDef)){ - checkProp(value,additionalProp,path,i); - } + if(!_changing && value && value.$schema){ errors = errors.concat(checkProp(value,value.$schema,path,i)); } @@ -209,7 +216,7 @@ JSONSchema = { checkProp(instance,instance.$schema,'',''); } return {valid:!errors.length,errors:errors}; - }, + } /* will add this later newFromSchema : function() { } From a6d5234841406ad138fdb5137fd6d73b77eac0c8 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Mon, 26 Jul 2010 00:58:17 -0700 Subject: [PATCH 16/58] Made references relative to avoid cross domain scripting --- activity.json | 14 +- core_object.json | 53 ++++++ feed.json | 10 +- library/jsonschema-b4.js | 1 + library/ref.js | 349 +++++++++++++++++++++++++++++++++++++++ library/schema.js | 218 ++++++++++++++++++++++++ object.json | 79 ++------- reactions.json | 6 +- 8 files changed, 651 insertions(+), 79 deletions(-) create mode 100644 core_object.json create mode 100644 library/ref.js create mode 100644 library/schema.js diff --git a/activity.json b/activity.json index 6d8f585..d889049 100644 --- a/activity.json +++ b/activity.json @@ -11,7 +11,7 @@ "actor" : { "type": "object", "description": "Identifies the entity that performed the activity. Example: A person or user", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.properties"} + "properties" : {"$ref":"./object.json#properties"} }, "verb" : { "title" : "verb", @@ -23,13 +23,13 @@ "object" : { "type": "object", "description" : "Identifies the primary object of the activity. Example: A photo", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + "properties" : {"$ref":"./object.json#properties"} }, "target" : { "type": "object", "optional" : true, "description" : "Represents the object to which the activity was performed. Example: A photo album", - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + "properties" : {"$ref":"./object.json#properties"} }, "postedTime" : { "type" : "string", @@ -40,13 +40,13 @@ "type": "object", "description": "Represents the application which created the activity, which may be separate from the service to which the activity is published. For example, a third-party application on a mobile phone may be used to post a photo to a photo sharing service.", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + "properties" : {"$ref":"./object.json#properties"} }, "provider" : { "type": "object", "description" : "Represents the service which is publishing the activity", "optional" : true, - "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + "properties" : {"$ref":"./object.json#properties"} }, "title" : { "type" : "string", @@ -60,7 +60,7 @@ "format" : "html", "optional" : true }, - 'link' : { + "link" : { "type" : "string", "description" : "Permalink to the activity", "format" : "url", @@ -75,6 +75,6 @@ } }, "links": [ - {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/verbs/{verb}.json"} + {"rel": "describedby", "href": "./verbs/{verb}.json"} ] } diff --git a/core_object.json b/core_object.json new file mode 100644 index 0000000..ea73b89 --- /dev/null +++ b/core_object.json @@ -0,0 +1,53 @@ +{ + "type" : "object", + "title" : "core_object", + "description" : "Basic object on the web", + "properties" : { + "id" : { + "type" : "string", + "description" : "Uniquely identifies the object on the service", + "default" : "{link}" + }, + "image" : { + "format":"image", + "type":"string", + "description" : "A representative image of the object such as a profile picture for a person", + "optional":true + }, + "displayName" : { + "type":"string", + "description" : "The name of the object. Made required except for photos which will have a default" + }, + "summary" : { + "type" : "string", + "optional":true + }, + "link" : { + "type" : "string", + "format" : "url", + "description" : "Permalink to the object.", + "optional":true + }, + "objectType" :{ + "type" : "string", + "description" : "The type of social object used to select schema", + "optional" : true + }, + "author" : { + "type" : "object", + "optional" : true, + "description" : "Entity who posted this object", + "properties" : {"$ref":"#properties"} + }, + "postedTime" : { + "optional" : true, + "type" : "string", + "description": "Time at which the object was created. We should a last updated time.", + "format" : "date" + } + }, + "additionalProperties" : true, + "links": [ + {"rel": "describedby", "href": "./objectType/{objectType}.json"} + ] +} \ No newline at end of file diff --git a/feed.json b/feed.json index a17bc2d..6f7c2a6 100644 --- a/feed.json +++ b/feed.json @@ -1,8 +1,7 @@ { "type" : "object", "title" : "feed", - "description" : "This is the top level container which is typically the response for the API call. \n\ - A feed contains an array of activities usually related to each other via a subject. Ex: Peter's Lifestream", + "description" : "This is the top level container which is typically the response for the API call. A feed contains an array of activities usually related to each other via a subject. Ex: Peter's Lifestream", "properties" : { "title" : { "type" : "string", @@ -11,16 +10,15 @@ }, "subject" : { "type" : "object", - "description" : "The main object of the feed. All objects default to being inReplyTo this object.\n\ - If not present its the parent object", + "description" : "The main object of the feed. All objects default to being inReplyTo this object. If not present its the parent object", "optional" : true, - "properties" :{"$ref":"http://activitystrea.ms/json-schema/object.json#properties"} + "properties" :{"$ref":"./object.json#properties"} }, "items" : { "type" : "array", "items": { "type" : "object", - "properties" :{"$ref":"http://activitystrea.ms/json-schema/activity.json#properties"} + "properties" :{"$ref":"./activity.json#properties"} } }, "links" : { diff --git a/library/jsonschema-b4.js b/library/jsonschema-b4.js index fc33640..a9fffbe 100644 --- a/library/jsonschema-b4.js +++ b/library/jsonschema-b4.js @@ -170,6 +170,7 @@ JSONSchema = { addError("may only have " + schema.maxDecimal + " digits of decimal places"); } } + } return null; } diff --git a/library/ref.js b/library/ref.js new file mode 100644 index 0000000..800af6a --- /dev/null +++ b/library/ref.js @@ -0,0 +1,349 @@ +dojo.provide("dojox.json.ref"); +dojo.require("dojo.date.stamp"); + +// summary: +// Adds advanced JSON {de}serialization capabilities to the base json library. +// This enhances the capabilities of dojo.toJson and dojo.fromJson, +// adding referencing support, date handling, and other extra format handling. +// On parsing, references are resolved. When references are made to +// ids/objects that have been loaded yet, the loader function will be set to +// _loadObject to denote a lazy loading (not loaded yet) object. + +dojox.json.ref = { + resolveJson: function(/*Object*/ root,/*Object?*/ args){ + // summary: + // Indexes and resolves references in the JSON object. + // description: + // A JSON Schema object that can be used to advise the handling of the JSON (defining ids, date properties, urls, etc) + // + // root: + // The root object of the object graph to be processed + // args: + // Object with additional arguments: + // + // The *index* parameter. + // This is the index object (map) to use to store an index of all the objects. + // If you are using inter-message referencing, you must provide the same object for each call. + // The *defaultId* parameter. + // This is the default id to use for the root object (if it doesn't define it's own id) + // The *idPrefix* parameter. + // This the prefix to use for the ids as they enter the index. This allows multiple tables + // to use ids (that might otherwise collide) that enter the same global index. + // idPrefix should be in the form "/Service/". For example, + // if the idPrefix is "/Table/", and object is encountered {id:"4",...}, this would go in the + // index as "/Table/4". + // The *idAttribute* parameter. + // This indicates what property is the identity property. This defaults to "id" + // The *assignAbsoluteIds* parameter. + // This indicates that the resolveJson should assign absolute ids (__id) as the objects are being parsed. + // + // The *schemas* parameter + // This provides a map of schemas, from which prototypes can be retrieved + // The *loader* parameter + // This is a function that is called added to the reference objects that can't be resolved (lazy objects) + // return: + // An object, the result of the processing + args = args || {}; + var idAttribute = args.idAttribute || 'id'; + var prefix = args.idPrefix || ''; + var assignAbsoluteIds = args.assignAbsoluteIds; + var index = args.index || {}; // create an index if one doesn't exist + var timeStamps = args.timeStamps; + var ref,reWalk=[]; + var pathResolveRegex = /^(.*\/)?(\w+:\/\/)|[^\/\.]+\/\.\.\/|^.*\/(\/)/; + var addProp = this._addProp; + var F = function(){}; + + + function getExternal(url, path) { + var handle = dojo.xhrGet({"url" : url, "sync" : true, "handleAs" : "text"}); + var txt = handle.results.toString(); + txt = txt.substring(0, txt.length-2); + txt = txt + ", '_find' : {'$ref' : '#" + path + "'}}"; + var json = dojox.json.ref.fromJson(txt); + return json["_find"]; + } + + function walk(it, stop, defaultId, schema, defaultObject){ + // this walks the new graph, resolving references and making other changes + var update, val, id = idAttribute in it ? it[idAttribute] : defaultId; + if(id !== undefined){ + id = (prefix + id).replace(pathResolveRegex,'$2$3'); + } + var target = defaultObject || it; + if(id !== undefined){ // if there is an id available... + if(assignAbsoluteIds){ + it.__id = id; + } + if(args.schemas && (!(it instanceof Array)) && // won't try on arrays to do prototypes, plus it messes with queries + (val = id.match(/^(.+\/)[^\.\[]*$/))){ // if it has a direct table id (no paths) + schema = args.schemas[val[1]]; + } + // if the id already exists in the system, we should use the existing object, and just + // update it... as long as the object is compatible + if(index[id] && ((it instanceof Array) == (index[id] instanceof Array))){ + target = index[id]; + delete target.$ref; // remove this artifact + update = true; + }else{ + var proto = schema && schema.prototype; // and if has a prototype + if(proto){ + // if the schema defines a prototype, that needs to be the prototype of the object + F.prototype = proto; + target = new F(); + } + } + index[id] = target; // add the prefix, set _id, and index it + if(timeStamps){ + timeStamps[id] = args.time; + } + } + var properties = schema && schema.properties; + var length = it.length; + for(var i in it){ + if(i==length){ + break; + } + if(it.hasOwnProperty(i)){ + val=it[i]; + var propertyDefinition = properties && properties[i]; + if(propertyDefinition && propertyDefinition.format == 'date-time' && typeof val == 'string'){ + val = dojo.date.stamp.fromISOString(val); + }else if((typeof val =='object') && val && !(val instanceof Date)){ + ref=val.$ref; + if(ref){ // a reference was found + // make sure it is a safe reference + delete it[i];// remove the property so it doesn't resolve to itself in the case of id.propertyName lazy values + + var path = ref.toString(); + // Monica: Adding support for external references + var parts = path.split('#'); + if (parts.length == 2 && parts[0].length>0) { + ref = getExternal(parts[0], parts[1]); + } + else { + path = path.replace(/(#)([^\.\[])/,'$1.$2').match(/(^([^\[]*\/)?[^#\.\[]*)#?([\.\[].*)?/); // divide along the path + if((ref = (path[1]=='$' || path[1]=='this' || path[1]=='') ? root : index[(prefix + path[1]).replace(pathResolveRegex,'$2$3')])){ // a $ indicates to start with the root, otherwise start with an id + // if there is a path, we will iterate through the path references + if(path[3]){ + path[3].replace(/(\[([^\]]+)\])|(\.?([^\.\[]+))/g,function(t,a,b,c,d){ + ref = ref && ref[b ? b.replace(/[\"\'\\]/,'') : d]; + }); + } + } + } + if(ref){ + val = ref; + }else{ + // otherwise, no starting point was found (id not found), if stop is set, it does not exist, we have + // unloaded reference, if stop is not set, it may be in a part of the graph not walked yet, + // we will wait for the second loop + if(!stop){ + var rewalking; + if(!rewalking){ + reWalk.push(target); // we need to rewalk it to resolve references + } + rewalking = true; // we only want to add it once + val = walk(val, false, val.$ref, propertyDefinition); + }else{ + // create a lazy loaded object + val._loadObject = args.loader; + } + } + }else{ + if(!stop){ // if we are in stop, that means we are in the second loop, and we only need to check this current one, + // further walking may lead down circular loops + val = walk( + val, + reWalk==it, + id && addProp(id, i), // the default id to use + propertyDefinition, + // if we have an existing object child, we want to + // maintain it's identity, so we pass it as the default object + target != it && typeof target[i] == 'object' && target[i] + ); + } + } + } + it[i] = val; + if(target!=it && !target.__isDirty){// do updates if we are updating an existing object and it's not dirty + var old = target[i]; + target[i] = val; // only update if it changed + if(update && val !== old && // see if it is different + !target._loadObject && // no updates if we are just lazy loading + !(val instanceof Date && old instanceof Date && val.getTime() == old.getTime()) && // make sure it isn't an identical date + !(typeof val == 'function' && typeof old == 'function' && val.toString() == old.toString()) && // make sure it isn't an indentical function + index.onUpdate){ + index.onUpdate(target,i,old,val); // call the listener for each update + } + } + } + } + + if(update){ + // this means we are updating, we need to remove deleted + for(i in target){ + if(!target.__isDirty && target.hasOwnProperty(i) && !it.hasOwnProperty(i) && i != '__id' && i != '__clientId' && !(target instanceof Array && isNaN(i))){ + if(index.onUpdate && i != "_loadObject" && i != "_idAttr"){ + index.onUpdate(target,i,target[i],undefined); // call the listener for each update + } + delete target[i]; + while(target instanceof Array && target.length && target[target.length-1] === undefined){ + // shorten the target if necessary + target.length--; + } + } + } + }else{ + if(index.onLoad){ + index.onLoad(target); + } + } + return target; + } + if(root && typeof root == 'object'){ + root = walk(root,false,args.defaultId); // do the main walk through + walk(reWalk,false); // re walk any parts that were not able to resolve references on the first round + } + return root; + }, + + + fromJson: function(/*String*/ str,/*Object?*/ args){ + // summary: + // evaluates the passed string-form of a JSON object. + // + // str: + // a string literal of a JSON item, for instance: + // '{ "foo": [ "bar", 1, { "baz": "thud" } ] }' + // args: See resolveJson + // + // return: + // An object, the result of the evaluation + function ref(target){ // support call styles references as well + return {$ref:target}; + } + try{ + var root = eval('(' + str + ')'); // do the eval + }catch(e){ + throw new SyntaxError("Invalid JSON string: " + e.message + " parsing: "+ str); + } + if(root){ + return this.resolveJson(root, args); + } + return root; + }, + + toJson: function(/*Object*/ it, /*Boolean?*/ prettyPrint, /*Object?*/ idPrefix, /*Object?*/ indexSubObjects){ + // summary: + // Create a JSON serialization of an object. + // This has support for referencing, including circular references, duplicate references, and out-of-message references + // id and path-based referencing is supported as well and is based on http://www.json.com/2007/10/19/json-referencing-proposal-and-library/. + // + // it: + // an object to be serialized. + // + // prettyPrint: + // if true, we indent objects and arrays to make the output prettier. + // The variable dojo.toJsonIndentStr is used as the indent string + // -- to use something other than the default (tab), + // change that variable before calling dojo.toJson(). + // + // idPrefix: The prefix that has been used for the absolute ids + // + // return: + // a String representing the serialized version of the passed object. + var useRefs = this._useRefs; + var addProp = this._addProp; + idPrefix = idPrefix || ''; // the id prefix for this context + var paths={}; + var generated = {}; + function serialize(it,path,_indentStr){ + if(typeof it == 'object' && it){ + var value; + if(it instanceof Date){ // properly serialize dates + return '"' + dojo.date.stamp.toISOString(it,{zulu:true}) + '"'; + } + var id = it.__id; + if(id){ // we found an identifiable object, we will just serialize a reference to it... unless it is the root + if(path != '#' && ((useRefs && !id.match(/#/)) || paths[id])){ + var ref = id; + if(id.charAt(0)!='#'){ + if(it.__clientId == id){ + ref = "cid:" + id; + }else if(id.substring(0, idPrefix.length) == idPrefix){ // see if the reference is in the current context + // a reference with a prefix matching the current context, the prefix should be removed + ref = id.substring(idPrefix.length); + }else{ + // a reference to a different context, assume relative url based referencing + ref = id; + } + } + return serialize({ + $ref: ref + },'#'); + } + path = id; + }else{ + it.__id = path; // we will create path ids for other objects in case they are circular + generated[path] = it; + } + paths[path] = it;// save it here so they can be deleted at the end + _indentStr = _indentStr || ""; + var nextIndent = prettyPrint ? _indentStr + dojo.toJsonIndentStr : ""; + var newLine = prettyPrint ? "\n" : ""; + var sep = prettyPrint ? " " : ""; + + if(it instanceof Array){ + var res = dojo.map(it, function(obj,i){ + var val = serialize(obj, addProp(path, i), nextIndent); + if(typeof val != "string"){ + val = "undefined"; + } + return newLine + nextIndent + val; + }); + return "[" + res.join("," + sep) + newLine + _indentStr + "]"; + } + + var output = []; + for(var i in it){ + if(it.hasOwnProperty(i)){ + var keyStr; + if(typeof i == "number"){ + keyStr = '"' + i + '"'; + }else if(typeof i == "string" && (i.charAt(0) != '_' || i.charAt(1) != '_')){ + // we don't serialize our internal properties __id and __clientId + keyStr = dojo._escapeString(i); + }else{ + // skip non-string or number keys + continue; + } + var val = serialize(it[i],addProp(path, i),nextIndent); + if(typeof val != "string"){ + // skip non-serializable values + continue; + } + output.push(newLine + nextIndent + keyStr + ":" + sep + val); + } + } + return "{" + output.join("," + sep) + newLine + _indentStr + "}"; + }else if(typeof it == "function" && dojox.json.ref.serializeFunctions){ + return it.toString(); + } + + return dojo.toJson(it); // use the default serializer for primitives + } + var json = serialize(it,'#',''); + if(!indexSubObjects){ + for(var i in generated) {// cleanup the temporary path-generated ids + delete generated[i].__id; + } + } + return json; + }, + _addProp: function(id, prop){ + return id + (id.match(/#/) ? id.length == 1 ? '' : '.' : '#') + prop; + }, + _useRefs: false, + serializeFunctions: false +} diff --git a/library/schema.js b/library/schema.js new file mode 100644 index 0000000..1f661f9 --- /dev/null +++ b/library/schema.js @@ -0,0 +1,218 @@ +dojo.provide("dojox.json.schema"); + + +dojox.json.schema.validate = function(/*Any*/instance,/*Object*/schema){ + // summary: + // To use the validator call this with an instance object and an optional schema object. + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). + // instance: + // The instance value/object to validate + // schema: + // The schema to use to validate + // description: + // The validate method will return an object with two properties: + // valid: A boolean indicating if the instance is valid by the schema + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: + // property: which indicates which property had the error + // message: which indicates what the error was + // + return this._validate(instance,schema,false); +}; +dojox.json.schema.checkPropertyChange = function(/*Any*/value,/*Object*/schema){ + // summary: + // The checkPropertyChange method will check to see if an value can legally be in property with the given schema + // This is slightly different than the validate method in that it will fail if the schema is readonly and it will + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // information. + // value: + // The new instance value/object to check + // schema: + // The schema to use to validate + // return: + // see dojox.validate.jsonSchema.validate + // + return this._validate(value,schema,true); +}; +dojox.json.schema.mustBeValid = function(result){ + // summary: + // This checks to ensure that the result is valid and will throw an appropriate error message if it is not + // result: the result returned from checkPropertyChange or validate + if(!result.valid){ + throw new TypeError(dojo.map(result.errors,function(error){return error.property + ' ' + error.message;}).join(",")); + } +} +dojox.json.schema._validate = function(/*Any*/instance,/*Object*/schema,/*Boolean*/ _changing){ + + var errors = []; + // validate a value against a property definition + function checkProp(value, schema, path,i){ + var l; + path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; + function addError(message){ + errors.push({property:path,message:message}); + } + + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function')){ + if(typeof schema == 'function'){ + if(!(instance instanceof schema)){ + addError("is not an instance of the class/constructor " + schema.name); + } + }else if(schema){ + addError("Invalid schema/property definition " + schema); + } + return null; + } + if(_changing && schema.readonly){ + addError("is a readonly field, it can not be changed"); + } + if(schema['extends']){ // if it extends another schema, it must pass that schema as well + checkProp(value,schema['extends'],path,i); + } + // validate a value against a type definition + function checkType(type,value){ + if(type){ + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && + !(value instanceof Array && type == 'array') && + !(type == 'integer' && value%1===0)){ + return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; + } + if(type instanceof Array){ + var unionErrors=[]; + for(var j = 0; j < type.length; j++){ // a union type + if(!(unionErrors=checkType(type[j],value)).length){ + break; + } + } + if(unionErrors.length){ + return unionErrors; + } + }else if(typeof type == 'object'){ + var priorErrors = errors; + errors = []; + checkProp(value,type,path); + var theseErrors = errors; + errors = priorErrors; + return theseErrors; + } + } + return []; + } + if(value === undefined){ + if(!schema.optional){ + addError("is missing and it is not optional"); + } + }else{ + errors = errors.concat(checkType(schema.type,value)); + if(schema.disallow && !checkType(schema.disallow,value).length){ + addError(" disallowed value was matched"); + } + if(value !== null){ + if(value instanceof Array){ + if(schema.items){ + if(schema.items instanceof Array){ + for(i=0,l=value.length; i schema.maxItems){ + addError("There must be a maximum of " + schema.maxItems + " in the array"); + } + }else if(schema.properties){ + errors.concat(checkObj(value,schema.properties,path,schema.additionalProperties)); + } + if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ + addError("does not match the regex pattern " + schema.pattern); + } + if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ + addError("may only be " + schema.maxLength + " characters long"); + } + if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ + addError("must be at least " + schema.minLength + " characters long"); + } + if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum && + schema.minimum > value){ + addError("must have a minimum value of " + schema.minimum); + } + if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && + schema.maximum < value){ + addError("must have a maximum value of " + schema.maximum); + } + if(schema['enum']){ + var enumer = schema['enum']; + l = enumer.length; + var found; + for(var j = 0; j < l; j++){ + if(enumer[j]===value){ + found=1; + break; + } + } + if(!found){ + addError("does not have a value in the enumeration " + enumer.join(", ")); + } + } + if(typeof schema.maxDecimal == 'number' && + (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ + addError("may only have " + schema.maxDecimal + " digits of decimal places"); + } + } + } + return null; + } + // validate an object against a schema + function checkObj(instance,objTypeDef,path,additionalProp){ + + if(typeof objTypeDef =='object'){ + if(typeof instance != 'object' || instance instanceof Array){ + errors.push({property:path,message:"an object is required"}); + } + + for(var i in objTypeDef){ + if(objTypeDef.hasOwnProperty(i) && "__id" != i){ + var value = instance[i]; + var propDef = objTypeDef[i]; + checkProp(value,propDef,path,i); + } + } + } + for(i in instance){ + if(instance.hasOwnProperty(i) && (i.charAt(0) != '_' || i.charAt(0) != '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ + errors.push({property:path,message:(typeof value) + "The property " + i + + " is not defined in the schema and the schema does not allow additional properties"}); + } + var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; + if(requires && !(requires in instance)){ + errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); + } + value = instance[i]; + if(objTypeDef && typeof objTypeDef == 'object' && !(i in objTypeDef)){ + checkProp(value,additionalProp,path,i); + } + if(!_changing && value && value.$schema){ + errors = errors.concat(checkProp(value,value.$schema,path,i)); + } + } + return errors; + } + if(schema){ + checkProp(instance,schema,'',''); + } + if(!_changing && instance && instance.$schema){ + checkProp(instance,instance.$schema,'',''); + } + return {valid:!errors.length,errors:errors}; +}; + diff --git a/object.json b/object.json index c6c7240..b8cf379 100644 --- a/object.json +++ b/object.json @@ -1,110 +1,63 @@ { "type" : "object", "title" : "social object", + "extends" : {"$ref": "./core_object"}, "description" : "Generic object on the web", "properties" : { - 'id' : { - "type" : "string", - "description" : "Uniquely identifies the object on the service", - "default" : "{link}" - }, - 'image' : { - "format":"image", - "type":"string", - "description" : "A representative image of the object such as a profile \n\ - picture for a person", - "optional":true - }, - 'displayName' : { - "type":"string", - "description" : "The name of the object. Made required except for photos \n\ - which will have a default" - }, - 'summary' : { - "type" : "string", - "optional":true - }, - 'link' : { - "type" : "string", - "format" : "url", - "description" : "Permalink to the object.", - "optional":true - }, - 'objectType' :{ - "type" : "string", - "description" : "The type of social object used to select schema", - "optional" : true - }, - "author" : { - "type" : "object", - "optional" : true, - "description" : "Entity who posted this object", - "properties" : {"$ref":"#properties"} - }, - "postedTime" : { - "type" : "string", - "description": "Time at which the object was created. We should a last updated time.", - "format" : "date" - }, - 'inReplyTo':{ + "inReplyTo":{ "optional" : true, "description" : "The object that this object is in response to.", "note" : "This should also support replying to activities", "type": "object", "properties" :{"$ref":"#properties"} }, - 'replies':{ + "replies":{ "optional" : true, "type" : "array", "uniqueItems" : true, - "description" : "An array of feeds. Each feed has an array of activities \n\ - which were done in response to this object", + "description" : "An array of feeds. Each feed has an array of activities which were done in response to this object", "items": { "type" : "object", - "properties" :{"$ref":"http://activitystrea.ms/json-schema/feed.json#properties"} + "properties" :{"$ref":"./feed.json#properties"} } }, - 'reactions':{ + "reactions":{ "optional" : true, - "description" : "An array of reactions. A reactions object is itself an \n\ - array of people who all had the same reaction", + "description" : "An array of reactions. A reactions object is itself an array of people who all had the same reaction", "type" : "array", "uniqueItems" : true, "items": { "type" : "object", "properties" :{ - "$ref":"http://activitystrea.ms/json-schema/reactions.json#properties" + "$ref":"./reactions.json#properties" } } }, - 'attachedObjects':{ + "attachedObjects":{ "optional" : true, "title" : "Related objects", - "description" : "An array of objects which are related to this object...\n\ - Generally photos for an article. This needs more clarification", + "description" : "An array of objects which are related to this object...Generally photos for an article. This needs more clarification", "type" : "array", "items": { "type" : "object", - "properties" :{"$ref":"#.properties"} + "properties" :{"$ref":"./core#properties"} } }, - 'upstreamDuplicates':{ + "upstreamDuplicates":{ "optional" : true, "type" : "array", - "description" : "When a publisher changes the id they can put the original \n\ - id of the object in this field so consumers can de-duplicate", + "description" : "When a publisher changes the id they can put the original id of the object in this field so consumers can de-duplicate", "items": {"type" : "string"} }, - 'downstreamDuplicates':{ + "downstreamDuplicates":{ "optional" : true, "type" : "array", - "description" : "When a publisher creates a clone object in another system they can put that id\n\ - here in order to let the consumer know how to de-duplicate", + "description" : "When a publisher creates a clone object in another system they can put that id here in order to let the consumer know how to de-duplicate", "items": {"type" : "string"} } }, "links": [ - {"rel": "describedby", "href": "http://activitystrea.ms/json-schema/objectType/{objectType}.json"} + {"rel": "describedby", "href": "./objectType/{objectType}.json"} ] } \ No newline at end of file diff --git a/reactions.json b/reactions.json index 0dbcea8..66ca74f 100644 --- a/reactions.json +++ b/reactions.json @@ -5,8 +5,8 @@ "inReplyTo" : { "optional" : true, "type" : [ - {"$ref" : "http://activitystrea.ms/json-schema/object.json"}, - {"$ref" : "http://activitystrea.ms/json-schema/activity.json"} + {"$ref" : "./object.json"}, + {"$ref" : "./activity.json"} ] }, "verb" : { @@ -22,7 +22,7 @@ "description" : "An array of unique people who had the same reaction to the same object. May be a subset", "items" : { "type" : "object", - "properties" :{"$ref":"http://activitystrea.ms/json-schema/person.json#properties"} + "properties" :{"$ref":"./person.json#properties"} } }, "example" : { From 9886b3f0c9444875fe7c4645e49fb928a6dfa493 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Tue, 27 Jul 2010 17:51:58 -0700 Subject: [PATCH 17/58] Added update verb --- verbs/update.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 verbs/update.json diff --git a/verbs/update.json b/verbs/update.json new file mode 100644 index 0000000..5c59e12 --- /dev/null +++ b/verbs/update.json @@ -0,0 +1,33 @@ +{ + "type" : "object", + "title" : "Update", + "description" : "To update an object. Ex: Monica updated her street address to 234 Awesome St", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "tag" + }, + "title" : { + "type" : "string", + "default" : "{actor.displayName} updated {object.displayName}'s {change.name} to {change.value}" + } + }, + "example" : { + "actor" : {"id":1212, "displayName" : "Peter"}, + "verb" : "update", + "change" : + { + "name" : "street address", + "value" : {"$ref": "#object.streetAddress"} + }, + "object" : { + "id": 12121, + "displayName" : "Peter's House", + "streetAddress" : "234 Amazing St", + "city" : "San Francisco", + "state" : "California" + } + + } +} From 954ab7dd303573f9ad888897324ba2f13c93d2b1 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 7 Aug 2010 14:54:55 -0700 Subject: [PATCH 18/58] Made the author optional on activities so they can be used for sync and added missing property to the update activity called change which allows to express what changed --- activity.json | 3 ++- verbs/update.json | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/activity.json b/activity.json index d889049..1caeebc 100644 --- a/activity.json +++ b/activity.json @@ -11,7 +11,8 @@ "actor" : { "type": "object", "description": "Identifies the entity that performed the activity. Example: A person or user", - "properties" : {"$ref":"./object.json#properties"} + "properties" : {"$ref":"./object.json#properties"}, + "optional" : true }, "verb" : { "title" : "verb", diff --git a/verbs/update.json b/verbs/update.json index 5c59e12..5286e5d 100644 --- a/verbs/update.json +++ b/verbs/update.json @@ -11,6 +11,17 @@ "title" : { "type" : "string", "default" : "{actor.displayName} updated {object.displayName}'s {change.name} to {change.value}" + }, + "change" : { + "type" : "object", + "properties" :{ + "name" : { + "type" : "string" + }, + "value" : { + "type" : "any" + } + } } }, "example" : { From e8bb8a1169caf694074bd23a5be2404036e944cd Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 7 Aug 2010 16:50:00 -0700 Subject: [PATCH 19/58] This should work --- .htaccess | 1 + 1 file changed, 1 insertion(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..b1c38b0 --- /dev/null +++ b/.htaccess @@ -0,0 +1 @@ +AddType application/json .json From 31b156b3a59165689b92597eca2e550fd13b42b7 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 7 Aug 2010 16:55:50 -0700 Subject: [PATCH 20/58] Updating text so web server cache is popped and we can get the content type changes --- activity.json | 2 +- core_object.json | 2 +- feed.json | 2 +- object.json | 2 +- reactions.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/activity.json b/activity.json index 1caeebc..b9a0a19 100644 --- a/activity.json +++ b/activity.json @@ -1,7 +1,7 @@ { "type" : "object", "title" : "activity", - "description" : "An activity construct recounts what an actor did to an object in the past", + "description" : "An activity construct recounts what an actor did to an object in the past. If there is no actor it simply describes the change.", "properties": { "id" :{ "type" : "string", diff --git a/core_object.json b/core_object.json index ea73b89..b91e594 100644 --- a/core_object.json +++ b/core_object.json @@ -1,7 +1,7 @@ { "type" : "object", "title" : "core_object", - "description" : "Basic object on the web", + "description" : "Basic object on the web. The only required property is the id", "properties" : { "id" : { "type" : "string", diff --git a/feed.json b/feed.json index 6f7c2a6..a3f0bad 100644 --- a/feed.json +++ b/feed.json @@ -1,7 +1,7 @@ { "type" : "object", "title" : "feed", - "description" : "This is the top level container which is typically the response for the API call. A feed contains an array of activities usually related to each other via a subject. Ex: Peter's Lifestream", + "description" : "This is the top level container which is typically the response for the API call. A feed contains an array of activities usually related to each other via a subject. Ex: Peter's Lifestream. A feed or stream can also be used to syncrhonize changes", "properties" : { "title" : { "type" : "string", diff --git a/object.json b/object.json index b8cf379..26dd7f6 100644 --- a/object.json +++ b/object.json @@ -2,7 +2,7 @@ "type" : "object", "title" : "social object", "extends" : {"$ref": "./core_object"}, - "description" : "Generic object on the web", + "description" : "Generic object on the web with a set fo reactions", "properties" : { "inReplyTo":{ "optional" : true, diff --git a/reactions.json b/reactions.json index 66ca74f..bf1eac4 100644 --- a/reactions.json +++ b/reactions.json @@ -1,6 +1,6 @@ { "type" : "object", - "description" : "This type represents a list of people who had the same reaction represented by the verb to the same object", + "description" : "This type represents a list of people who had the same reaction represented by the verb to the same object. Subject to change.", "properties" : { "inReplyTo" : { "optional" : true, From ae2f8e4b2567ff3ae020884e0c1de7e0a98f7fcd Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Sat, 7 Aug 2010 17:05:31 -0700 Subject: [PATCH 21/58] Linking to feed describedBy to json-schema.org --- feed.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/feed.json b/feed.json index a3f0bad..3e50a87 100644 --- a/feed.json +++ b/feed.json @@ -27,5 +27,8 @@ "description" :"Links between an this object and other resources as defined in Web Linking", "properties" : {"$ref" : "http://json-schema.org/links#properties"} } - } + }, + "links": [ + {"rel": "describedby", "href": "http://json-schema.org/schema"} + ] } \ No newline at end of file From 5eab8a25e2fb30f51e88bd3b13e07d8c44c048be Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Thu, 12 Aug 2010 10:25:48 -0700 Subject: [PATCH 22/58] New way of modeling updates --- objectTypes/list.json | 7 ++++++ objectTypes/property.json | 42 +++++++++++++++++++++++++++++++++ verbs/update-multiple.json | 48 ++++++++++++++++++++++++++++++++++++++ verbs/update.json | 38 ++++++++---------------------- 4 files changed, 107 insertions(+), 28 deletions(-) create mode 100644 objectTypes/property.json create mode 100644 verbs/update-multiple.json diff --git a/objectTypes/list.json b/objectTypes/list.json index d95f2a0..18518e9 100644 --- a/objectTypes/list.json +++ b/objectTypes/list.json @@ -6,6 +6,13 @@ "objectType" :{ "type" :"string", "default" : "list" + }, + "items" : { + "type" : "array", + "items" : { + "type" : "object", + "properties" : {"$ref":"http://activitystrea.ms/json-schema/object.json"} + } } } } diff --git a/objectTypes/property.json b/objectTypes/property.json new file mode 100644 index 0000000..65501eb --- /dev/null +++ b/objectTypes/property.json @@ -0,0 +1,42 @@ +{ + "type" : "object", + "title" : "property", + "description" : "A property describes name, path and value. Can be used with delete, update or post verbs", + "extends": {"$ref":"http://activitystrea.ms/json-schema/object.json"}, + "properties" :{ + "objectType" :{ + "type" :"string", + "default" : "property" + }, + "displayName" : { + "type" : "string", + "description" : "The human readable name of the property in the appropriate language", + "optional" : true + }, + "path" : { + "type" : "string", + "description" : "dot delimited path to the property in the target. Ex: streetAddress" + }, + "content" : { + "type" : "any", + "description" : "Value of the property it can be a scalar or an object" + } + }, + "example" : { + "actor" : {"id":1212, "displayName" : "Peter"}, + "verb" : "update", + "postedTime" : "2010-08-02T15:29:00Z", + "object" : + { + "objectType" : "property", + "displayName" : "street address", + "path" : "streetAddress", + "content" : "234 Amazing St" + }, + "target" : { + "id": 12121, + "postedTime" : "2010-08-02T15:29:00Z", + "displayName" : "Peter's House" + } + } +} \ No newline at end of file diff --git a/verbs/update-multiple.json b/verbs/update-multiple.json new file mode 100644 index 0000000..13ea1ea --- /dev/null +++ b/verbs/update-multiple.json @@ -0,0 +1,48 @@ +{ + "type" : "object", + "title" : "Update Multiple", + "notes" : "Warning:Reviewing this concept. This is what RT team wants", + "description" : "To update multiple things on an object. The object will either be a changeset or a list", + "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, + "properties" :{ + "verb" :{ + "type" : "string", + "default" : "update-multiple" + }, + "object" : { + "type" : "object", + "title" : "changeset", + "properties" : { + "actions" : { + "type" : "array", + "items" : { + "type" : "object", + "properties" : {"$ref":"http://activitystrea.ms/json-schema/action.json"} + } + } + } + } + }, + "example" : { + "actor" : {"id":1212, "displayName" : "Melissa"}, + "verb" : "update-multiple", + "postedTime" : "2010-08-02T15:29:00Z", + "target" : { + "type" : "profile", + "id" : "2121212", + "displayName" : "Melissa's profile", + "postedTime" : "2009-08-02T15:29:00Z" + }, + "object" : { + "type" : "changeset", + "actions" : [ + {"verb" : "update", "object" : {"type" : "property", "displayName" : "relationship status"}}, + {"verb" : "delete", "object" : {"type" : "song", "displayName" : "99 Balloons"}}, + {"verb" : "post", "object" : {"type": "song", "displayName" : "Ever ever after"}} + ] + } + } + } + + } +} diff --git a/verbs/update.json b/verbs/update.json index 5286e5d..c9e43ec 100644 --- a/verbs/update.json +++ b/verbs/update.json @@ -1,44 +1,26 @@ { "type" : "object", "title" : "Update", - "description" : "To update an object. Ex: Monica updated her street address to 234 Awesome St", + "description" : "To update a property on an object. Ex: Monica updated her street address to 234 Awesome St.", + "notes" : "The new property value can be a scalar value or an object. See the property object type", "extends": {"$ref":"http://activitystrea.ms/json-schema/activity.json"}, "properties" :{ "verb" :{ "type" : "string", - "default" : "tag" + "default" : "update" }, "title" : { "type" : "string", - "default" : "{actor.displayName} updated {object.displayName}'s {change.name} to {change.value}" + "default" : "{actor.displayName} updated {target.displayName}'s {object.displayName} to {object.value}" }, - "change" : { + "object" : { "type" : "object", - "properties" :{ - "name" : { - "type" : "string" - }, - "value" : { - "type" : "any" - } - } - } - }, - "example" : { - "actor" : {"id":1212, "displayName" : "Peter"}, - "verb" : "update", - "change" : - { - "name" : "street address", - "value" : {"$ref": "#object.streetAddress"} + "properties" : {"$ref":"http://activitystrea.ms/json-schema/objectTypes/property.json"} }, - "object" : { - "id": 12121, - "displayName" : "Peter's House", - "streetAddress" : "234 Amazing St", - "city" : "San Francisco", - "state" : "California" + "target" : { + "type" : "object", + "optional" : true, + "properties" : {"$ref":"http://activitystrea.ms/json-schema/core-object.json"} } - } } From a91f22b2d13883a166cd466be7029951facaee1d Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 13 Aug 2010 09:56:56 -0700 Subject: [PATCH 23/58] after discussions --- action.json | 19 +++++++++++++++++++ activity.json | 2 +- core_object.json | 2 +- objectTypes/property.json | 4 ++-- verbs/update-multiple.json | 4 ++-- 5 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 action.json diff --git a/action.json b/action.json new file mode 100644 index 0000000..7b965d8 --- /dev/null +++ b/action.json @@ -0,0 +1,19 @@ +{ + "type" : "object", + "title" : "action", + "description" : "An action construct describes a change in an object", + "properties": { + "verb" : { + "title" : "verb", + "type" : "string", + "default": "post", + "optional" : "true", + "description" :"Represents the type of action performed: post(add), update or delete" + }, + "object" : { + "type": "object", + "description" : "Identifies the object to which the verb applies. Ex: Added a photo", + "properties" : {"$ref":"./object.json#properties"} + } + } +} diff --git a/activity.json b/activity.json index b9a0a19..e01c424 100644 --- a/activity.json +++ b/activity.json @@ -32,7 +32,7 @@ "description" : "Represents the object to which the activity was performed. Example: A photo album", "properties" : {"$ref":"./object.json#properties"} }, - "postedTime" : { + "time" : { "type" : "string", "description": "Time at which the activity occurred", "format" : "date" diff --git a/core_object.json b/core_object.json index b91e594..a73a11f 100644 --- a/core_object.json +++ b/core_object.json @@ -39,7 +39,7 @@ "description" : "Entity who posted this object", "properties" : {"$ref":"#properties"} }, - "postedTime" : { + "time" : { "optional" : true, "type" : "string", "description": "Time at which the object was created. We should a last updated time.", diff --git a/objectTypes/property.json b/objectTypes/property.json index 65501eb..447065f 100644 --- a/objectTypes/property.json +++ b/objectTypes/property.json @@ -25,7 +25,7 @@ "example" : { "actor" : {"id":1212, "displayName" : "Peter"}, "verb" : "update", - "postedTime" : "2010-08-02T15:29:00Z", + "time" : "2010-08-02T15:29:00Z", "object" : { "objectType" : "property", @@ -35,7 +35,7 @@ }, "target" : { "id": 12121, - "postedTime" : "2010-08-02T15:29:00Z", + "time" : "2010-08-02T15:29:00Z", "displayName" : "Peter's House" } } diff --git a/verbs/update-multiple.json b/verbs/update-multiple.json index 13ea1ea..765a7f9 100644 --- a/verbs/update-multiple.json +++ b/verbs/update-multiple.json @@ -26,12 +26,12 @@ "example" : { "actor" : {"id":1212, "displayName" : "Melissa"}, "verb" : "update-multiple", - "postedTime" : "2010-08-02T15:29:00Z", + "time" : "2010-08-02T15:29:00Z", "target" : { "type" : "profile", "id" : "2121212", "displayName" : "Melissa's profile", - "postedTime" : "2009-08-02T15:29:00Z" + "time" : "2009-08-02T15:29:00Z" }, "object" : { "type" : "changeset", From 29696bc95b79e1e6ee6981210d2125c436a51f08 Mon Sep 17 00:00:00 2001 From: Monica Keller Date: Fri, 13 Aug 2010 10:06:36 -0700 Subject: [PATCH 24/58] multiple --- verbs/update-multiple.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/verbs/update-multiple.json b/verbs/update-multiple.json index 765a7f9..3b0060b 100644 --- a/verbs/update-multiple.json +++ b/verbs/update-multiple.json @@ -24,16 +24,16 @@ } }, "example" : { - "actor" : {"id":1212, "displayName" : "Melissa"}, - "verb" : "update-multiple", + "actor" : {"id":1212, "displayName" : "Melissa"}, /*May not be known for FB */ + "verb" : "update-multiple", /* ignore for FB */ "time" : "2010-08-02T15:29:00Z", - "target" : { + "target" : { /* uid --> id on FB */ "type" : "profile", "id" : "2121212", "displayName" : "Melissa's profile", "time" : "2009-08-02T15:29:00Z" }, - "object" : { + "object" : { /* data */ "type" : "changeset", "actions" : [ {"verb" : "update", "object" : {"type" : "property", "displayName" : "relationship status"}}, From e6a3b89de82b2eebf67e8c01590b6cf169d21f1d Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 16:55:24 -0800 Subject: [PATCH 25/58] Adding index file for JSON Schema folder --- index.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..b35e095 --- /dev/null +++ b/index.html @@ -0,0 +1,22 @@ + + + + Activity Streams JSON + + +
+ + + From 255ab62b20ca19b9bd36d363467b88007e90aa9d Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 16:58:26 -0800 Subject: [PATCH 26/58] Fix for typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index b35e095..9e3debc 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Activity Streams JSON -
+
+ From 6748c07f71de7988b56550ca8ef20ee6179d028e Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 17:09:37 -0800 Subject: [PATCH 30/58] Added livestream --- index.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 545467a..af1e57e 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,22 @@ Activity Streams JSON +
Watch live streaming video from activitystreams at livestream.com
- - +
+
+ From ddf2e756b925c42765dc8054dd33aba03be8085b Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 17:15:20 -0800 Subject: [PATCH 31/58] Added Styling --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index af1e57e..a5c6ad1 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,11 @@ Activity Streams JSON +
From 738d81e83b539f557a44cdfba3a9dbd1ded67c01 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 17:20:59 -0800 Subject: [PATCH 32/58] Added Styling --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index a5c6ad1..16044ae 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,9 @@ +
Watch live streaming video from activitystreams at livestream.com
From 06264bdbdf1c766ccfeb08c8f190d742522bb480 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 26 Jan 2011 17:22:45 -0800 Subject: [PATCH 33/58] Added Styling --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 16044ae..f9759dc 100644 --- a/index.html +++ b/index.html @@ -5,17 +5,18 @@ -
+
Watch live streaming video from activitystreams at livestream.com
-
+
+
+
Watch live streaming video from activitystreams at livestream.com
+
From f80f5a9d79168418b7394923a4b02db74c58161e Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 11:50:43 -0800 Subject: [PATCH 38/58] So the schema is accessible --- index.html => old_index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename index.html => old_index.html (100%) diff --git a/index.html b/old_index.html similarity index 100% rename from index.html rename to old_index.html From 7af094b23edf28b17641379d3b25992fcf495f3f Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 12:15:07 -0800 Subject: [PATCH 39/58] Updates to match latest json activity spec --- action.json | 4 ++-- activity.json | 27 +++++++++++++++++++-------- core_object.json | 16 +++++++++------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/action.json b/action.json index 7b965d8..fefd571 100644 --- a/action.json +++ b/action.json @@ -8,11 +8,11 @@ "type" : "string", "default": "post", "optional" : "true", - "description" :"Represents the type of action performed: post(add), update or delete" + "description" :"Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the "isegment-nz-nc" or the "IRI" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed" }, "object" : { "type": "object", - "description" : "Identifies the object to which the verb applies. Ex: Added a photo", + "description" : "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 whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context", "properties" : {"$ref":"./object.json#properties"} } } diff --git a/activity.json b/activity.json index e01c424..fbc1fa0 100644 --- a/activity.json +++ b/activity.json @@ -10,7 +10,7 @@ }, "actor" : { "type": "object", - "description": "Identifies the entity that performed the activity. Example: A person or user", + "description": "Describes the entity that performed the activity. An activity MUST contain one actor property whose value is a single Object.", "properties" : {"$ref":"./object.json#properties"}, "optional" : true }, @@ -29,35 +29,46 @@ "target" : { "type": "object", "optional" : true, - "description" : "Represents the object to which the activity was performed. Example: A photo album", + "description" : "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. An activity MAY contain a target property whose value is a single Object.", "properties" : {"$ref":"./object.json#properties"} }, - "time" : { + "postedTime" : { "type" : "string", - "description": "Time at which the activity occurred", + "description": "The date and time at which the activity occurred. It is important to note that this is not necessarily the same as the time at which the activity was published. An activity MUST contain a postedTime property.", + "format" : "date" + }, + "updatedTime" : { + "type" : "string", + "optional" : true, + "description": "The date and time at which a previously published activity has been modified. An Activity MAY contain an updatedTime property", "format" : "date" }, "generator" : { "type": "object", - "description": "Represents the application which created the activity, which may be separate from the service to which the activity is published. For example, a third-party application on a mobile phone may be used to post a photo to a photo sharing service.", + "description": "Describes the application that generated the activity. An activity MAY contain a generator property whose value is a single Object.", "optional" : true, "properties" : {"$ref":"./object.json#properties"} }, + "icon" : { + "type": "string", + "optional" : true, + "description": "An IRI[RFC3987] identifying an image resource provides a visual representation of the activity, intended for human consumption. The image SHOULD have an aspect ratio of one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size. An activity MAY have an icon property" + }, "provider" : { "type": "object", - "description" : "Represents the service which is publishing the activity", + "description" : "Describes the application that published the activity. Note that this is not necessarily the same entity that generated the activity. An activity MAY contain a provider property whose value is a single Object", "optional" : true, "properties" : {"$ref":"./object.json#properties"} }, "title" : { "type" : "string", - "description" : "An HTML representation of the natural language title for this activity. Consumers MAY use the value of this field, if set, as a fallback for when none of the provided verbs are recognized", + "description" : "Natural-language title or headline for the activity encoded as a single JSON String containing HTML markup. An activity MAY contain a title property", "format": "html", "optional" : true }, "body" : { "type" : "string", - "description" : "An HTML representation of a natural language describing this activity including visual elements such as thumbnails. Consumers MAY use the value of this field, if set, as a fallback for when none of the provided verbs are recognized", + "description" : "Natural-language description of the activity encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a body property.", "format" : "html", "optional" : true }, diff --git a/core_object.json b/core_object.json index a73a11f..8ba621d 100644 --- a/core_object.json +++ b/core_object.json @@ -10,27 +10,29 @@ }, "image" : { "format":"image", - "type":"string", - "description" : "A representative image of the object such as a profile picture for a person", + "type":"object", + "properties" :{"$ref":"./media_link.json#properties"} + "description" : "Description of a resource providing a visual representation of the object, intended for human consumption. An object MAY contain an image property whose value is a Media Link.", "optional":true }, "displayName" : { "type":"string", - "description" : "The name of the object. Made required except for photos which will have a default" + "description" : "A natural-language, human-readable and plain-text name for the object. HTML markup MUST NOT be included. An object MAY contain a displayName property" }, "summary" : { "type" : "string", - "optional":true + "optional":true, + "description" : "Natural-language description of the object encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a summary property" }, - "link" : { + "url" : { "type" : "string", "format" : "url", - "description" : "Permalink to the object.", + "description" : "An IRI [RFC3987] identifying a resource providing an HTML representation of the object. An object MAY contain a url property", "optional":true }, "objectType" :{ "type" : "string", - "description" : "The type of social object used to select schema", + "description" : "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the "isegment-nz-nc" or the "IRI" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type.", "optional" : true }, "author" : { From a5a7699a7d6d0562f5de1a63b5168726e8917db1 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 12:16:29 -0800 Subject: [PATCH 40/58] Escaping quotes --- action.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.json b/action.json index fefd571..9fd3c5f 100644 --- a/action.json +++ b/action.json @@ -8,11 +8,11 @@ "type" : "string", "default": "post", "optional" : "true", - "description" :"Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the "isegment-nz-nc" or the "IRI" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed" + "description" :"Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed" }, "object" : { "type": "object", - "description" : "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 whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context", + "description" : "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 whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context", "properties" : {"$ref":"./object.json#properties"} } } From 2025a80a892b7a8228e36f7c516e2d78ff5b4782 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 12:47:20 -0800 Subject: [PATCH 41/58] Updated to show reactions --- feed.json | 6 +++++- media_link.json | 29 +++++++++++++++++++++++++++++ reactions.json | 35 +++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 media_link.json diff --git a/feed.json b/feed.json index 3e50a87..65e5d9c 100644 --- a/feed.json +++ b/feed.json @@ -10,10 +10,14 @@ }, "subject" : { "type" : "object", - "description" : "The main object of the feed. All objects default to being inReplyTo this object. If not present its the parent object", + "description" : "The main object the activities are grouped by. All objects default to being inReplyTo this object. If not present its the parent object", "optional" : true, "properties" :{"$ref":"./object.json#properties"} }, + "count": { + "type" : "number", + "description" : "The total number of items" + }, "items" : { "type" : "array", "items": { diff --git a/media_link.json b/media_link.json new file mode 100644 index 0000000..144ec6d --- /dev/null +++ b/media_link.json @@ -0,0 +1,29 @@ +{ + "type" : "object", + "title" : "media_link", + "description" : "Visual representation of an object in the form of an image, video or embedded HTML fragments", + "properties": { + "duration" : { + "title" : "duration", + "type" : "number", + "optional" : "true", + "description" :"A hint to the consumer about the length, in seconds, of the media resource identified by the url property. A media link MAY contain a \"duration\" property when the target resource is a time-based media item such as an audio or video." + }, + "height" : { + "title" : "height", + "type" : "number", + "optional" : "true", + "description" :"A hint to the consumer about the height, in pixels, of the media resource identified by the url property. A media link MAY contain a height property when the target resource is a visual media item such as an image, video or embeddable HTML page." + }, + "width" : { + "title" : "width", + "type" : "number", + "optional" : "true", + "description" :"A hint to the consumer about the width, in pixels, of the media resource identified by the url property. A media link MAY contain a width property when the target resource is a visual media item such as an image, video or embeddable HTML page." + }, + "url" : { + "type": "string", + "description" : "The IRI of the media resource being linked. A media link MUST have a url property." + } + } +} diff --git a/reactions.json b/reactions.json index bf1eac4..2c360bf 100644 --- a/reactions.json +++ b/reactions.json @@ -4,6 +4,7 @@ "properties" : { "inReplyTo" : { "optional" : true, + "description" : "Not needed if nested", "type" : [ {"$ref" : "./object.json"}, {"$ref" : "./activity.json"} @@ -26,24 +27,26 @@ } }, "example" : { - "inReplyTo" : { - "objectType" : "photo", - "link" : "http://www.facebook.com/photo.php?pid=6139638&id=608201527" - }, - "verb" : "like", - "count" : 2, + "likes" : { + "inReplyTo" : { + "objectType" : "photo", + "link" : "http://www.facebook.com/photo.php?pid=6139638&id=608201527" + }, + "verb" : "like", + "count" : 2, "items" : [ - { - "displayName" : "Monica", - "objectType" : "person", - "link" : "http://www.facebook.com/ciberch" - }, - { - "displayName" : "Nick", - "objectType" : "person", - "link" : "http://www.facebook.com/nicolasbertrand" + { + "displayName" : "Monica", + "objectType" : "person", + "link" : "http://www.facebook.com/ciberch" + }, + { + "displayName" : "Nick", + "objectType" : "person", + "link" : "http://www.facebook.com/nicolasbertrand" + } + ] } - ] } } } \ No newline at end of file From 97c31235633eefb109eaf80e5d67d4258fbbeab6 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 12:48:51 -0800 Subject: [PATCH 42/58] Double quote escape --- activity.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity.json b/activity.json index fbc1fa0..823e374 100644 --- a/activity.json +++ b/activity.json @@ -29,7 +29,7 @@ "target" : { "type": "object", "optional" : true, - "description" : "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. An activity MAY contain a target property whose value is a single Object.", + "description" : "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. An activity MAY contain a target property whose value is a single Object.", "properties" : {"$ref":"./object.json#properties"} }, "postedTime" : { From 16556b330ac6da70dc9e2f98d775792c9f139401 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 12:52:44 -0800 Subject: [PATCH 43/58] Match spec on activity.json -- verb is optional tho --- activity.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activity.json b/activity.json index 823e374..48d788e 100644 --- a/activity.json +++ b/activity.json @@ -19,11 +19,11 @@ "type" : "string", "default": "post", "optional" : "true", - "description" :"Represents the type of action performed by the actor." + "description" :"Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed." }, "object" : { "type": "object", - "description" : "Identifies the primary object of the activity. Example: A photo", + "description" : "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 whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context.", "properties" : {"$ref":"./object.json#properties"} }, "target" : { From 884ce102a2b0f3d7f9bcb1c63e706187ec1a3b01 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 13:02:37 -0800 Subject: [PATCH 44/58] Likes and Comments --- core_object.json | 10 +++++----- object.json | 30 +++++++++++------------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/core_object.json b/core_object.json index 8ba621d..59169ae 100644 --- a/core_object.json +++ b/core_object.json @@ -5,13 +5,13 @@ "properties" : { "id" : { "type" : "string", - "description" : "Uniquely identifies the object on the service", + "description" : "Provides a permanent, universally unique identifier for the object in the form of an absolute IRI [RFC3987]. An object 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.", "default" : "{link}" }, "image" : { "format":"image", "type":"object", - "properties" :{"$ref":"./media_link.json#properties"} + "properties" :{"$ref":"./media_link.json#properties"}, "description" : "Description of a resource providing a visual representation of the object, intended for human consumption. An object MAY contain an image property whose value is a Media Link.", "optional":true }, @@ -32,16 +32,16 @@ }, "objectType" :{ "type" : "string", - "description" : "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the "isegment-nz-nc" or the "IRI" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type.", + "description" : "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type.", "optional" : true }, "author" : { "type" : "object", "optional" : true, - "description" : "Entity who posted this object", + "description" : "Entity who posted this object. Could also be called owner", "properties" : {"$ref":"#properties"} }, - "time" : { + "createdTime" : { "optional" : true, "type" : "string", "description": "Time at which the object was created. We should a last updated time.", diff --git a/object.json b/object.json index 26dd7f6..d052c30 100644 --- a/object.json +++ b/object.json @@ -11,32 +11,24 @@ "type": "object", "properties" :{"$ref":"#properties"} }, - "replies":{ + "comments":{ "optional" : true, - "type" : "array", + "type" : "object", "uniqueItems" : true, - "description" : "An array of feeds. Each feed has an array of activities which were done in response to this object", - "items": { - "type" : "object", - "properties" :{"$ref":"./feed.json#properties"} - } + "description" : "All the comments in response to this object", + "properties" :{"$ref":"./feed.json#properties"} }, - "reactions":{ + "likes":{ "optional" : true, - "description" : "An array of reactions. A reactions object is itself an array of people who all had the same reaction", - "type" : "array", - "uniqueItems" : true, - "items": { - "type" : "object", - "properties" :{ - "$ref":"./reactions.json#properties" - } + "description" : "All the likes in response to this object", + "type" : "object", + "properties" : {"$ref":"./reactions.json#properties"} } }, "attachedObjects":{ "optional" : true, "title" : "Related objects", - "description" : "An array of objects which are related to this object...Generally photos for an article. This needs more clarification", + "description" : "A collection of one or more additional, associated objects, similar to the concept of attached files in an email message. An object MAY have an attachedObjects property whose value is a JSON Array of Objects.", "type" : "array", "items": { "type" : "object", @@ -46,13 +38,13 @@ "upstreamDuplicates":{ "optional" : true, "type" : "array", - "description" : "When a publisher changes the id they can put the original id of the object in this field so consumers can de-duplicate", + "description" : "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain an upstreamDuplicates property when a publisher is knowingly duplicating with a new ID the content from another object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources", "items": {"type" : "string"} }, "downstreamDuplicates":{ "optional" : true, "type" : "array", - "description" : "When a publisher creates a clone object in another system they can put that id here in order to let the consumer know how to de-duplicate", + "description" : "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain a downstreamDuplicates property when there are known objects, possibly in a different system, that duplicate the content in this object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources.", "items": {"type" : "string"} } }, From 79b5710249828b10e83fa2bf3891b23b6552a93f Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Thu, 3 Mar 2011 13:06:53 -0800 Subject: [PATCH 45/58] Braces --- object.json | 1 - 1 file changed, 1 deletion(-) diff --git a/object.json b/object.json index d052c30..44066d5 100644 --- a/object.json +++ b/object.json @@ -23,7 +23,6 @@ "description" : "All the likes in response to this object", "type" : "object", "properties" : {"$ref":"./reactions.json#properties"} - } }, "attachedObjects":{ "optional" : true, From cbea5ddf1609d3bb2bb4f4a98f23546b04469a91 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Fri, 4 Mar 2011 08:46:39 -0800 Subject: [PATCH 46/58] old_index.html --- README | 6 ++++-- old_index.html | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README b/README index a58bcd6..95f5eb6 100644 --- a/README +++ b/README @@ -4,6 +4,8 @@ http://activitystrea.ms/head/json-activity.html The syntax of the schema is defined at http://json-schema.org/ -This is work in progress. I will also add a version using orderly -http://orderly-json.org/ +To test you can use the following library: +https://github.com/Constellation/ruby-jsonchema + +More libraries available in http://json-schema.org/ diff --git a/old_index.html b/old_index.html index e38efe9..175f81f 100644 --- a/old_index.html +++ b/old_index.html @@ -15,17 +15,16 @@

ActivityStreams

- From 2fe07bfcb5dda6c310bb5e42af4cd58b2facfe0f Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 23 Mar 2011 11:35:42 -0700 Subject: [PATCH 47/58] Restore Stream Discussion --- old_index.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/old_index.html b/old_index.html index 175f81f..c5615e4 100644 --- a/old_index.html +++ b/old_index.html @@ -16,18 +16,18 @@

ActivityStreams

+ var _reach = _reach || []; + _reach.push({ + container: 'reach_container_id', + domain: 'https://montrics-com.socialcast.com/', + token: 'b53048e5ced02b8c7429' + }); + (function(){ + var e=document.createElement('script'); e.type='text/javascript'; e.async = true; + e.src= document.location.protocol + '//montrics-com.socialcast.com/services/reach/extension.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); + })(); +
Watch live streaming video from activitystreams at livestream.com
From 6bdb059e51e7c86e6f7c258cb8ef54ce0a3f1f07 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 23 Mar 2011 11:36:04 -0700 Subject: [PATCH 48/58] renamed --- old_index.html => meetup.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename old_index.html => meetup.html (100%) diff --git a/old_index.html b/meetup.html similarity index 100% rename from old_index.html rename to meetup.html From c3a24fce7c0c88477ec5aca83be610829fd2d39f Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Wed, 23 Mar 2011 11:36:53 -0700 Subject: [PATCH 49/58] Clear old --- old_index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 old_index.html diff --git a/old_index.html b/old_index.html new file mode 100644 index 0000000..6c70bcf --- /dev/null +++ b/old_index.html @@ -0,0 +1 @@ + \ No newline at end of file From 4f642a13ec315187c85d3d0dfe80f154214a8c05 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Fri, 1 Apr 2011 18:16:29 -0700 Subject: [PATCH 50/58] Topic stream --- meetup.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meetup.html b/meetup.html index c5615e4..4c3d9de 100644 --- a/meetup.html +++ b/meetup.html @@ -17,10 +17,15 @@

ActivityStreams

-
-
Watch live streaming video from activitystreams at livestream.com
-
- - diff --git a/object.json b/object.json index f1ee654..87c60b9 100644 --- a/object.json +++ b/object.json @@ -36,19 +36,19 @@ "description" : "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type." }, "author" : { - "type" : "object" + "type" : "object", "description" : "Describes the entity that created or authored the object. An object MAY contain a single author property whose value is an Object of any type. Note that the author field identifies the entity that created the object and does not necessarily identify the entity that published the object. For instance, it may be the case that an object created by one person is posted and published to a system by an entirely different entity", "properties" : {"$ref":"#properties"} }, "published" : { "type" : "string", "description": "[RFC3339] date-time. The date and time at which the object was published. An object MAY contain a published property", - "format" : "date" + "format" : "date-time" }, "updated" : { "type" : "string", "description": "[RFC3339] date-time. The date and time at which a previously published object has been modified. An Object MAY contain an updated property.", - "format" : "date" + "format" : "date-time" }, "attachments":{ "title" : "Related objects", diff --git a/old_index.html b/old_index.html deleted file mode 100644 index 6c70bcf..0000000 --- a/old_index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/reactions.json b/reactions.json deleted file mode 100644 index 2c360bf..0000000 --- a/reactions.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "type" : "object", - "description" : "This type represents a list of people who had the same reaction represented by the verb to the same object. Subject to change.", - "properties" : { - "inReplyTo" : { - "optional" : true, - "description" : "Not needed if nested", - "type" : [ - {"$ref" : "./object.json"}, - {"$ref" : "./activity.json"} - ] - }, - "verb" : { - "type" : "string" - }, - "count" : { - "type" : "number", - "description" : "The total number of people who had the reaction" - }, - "items" : { - "type" : "array", - "uniqueItems" : true, - "description" : "An array of unique people who had the same reaction to the same object. May be a subset", - "items" : { - "type" : "object", - "properties" :{"$ref":"./person.json#properties"} - } - }, - "example" : { - "likes" : { - "inReplyTo" : { - "objectType" : "photo", - "link" : "http://www.facebook.com/photo.php?pid=6139638&id=608201527" - }, - "verb" : "like", - "count" : 2, - "items" : [ - { - "displayName" : "Monica", - "objectType" : "person", - "link" : "http://www.facebook.com/ciberch" - }, - { - "displayName" : "Nick", - "objectType" : "person", - "link" : "http://www.facebook.com/nicolasbertrand" - } - ] - } - } - } -} \ No newline at end of file From 56612ae460f5302f91c6f023ff8aceb8f187723d Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Sun, 15 May 2011 22:49:24 -0700 Subject: [PATCH 57/58] typo --- activity.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity.json b/activity.json index f7a6909..1b13c09 100644 --- a/activity.json +++ b/activity.json @@ -6,7 +6,7 @@ "id" :{ "type" : "string", "description" : "Uniquely identifies each activity within the service", - "default" :"{link}" + "default" :"{url}" }, "actor" : { "type": "object", From 1807f7d8ffc2d499311300a1aa6156d49adfbc67 Mon Sep 17 00:00:00 2001 From: Monica Wilkinson Date: Sun, 15 May 2011 23:03:45 -0700 Subject: [PATCH 58/58] Copied schema --- activity.json => schema/activity.json | 0 collection.json => schema/collection.json | 0 {library => schema/library}/jsonschema-b4.js | 0 {library => schema/library}/ref.js | 0 {library => schema/library}/schema.js | 0 media_link.json => schema/media_link.json | 0 object.json => schema/object.json | 0 {objectTypes => schema/objectTypes}/article.json | 0 {objectTypes => schema/objectTypes}/audio.json | 0 {objectTypes => schema/objectTypes}/bookmark.json | 0 {objectTypes => schema/objectTypes}/comment.json | 0 {objectTypes => schema/objectTypes}/event.json | 0 {objectTypes => schema/objectTypes}/file.json | 0 {objectTypes => schema/objectTypes}/folder.json | 0 {objectTypes => schema/objectTypes}/group.json | 0 {objectTypes => schema/objectTypes}/list.json | 0 {objectTypes => schema/objectTypes}/note.json | 0 {objectTypes => schema/objectTypes}/person.json | 0 {objectTypes => schema/objectTypes}/photo-album.json | 0 {objectTypes => schema/objectTypes}/photo.json | 0 {objectTypes => schema/objectTypes}/place.json | 0 {objectTypes => schema/objectTypes}/playlist.json | 0 {objectTypes => schema/objectTypes}/product.json | 0 {objectTypes => schema/objectTypes}/property.json | 0 {objectTypes => schema/objectTypes}/review.json | 0 {objectTypes => schema/objectTypes}/service.json | 0 {objectTypes => schema/objectTypes}/song.json | 0 {objectTypes => schema/objectTypes}/status.json | 0 {objectTypes => schema/objectTypes}/video.json | 0 {verbs => schema/verbs}/favorite.json | 0 {verbs => schema/verbs}/follow.json | 0 {verbs => schema/verbs}/join.json | 0 {verbs => schema/verbs}/like.json | 0 {verbs => schema/verbs}/make-friend.json | 0 {verbs => schema/verbs}/play.json | 0 {verbs => schema/verbs}/post.json | 0 {verbs => schema/verbs}/rsvp-maybe.json | 0 {verbs => schema/verbs}/rsvp-no.json | 0 {verbs => schema/verbs}/rsvp-yes.json | 0 {verbs => schema/verbs}/save.json | 0 {verbs => schema/verbs}/share.json | 0 {verbs => schema/verbs}/tag.json | 0 {verbs => schema/verbs}/update-multiple.json | 0 {verbs => schema/verbs}/update.json | 0 44 files changed, 0 insertions(+), 0 deletions(-) rename activity.json => schema/activity.json (100%) rename collection.json => schema/collection.json (100%) rename {library => schema/library}/jsonschema-b4.js (100%) rename {library => schema/library}/ref.js (100%) rename {library => schema/library}/schema.js (100%) rename media_link.json => schema/media_link.json (100%) rename object.json => schema/object.json (100%) rename {objectTypes => schema/objectTypes}/article.json (100%) rename {objectTypes => schema/objectTypes}/audio.json (100%) rename {objectTypes => schema/objectTypes}/bookmark.json (100%) rename {objectTypes => schema/objectTypes}/comment.json (100%) rename {objectTypes => schema/objectTypes}/event.json (100%) rename {objectTypes => schema/objectTypes}/file.json (100%) rename {objectTypes => schema/objectTypes}/folder.json (100%) rename {objectTypes => schema/objectTypes}/group.json (100%) rename {objectTypes => schema/objectTypes}/list.json (100%) rename {objectTypes => schema/objectTypes}/note.json (100%) rename {objectTypes => schema/objectTypes}/person.json (100%) rename {objectTypes => schema/objectTypes}/photo-album.json (100%) rename {objectTypes => schema/objectTypes}/photo.json (100%) rename {objectTypes => schema/objectTypes}/place.json (100%) rename {objectTypes => schema/objectTypes}/playlist.json (100%) rename {objectTypes => schema/objectTypes}/product.json (100%) rename {objectTypes => schema/objectTypes}/property.json (100%) rename {objectTypes => schema/objectTypes}/review.json (100%) rename {objectTypes => schema/objectTypes}/service.json (100%) rename {objectTypes => schema/objectTypes}/song.json (100%) rename {objectTypes => schema/objectTypes}/status.json (100%) rename {objectTypes => schema/objectTypes}/video.json (100%) rename {verbs => schema/verbs}/favorite.json (100%) rename {verbs => schema/verbs}/follow.json (100%) rename {verbs => schema/verbs}/join.json (100%) rename {verbs => schema/verbs}/like.json (100%) rename {verbs => schema/verbs}/make-friend.json (100%) rename {verbs => schema/verbs}/play.json (100%) rename {verbs => schema/verbs}/post.json (100%) rename {verbs => schema/verbs}/rsvp-maybe.json (100%) rename {verbs => schema/verbs}/rsvp-no.json (100%) rename {verbs => schema/verbs}/rsvp-yes.json (100%) rename {verbs => schema/verbs}/save.json (100%) rename {verbs => schema/verbs}/share.json (100%) rename {verbs => schema/verbs}/tag.json (100%) rename {verbs => schema/verbs}/update-multiple.json (100%) rename {verbs => schema/verbs}/update.json (100%) diff --git a/activity.json b/schema/activity.json similarity index 100% rename from activity.json rename to schema/activity.json diff --git a/collection.json b/schema/collection.json similarity index 100% rename from collection.json rename to schema/collection.json diff --git a/library/jsonschema-b4.js b/schema/library/jsonschema-b4.js similarity index 100% rename from library/jsonschema-b4.js rename to schema/library/jsonschema-b4.js diff --git a/library/ref.js b/schema/library/ref.js similarity index 100% rename from library/ref.js rename to schema/library/ref.js diff --git a/library/schema.js b/schema/library/schema.js similarity index 100% rename from library/schema.js rename to schema/library/schema.js diff --git a/media_link.json b/schema/media_link.json similarity index 100% rename from media_link.json rename to schema/media_link.json diff --git a/object.json b/schema/object.json similarity index 100% rename from object.json rename to schema/object.json diff --git a/objectTypes/article.json b/schema/objectTypes/article.json similarity index 100% rename from objectTypes/article.json rename to schema/objectTypes/article.json diff --git a/objectTypes/audio.json b/schema/objectTypes/audio.json similarity index 100% rename from objectTypes/audio.json rename to schema/objectTypes/audio.json diff --git a/objectTypes/bookmark.json b/schema/objectTypes/bookmark.json similarity index 100% rename from objectTypes/bookmark.json rename to schema/objectTypes/bookmark.json diff --git a/objectTypes/comment.json b/schema/objectTypes/comment.json similarity index 100% rename from objectTypes/comment.json rename to schema/objectTypes/comment.json diff --git a/objectTypes/event.json b/schema/objectTypes/event.json similarity index 100% rename from objectTypes/event.json rename to schema/objectTypes/event.json diff --git a/objectTypes/file.json b/schema/objectTypes/file.json similarity index 100% rename from objectTypes/file.json rename to schema/objectTypes/file.json diff --git a/objectTypes/folder.json b/schema/objectTypes/folder.json similarity index 100% rename from objectTypes/folder.json rename to schema/objectTypes/folder.json diff --git a/objectTypes/group.json b/schema/objectTypes/group.json similarity index 100% rename from objectTypes/group.json rename to schema/objectTypes/group.json diff --git a/objectTypes/list.json b/schema/objectTypes/list.json similarity index 100% rename from objectTypes/list.json rename to schema/objectTypes/list.json diff --git a/objectTypes/note.json b/schema/objectTypes/note.json similarity index 100% rename from objectTypes/note.json rename to schema/objectTypes/note.json diff --git a/objectTypes/person.json b/schema/objectTypes/person.json similarity index 100% rename from objectTypes/person.json rename to schema/objectTypes/person.json diff --git a/objectTypes/photo-album.json b/schema/objectTypes/photo-album.json similarity index 100% rename from objectTypes/photo-album.json rename to schema/objectTypes/photo-album.json diff --git a/objectTypes/photo.json b/schema/objectTypes/photo.json similarity index 100% rename from objectTypes/photo.json rename to schema/objectTypes/photo.json diff --git a/objectTypes/place.json b/schema/objectTypes/place.json similarity index 100% rename from objectTypes/place.json rename to schema/objectTypes/place.json diff --git a/objectTypes/playlist.json b/schema/objectTypes/playlist.json similarity index 100% rename from objectTypes/playlist.json rename to schema/objectTypes/playlist.json diff --git a/objectTypes/product.json b/schema/objectTypes/product.json similarity index 100% rename from objectTypes/product.json rename to schema/objectTypes/product.json diff --git a/objectTypes/property.json b/schema/objectTypes/property.json similarity index 100% rename from objectTypes/property.json rename to schema/objectTypes/property.json diff --git a/objectTypes/review.json b/schema/objectTypes/review.json similarity index 100% rename from objectTypes/review.json rename to schema/objectTypes/review.json diff --git a/objectTypes/service.json b/schema/objectTypes/service.json similarity index 100% rename from objectTypes/service.json rename to schema/objectTypes/service.json diff --git a/objectTypes/song.json b/schema/objectTypes/song.json similarity index 100% rename from objectTypes/song.json rename to schema/objectTypes/song.json diff --git a/objectTypes/status.json b/schema/objectTypes/status.json similarity index 100% rename from objectTypes/status.json rename to schema/objectTypes/status.json diff --git a/objectTypes/video.json b/schema/objectTypes/video.json similarity index 100% rename from objectTypes/video.json rename to schema/objectTypes/video.json diff --git a/verbs/favorite.json b/schema/verbs/favorite.json similarity index 100% rename from verbs/favorite.json rename to schema/verbs/favorite.json diff --git a/verbs/follow.json b/schema/verbs/follow.json similarity index 100% rename from verbs/follow.json rename to schema/verbs/follow.json diff --git a/verbs/join.json b/schema/verbs/join.json similarity index 100% rename from verbs/join.json rename to schema/verbs/join.json diff --git a/verbs/like.json b/schema/verbs/like.json similarity index 100% rename from verbs/like.json rename to schema/verbs/like.json diff --git a/verbs/make-friend.json b/schema/verbs/make-friend.json similarity index 100% rename from verbs/make-friend.json rename to schema/verbs/make-friend.json diff --git a/verbs/play.json b/schema/verbs/play.json similarity index 100% rename from verbs/play.json rename to schema/verbs/play.json diff --git a/verbs/post.json b/schema/verbs/post.json similarity index 100% rename from verbs/post.json rename to schema/verbs/post.json diff --git a/verbs/rsvp-maybe.json b/schema/verbs/rsvp-maybe.json similarity index 100% rename from verbs/rsvp-maybe.json rename to schema/verbs/rsvp-maybe.json diff --git a/verbs/rsvp-no.json b/schema/verbs/rsvp-no.json similarity index 100% rename from verbs/rsvp-no.json rename to schema/verbs/rsvp-no.json diff --git a/verbs/rsvp-yes.json b/schema/verbs/rsvp-yes.json similarity index 100% rename from verbs/rsvp-yes.json rename to schema/verbs/rsvp-yes.json diff --git a/verbs/save.json b/schema/verbs/save.json similarity index 100% rename from verbs/save.json rename to schema/verbs/save.json diff --git a/verbs/share.json b/schema/verbs/share.json similarity index 100% rename from verbs/share.json rename to schema/verbs/share.json diff --git a/verbs/tag.json b/schema/verbs/tag.json similarity index 100% rename from verbs/tag.json rename to schema/verbs/tag.json diff --git a/verbs/update-multiple.json b/schema/verbs/update-multiple.json similarity index 100% rename from verbs/update-multiple.json rename to schema/verbs/update-multiple.json diff --git a/verbs/update.json b/schema/verbs/update.json similarity index 100% rename from verbs/update.json rename to schema/verbs/update.json