Base Content Profile

Scott Smith edited this page Jun 17, 2014 · 41 revisions

What is Base Content Profile?

Using hypermedia type Collection.doc+JSON and profiles allows great flexibility in defining various content/document types in PMP. With great flexibility comes great responsibility, obviously. To promote reusability, PMP defines a base content profile that extends the PMP Core Profile and encourages any content profile to extend it.

The benefit of extending base content profile when designing your profile is that API clients can recognize profile inheritance and leverage their understanding of the base content profile. For instance, even if a particular client has never seen your custom profile, if your profile extends the base content one it will know what fields such as "byline" mean, and how to treat a whole bunch of link relations. It will apply "MUST IGNORE" to the rest of the fields.

View it at https://api.pmp.io/profiles/base

Sample Document of Base Content Profile Type

Following is a sample content item that demonstrates fields defined in the base content profile.

ATTENTION: this is just for demonstration purposes. It is very unlikely (and highly discouraged) that anybody would publish a document of the base content profile type, in real usage.

{
  "version" : "1.0"
, "attributes" : {  
    "guid"        : "db073870-0000-487c-9253-fb31098c42b8"
  , "title"       : "Some Title"
  , "published"   : "2013-04-11T13:21:31.598Z"
  , "valid"       : { "from" : "2013-04-11T13:21:31.598Z"
                    , "to"   : "3013-04-11T13:21:31.598Z"}
  , "created"     : "2013-02-11T13:21:31.598Z"
  , "modified"    : "2013-03-11T13:21:31.598Z"
  , "byline"      : "By: Bryan Naylor & Christopher Joyce"
  , "description" : ""
  , "tags"    : ["lorem", "ipsum", "dolor"]
  , "hreflang"    : "ISO639-1 code" 
  }
, "items" : []   
   
, "links" : {
    "profile"      : [ { "href" : "http://api.pmp.io/profiles/base"
                       , "type" : "application/vnd.pmp.collection.doc+json" }]
  , "self"         : [ { "href" : "http://api.pmp.io/docs/db073870-0000-487c-9253-fb31098c42b8?offset=20&limit=10"}]
  , "prev"         : [ { "href" : "http://api.pmp.io/docs/db073870-0000-487c-9253-fb31098c42b8?offset=10&limit=10"}]
  , "next"         : [ { "href" : "http://api.pmp.io/docs/db073870-0000-487c-9253-fb31098c42b8?offset=30&limit=10"}]
  , "collection"   : [ { "href" : "http://api.pmp.io/docs/5676eebf-0261-4de9-95e4-762f9b8d5039"}
                     , { "href" : "http://api.pmp.io/docs/eb3904f2-ddfd-4dcf-8614-c989dcec88ab"}]  
  , "copyright"    : [ { "href" : "http://npr.org", "title": "Copyright (C) NPR, 2012." }]
  , "creator"      : [ { "href" : "http://api.pmp.io/docs/dcb5b7fa-0a9b-41de-8081-bf1573796eca", "title": "PRX" }]
  , "distributor"  : [ { "href" : "http://api.pmp.io/docs/d3e6b4b3-aa31-4254-9eb2-3fc04d8be304", "title": "NPR"}
                     , { "href" : "http://api.pmp.io/docs/dcb5b7fa-0a9b-41de-8081-bf1573796eca", "title": "PRX"}]                     
  , "permission"   : [ARRAY]
  , "author"       : [ { "href" : "http://api.pmp.io/docs/4181ec1f-baf9-4a33-bd78-0f0a9f20ed80", "title": "Bryan Naylor" }
                     , { "href" : "http://api.pmp.io/docs/25c2bad1-b94b-4256-984b-180ba1f96a0e", "title": "Christopher Joyce"}]
  , "alternate"    : [ { "hreflang": "fr", "type": "application/vnd.pmp.collection.doc+json"
                       , "href" : "http://api.pmp.io/docs/ef61593e-f1f9-4400-a321-c301cf7e13fe"}
                     , { "hreflang": "es", "type": "application/vnd.pmp.collection.doc+json"
                       , "href" : "http://api.pmp.io/docs/ef07f2e6-5f78-4c52-9678-17f41fcc25e1", }
                     , {"href" : "http://www.npr.org/blogs/thetwo-way/2013/02/11/171680715/pope-benedict-xvi-is-resigning", "hreflang": "en", "type": "text/html"}]
  , "queries"      : [ {"href" : "http://api.pmp.io/docs/queries",   "type": "application/vnd.pmp.query+json"}]
  , "edit-form"    : [ {"href" : "http://api.pmp.io/docs-validator", "type" :   "application/json"}]
  }  
, "error" : {OBJECT}
}

Attributes

Inherits all attributes of the PMP Core Profile and adds the following attributes:

  • title - required. Title of the story.
  • byline - optional. A rendered byline as suggested by the content distributor. API clients may chose to render custom, more 'sophisticated' byline using author link relation instead.
  • description - optional. The synopsis of the content item.

Link Relations

Inherits all link relations of the PMP Core Profile and adds the following link relations:

  • copyright - optional. An array of hrefs representing granular list of copyright holders