Title
The Open Graph protocol
Go Home
Description
The Open Graph protocol enables any web page to become a rich object in a social graph.
Address
Phone Number
+1 609-831-2326 (US) | Message me
Site Icon
The Open Graph protocol
Page Views
0
Share
Update Time
2022-05-02 00:46:30

"I love The Open Graph protocol"

www.ogp.me VS www.gqak.com

2022-05-02 00:46:30

The Open Graph protocol IntroductionThe Open Graph protocol enables any web page to become arich object in a social graph. For instance, this is used on Facebook to allowany web page to have the same functionality as any other object on Facebook.While many different technologies and schemas exist and could be combinedtogether, there isn't a single technology which provides enough information torichly represent any web page within the social graph. The Open Graph protocolbuilds on these existing technologies and gives developers one thing toimplement. Developer simplicity is a key goal of the Open Graph protocol whichhas informed many of the technical design decisions.Basic MetadataTo turn your web pages into graph objects, you need to add basic metadata toyour page. We've based the initial version of the protocol onRDFa which means that you'll placeadditional tags in the of your web page. The four requiredproperties 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 onthe type you specify, other properties may also be required.og:image - An image URL which should represent your object within thegraph.og:url - The canonical URL of your object that will be used as itspermanent 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 onIMDB:The Rock (1996)......Optional MetadataThe following properties are optional for any object and are generallyrecommended: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 titlein 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 whichshould 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 PropertiesSome properties can have extra metadata attached to them.These are specified in the same way as other metadata with property andcontent, 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 requiresHTTPS.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):ArraysIf 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 givenpreference during conflicts.Put structured properties after you declare their root tag. Wheneveranother root element is parsed, that structured propertyis considered to be done and another one is started.For example:means there are 3 images on this page, the first image is 300x300, the middleone has unspecified dimensions, and the last one is 1000px tall.Object TypesIn order for your object to be represented within the graph, you need tospecify 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 listof global types. All other objects in the type system areCURIEs of the formThe global types are grouped into verticals. Each vertical has itsown namespace. The og:type values for a namespace are always prefixed withthe namespace and then a period.This is to reduce confusion with user-defined namespaced types which alwayshave colons in them.MusicNamespace URI: https://ogp.me/ns/music#og:type values:music.songmusic:duration - integer >=1 - The song's length in seconds.music:album - music.album array -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 - profile array -The musician that made this song.music.albummusic: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.playlistmusic:song - Identical to the ones on music.albummusic:song:discmusic:song:trackmusic:creator - profile - The creator of this playlist.music.radio_stationmusic:creator - profile - The creator of this station.VideoNamespace URI: https://ogp.me/ns/video#og:type values:video.movievideo:actor - profile array -Actors in the movie.video:actor:role - string - The role they played.video:director - profile array -Directors of the movie.video:writer - profile array -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 - string array -Tag words associated with this movie.video.episodevideo:actor - Identical to video.movievideo:actor:rolevideo:directorvideo:writervideo:durationvideo:release_datevideo:tagvideo:series - video.tv_show -Which series this episode belongs to.video.tv_showA multi-episode TV show.The metadata is identical to video.movie.video.otherA video that doesn't belong in any other category.The metadata is identical to video.movie.No VerticalThese are globally defined objects that just don't fit into a vertical butyet are broadly used and agreed upon.og:type values:article - Namespace URI: https://ogp.me/ns/article#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 - profile array -Writers of the article.article:section - string - A high-level section name. E.g. Technologyarticle:tag - string array -Tag words associated with this article.book - Namespace URI: https://ogp.me/ns/book#book:author - profile array - Who wrote this book.book:isbn - string -The ISBNbook:release_date - datetime - The date the book was released.book:tag - string array -Tag words associated with this book.profile - Namespace URI: https://ogp.me/ns/profile#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.website - Namespace URI: https://ogp.me/ns/website#No additional properties other than the basic ones.Any non-marked up webpage should be treated as og:type website.TypesThe following types are used when defining attributes in Open Graph protocol. Type Description Literals Boolean A Boolean represents a true or false value true, false, 1, 0 DateTime A DateTime represents a temporal value composed of a date (year, month, day) and an optional time component (hours, minutes) ISO 8601 Enum A type consisting of bounded set of constant string values (enumeration members). A string value that is a member of the enumeration Float A 64-bit signed floating point number All literals that conform to the following formats:1.234-1.2341.2e3-1.2e37E-10 Integer A 32-bit signed integer. In many languages integers over 32-bits become floats, so we limit Open Graph protocol for easy multi-language use. All literals that conform to the following formats:1234-123 String A sequence of Unicode characters All literals composed of Unicode characters with no escape characters URL A sequence of Unicode characters that identify an Internet resource. All valid URLs that utilize the https:// or https:// protocolsDiscussion and supportYou can discuss the Open Graph Protocol inthe Facebook group or on the developer mailing list.It is currently being consumed by Facebook (see their documentation), Google (see their documentation), andmixi.It is being published by IMDb, Microsoft, NHL, Posterous, Rotten Tomatoes,TIME, Yelp, and many many others.ImplementationsThe open source community has developed a number of parsers and publishingtools. Let the Facebook group know if you've built something awesome too!Facebook Object Debugger -Facebook's official parser and debuggerGoogle 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 objectsPHP Consumer -a small library for accessing of Open Graph Protocol data in PHPOpenGraphNode in PHP -a simple parser for PHPPyOpenGraph -a library written in Python for parsing Open Graph protocolinformation from web sitesOpenGraph Ruby -Ruby Gem which parses web pages and extracts Open Graph protocol markupOpenGraph for Java -small Java class used to represent the Open Graph protocolRDF::RDFa::Parser -Perl RDFa parser which understands the Open Graph protocolWordPress 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.