Categories
BLOG

og m

The Open Graph protocol

Introduction

The Open Graph protocol enables any web page to become a rich object in a social graph. For instance, this is used on Facebook to allow any web page to have the same functionality as any other object on Facebook.

While many different technologies and schemas exist and could be combined together, there isn’t a single technology which provides enough information to richly represent any web page within the social graph. The Open Graph protocol builds on these existing technologies and gives developers one thing to implement. Developer simplicity is a key goal of the Open Graph protocol which has informed many of the technical design decisions.

Basic Metadata

To turn your web pages into graph objects, you need to add basic metadata to your page. We’ve based the initial version of the protocol on RDFa which means that you’ll place additional tags in the of your web page. The four required properties for every page are:

  • og:title – The title of your object as it should appear within the graph, e.g., “The Rock”.
  • og:type – The type of your object, e.g., “video.movie”. Depending on the type you specify, other properties may also be required.
  • og:image – An image URL which should represent your object within the graph.
  • og:url – The canonical URL of your object that will be used as its permanent ID in the graph, e.g., “https://www.imdb.com/title/tt0117500/”.

As an example, the following is the Open Graph protocol markup for The Rock on IMDB:

Optional Metadata

The following properties are optional for any object and are generally recommended:

  • og:audio – A URL to an audio file to accompany this object.
  • og:description – A one to two sentence description of your object.
  • og:determiner – The word that appears before this object’s title in a sentence. An enum of (a, an, the, “”, auto). If auto is chosen, the consumer of your data should chose between “a” or “an”. Default is “” (blank).
  • og:locale – The locale these tags are marked up in. Of the format language_TERRITORY . Default is en_US .
  • og:locale:alternate – An array of other locales this page is available in.
  • og:site_name – If your object is part of a larger web site, the name which should be displayed for the overall site. e.g., “IMDb”.
  • og:video – A URL to a video file that complements this object.

For example (line-break solely for display purposes):

The RDF schema (in Turtle) can be found at ogp.me/ns.

Structured Properties

Some properties can have extra metadata attached to them. These are specified in the same way as other metadata with property and content , but the property will have extra : .

The og:image property has some optional structured properties:

  • og:image:url – Identical to og:image .
  • og:image:secure_url – An alternate url to use if the webpage requires HTTPS.
  • og:image:type – A MIME type for this image.
  • og:image:width – The number of pixels wide.
  • og:image:height – The number of pixels high.
  • og:image:alt – A description of what is in the image (not a caption). If the page specifies an og:image it should specify og:image:alt .

A full image example:

The og:video tag has the identical tags as og:image . Here is an example:

The og:audio tag only has the first 3 properties available (since size doesn’t make sense for sound):

Arrays

If a tag can have multiple values, just put multiple versions of the same tag on your page. The first tag (from top to bottom) is given preference during conflicts.

Put structured properties after you declare their root tag. Whenever another root element is parsed, that structured property is considered to be done and another one is started.

means there are 3 images on this page, the first image is 300×300 , the middle one has unspecified dimensions, and the last one is 1000 px tall.

Object Types

In order for your object to be represented within the graph, you need to specify its type. This is done using the og:type property:

When the community agrees on the schema for a type, it is added to the list of global types. All other objects in the type system are CURIEs of the form

The global types are grouped into verticals. Each vertical has its own namespace. The og:type values for a namespace are always prefixed with the namespace and then a period. This is to reduce confusion with user-defined namespaced types which always have colons in them.

Music

  • Namespace URI: https://ogp.me/ns/music#
  • music:duration – integer >=1 – The song’s length in seconds.
  • music:album – music.albumarray – The album this song is from.
  • music:album:disc – integer >=1 – Which disc of the album this song is on.
  • music:album:track – integer >=1 – Which track this song is.
  • music:musician – profilearray – The musician that made this song.
  • music:song – music.song – The song on this album.
  • music:song:disc – integer >=1 – The same as music:album:disc but in reverse.
  • music:song:track – integer >=1 – The same as music:album:track but in reverse.
  • music:musician – profile – The musician that made this song.
  • music:release_date – datetime – The date the album was released.
  • music:song – Identical to the ones on music.album
  • music:song:disc
  • music:song:track
  • music:creator – profile – The creator of this playlist.
  • music:creator – profile – The creator of this station.

Video

  • Namespace URI: https://ogp.me/ns/video#
  • video:actor – profilearray – Actors in the movie.
  • video:actor:role – string – The role they played.
  • video:director – profilearray – Directors of the movie.
  • video:writer – profilearray – Writers of the movie.
  • video:duration – integer >=1 – The movie’s length in seconds.
  • video:release_date – datetime – The date the movie was released.
  • video:tag – stringarray – Tag words associated with this movie.
  • video:actor – Identical to video.movie
  • video:actor:role
  • video:director
  • video:writer
  • video:duration
  • video:release_date
  • video:tag
  • video:series – video.tv_show – Which series this episode belongs to.

A multi-episode TV show. The metadata is identical to video.movie.

A video that doesn’t belong in any other category. The metadata is identical to video.movie.

No Vertical

These are globally defined objects that just don’t fit into a vertical but yet are broadly used and agreed upon.

  • article:published_time – datetime – When the article was first published.
  • article:modified_time – datetime – When the article was last changed.
  • article:expiration_time – datetime – When the article is out of date after.
  • article:author – profilearray – Writers of the article.
  • article:section – string – A high-level section name. E.g. Technology
  • article:tag – stringarray – Tag words associated with this article.
  • book:author – profilearray – Who wrote this book.
  • book:isbn – string – The ISBN
  • book:release_date – datetime – The date the book was released.
  • book:tag – stringarray – Tag words associated with this book.
  • profile:first_name – string – A name normally given to an individual by a parent or self-chosen.
  • profile:last_name – string – A name inherited from a family or marriage and by which the individual is commonly known.
  • profile:username – string – A short unique string to identify them.
  • profile:gender – enum(male, female) – Their gender.

No additional properties other than the basic ones. Any non-marked up webpage should be treated as og:type website.

Types

The following types are used when defining attributes in Open Graph protocol.

Discussion and support

You can discuss the Open Graph Protocol in the Facebook group or on the developer mailing list. It is currently being consumed by Facebook (see their documentation), Google (see their documentation), and mixi. It is being published by IMDb, Microsoft, NHL, Posterous, Rotten Tomatoes, TIME, Yelp, and many many others.

Implementations

The open source community has developed a number of parsers and publishing tools. Let the Facebook group know if you’ve built something awesome too!

  • Facebook Object Debugger – Facebook’s official parser and debugger
  • Google Rich Snippets Testing Tool – Open Graph protocol support in specific verticals and Search Engines.
  • PHP Validator and Markup Generator – OGP 2011 input validator and markup generator in PHP5 objects
  • PHP Consumer – a small library for accessing of Open Graph Protocol data in PHP
  • OpenGraphNode in PHP – a simple parser for PHP
  • PyOpenGraph – a library written in Python for parsing Open Graph protocol information from web sites
  • OpenGraph Ruby – Ruby Gem which parses web pages and extracts Open Graph protocol markup
  • OpenGraph for Java – small Java class used to represent the Open Graph protocol
  • RDF::RDFa::Parser – Perl RDFa parser which understands the Open Graph protocol
  • WordPress plugin – Facebook’s official WordPress plugin, which adds Open Graph metadata to WordPress powered sites.
  • Alternate WordPress OGP plugin – A simple lightweight WordPress plugin which adds Open Graph metadata to WordPress powered sites.

The Open Graph protocol was originally created at Facebook and is inspired by Dublin Core, link-rel canonical, Microformats, and RDFa. The specification described on this page is available under the Open Web Foundation Agreement, Version 0.9. This website is Open Source.

The Open Graph protocol enables any web page to become a rich object in a social graph.

O.G. or original gangster or real OG or triple OG [oh-jee] or [uh-rij-uh-nl gang-ster]

What does OG mean?

OG is a slang term for someone who’s incredibly exceptional, authentic, or “old-school.” It can be earnestly used for a legend like Michael Jordan or more ironically, like for that friend who can unwrap a Starburst with their mouth.

What’s hot

Related words

Where does OG come from?

While OG has come to be a hip way of referring or showing respect to someone who’s an expert in any facet of life, its origins lie in gang culture. According to Steve Champion and former South Central Los Angeles gang member Anthony Ross in 2006, the term first started being used in the early 1970s by the LA-based Original Gangster Crips. The term original gangster was derived from the gang’s name and initially stood for “we’re the first.” Crips members would use the OG abbreviation as a shorthand when writing which part of the gang they belonged to (e.g., Original Eastside Crip or OG Eastside).

As the Crips expanded in the 1970s, and many new recruits were coming form different gangs, the definition of the term began to change. An OG became someone who was deeply devoted to their subset gang, and younger members of the gangs began to use it in reference to the elders. The term became so popular that even the Crips’s rival gang, the Bloods, started using it.

During the 1980s, OG began to enter the mainstream with its use in commercialized rap music. In songs and music videos, an OG was seen as someone in gang culture who was hip and impressive (an exceptional badass), and soon the term was used to describe people in the real world who exemplified those characteristics even when they had no gang affiliations. At the same time, the term continued to carry on its initial meaning in the sense that something was OG if it was the first of its kind or unique—that is, original.

One notable example of OG in the context of commercialized rap is in LA-raised rapper Ice-T’s single (and album) “O.G. Original Gangster,” which, at its peak, was #7 on 1991’s Billboard rap charts.

There also exists a popular strain of weed known as OG Kush. The origin of the strain’s name is debated, but according to Amsterdam-based cannabis-seed seller DNA Genetics, who’s responsible for marketing OG Kush seeds, the strain originally went by a different name, but was renamed OG Kush by the popular 1990s LA rap group Cypress Hill. Cypress Hill, apparently, was using OG in its sense of “exceptional.”

OG is a slang term for someone who's incredibly exceptional, authentic, or "old-school.