### Book Object Type Example (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Provides an example for the 'book' Open Graph object type, including properties for authors, ISBN, release date, and tags. Requires the 'book' namespace. ```html ``` -------------------------------- ### Optional Open Graph Metadata Example Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Demonstrates the usage of optional Open Graph metadata tags for audio, description, determiner, locale, site name, and video. ```html ``` -------------------------------- ### Profile Object Type Example (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Demonstrates the 'profile' Open Graph object type, featuring properties for name components, username, and gender. Requires the 'profile' namespace. ```html ``` -------------------------------- ### Structured Audio Metadata Example Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Provides structured metadata for an og:audio tag, including secure URL and MIME type, omitting size-related properties. ```html ``` -------------------------------- ### Structured Video Metadata Example Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Shows the structured metadata for an og:video tag, similar to image metadata, including secure URL, type, and dimensions. ```html ``` -------------------------------- ### Structured Image Metadata Example Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Illustrates how to provide structured metadata for an og:image tag, including secure URL, MIME type, dimensions, and alt text. ```html ``` -------------------------------- ### Article Object Type Example (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Demonstrates the use of the 'article' Open Graph object type, including properties for publication times, authors, sections, and tags. Requires the 'article' namespace. ```html ``` -------------------------------- ### Music Song Object Type Example (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Shows the implementation of the 'music.song' Open Graph object type, detailing properties such as duration, album, track number, and musicians. Requires the 'music' namespace. ```html ``` -------------------------------- ### Video Movie Object Type Example (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Illustrates the 'video.movie' Open Graph object type, specifying properties like actors, directors, duration, release date, and tags. Requires the 'video' namespace. ```html ``` -------------------------------- ### Defining Namespaced og:type Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html This example shows how to define a custom namespace and use it to specify a namespaced og:type. It utilizes the 'prefix' attribute in the head tag and a CURIE format for the og:type value. ```html ``` -------------------------------- ### Bash: RDF Schema Access via Content Negotiation Source: https://context7.com/facebook/open-graph-protocol/llms.txt Demonstrates how to access the RDF schema for the Open Graph protocol using `curl` with content negotiation. Supports requesting Turtle or RDF/XML formats, or direct file access. ```bash # Request Turtle format curl -H "Accept: text/turtle" https://ogp.me/ns/ # Request RDF/XML format curl -H "Accept: application/rdf+xml" https://ogp.me/ns/ # Direct file access curl https://ogp.me/ns/ogp.me.ttl # Turtle format curl https://ogp.me/ns/ogp.me.rdf # RDF/XML format ``` -------------------------------- ### Handling Multiple Values for Open Graph Tags Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Demonstrates how to specify multiple values for a single Open Graph tag by repeating the meta tag. ```html ``` -------------------------------- ### Handling Multiple Values for Open Graph Array Properties (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Illustrates how to specify multiple values for a single Open Graph property by repeating the meta tag, with structured properties applying to the most recent root element. ```html ``` -------------------------------- ### Structured Video Properties for Open Graph (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Shows how to define structured properties for video content, similar to images, including secure URLs, MIME types, and dimensions for video players. ```html ``` -------------------------------- ### Structured Image Properties for Open Graph (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Demonstrates how to add structured properties to an image, including secure URLs, MIME types, dimensions, and alt text, using colon-separated suffixes. ```html ``` -------------------------------- ### Structured Properties (og:image, og:video, og:audio) Source: https://github.com/facebook/open-graph-protocol/blob/master/content/index.markdown Explains how to add structured metadata to og:image, og:video, and og:audio tags using extended properties. ```APIDOC ## 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 `:`. ### og:image - `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`. **Example:** ```html ``` ### og:video The `og:video` tag has the identical tags as `og:image`. **Example:** ```html ``` ### og:audio The `og:audio` tag only has the first 3 properties available: - `og:audio:secure_url` - `og:audio:type` **Example:** ```html ``` ``` -------------------------------- ### Handling Multiple Values (Arrays) Source: https://github.com/facebook/open-graph-protocol/blob/master/content/index.markdown Demonstrates how to specify multiple values for a single Open Graph tag by repeating the meta tag. ```APIDOC ## 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. **Example:** ```html ``` Structured properties should be placed after their root tag. Whenever another root element is parsed, the current structured property is considered complete, and a new one can begin. **Example with structured properties:** ```html ``` This example indicates three images: the first is 300x300 pixels, the second has unspecified dimensions, and the third is 1000 pixels tall. ``` -------------------------------- ### Website Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The default 'website' object type requires basic properties like title, URL, image, and description. ```APIDOC ## Website Object Type The `website` type is the default for unmarked pages and requires no additional properties beyond the basic four. ### Description This section details the default `website` object type in the Open Graph protocol. ### Method N/A (This is a metadata standard, not an API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```html ``` ### Response #### Success Response (200) N/A (This is metadata embedded in HTML) #### Response Example N/A ``` -------------------------------- ### HTML: Default Website Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt Defines the default 'website' object type for unmarked pages using standard Open Graph meta tags. Requires basic properties like title, URL, image, and description. ```html ``` -------------------------------- ### Object Types Source: https://github.com/facebook/open-graph-protocol/blob/master/content/index.markdown Explains how to define the type of an object using the og:type meta tag and the distinction between global and custom types. ```APIDOC ## Object Types To represent your object within the graph, you need to specify its type using the `og:type` property. **Example:** ```html ``` Global types are added to the list when the community agrees on a schema. Other types in the system are CURIEs of the form: ```html ``` Global types are organized into verticals, each with its own namespace. `og:type` values within a namespace are prefixed with the namespace followed by a period (`.`) to differentiate them from user-defined namespaced types which use colons (`:`). ``` -------------------------------- ### Optional Open Graph Metadata Properties (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Includes optional metadata properties that enrich content representation with details like descriptions, audio/video URLs, locale information, and site names. ```html ``` -------------------------------- ### Associating Structured Properties with Root Tags Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Shows how to associate structured properties (like width and height) with their corresponding root Open Graph tag (og:image). ```html ``` -------------------------------- ### Structured Audio Properties for Open Graph (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Details the structured properties for audio content, including URL, secure URL, and MIME type. Dimensions are not applicable for audio. ```html ``` -------------------------------- ### Basic Open Graph Metadata Properties (HTML) Source: https://context7.com/facebook/open-graph-protocol/llms.txt Defines the four essential meta tags required for every web page to be represented as a graph object: title, type, URL, and image. ```html The Rock (1996) ``` -------------------------------- ### RDF Schema Access via Content Negotiation Source: https://context7.com/facebook/open-graph-protocol/llms.txt Access the Open Graph protocol's RDF schema using content negotiation or direct file access. ```APIDOC ## RDF Schema Access via Content Negotiation The namespace endpoint at `https://ogp.me/ns/` supports content negotiation, returning Turtle or RDF/XML based on the Accept header. ### Description This section details how to access the Open Graph protocol's RDF schema, supporting content negotiation for different formats. ### Method GET ### Endpoint `https://ogp.me/ns/` ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```bash # Request Turtle format curl -H "Accept: text/turtle" https://ogp.me/ns/ # Request RDF/XML format curl -H "Accept: application/rdf+xml" https://ogp.me/ns/ # Direct file access curl https://ogp.me/ns/ogp.me.ttl # Turtle format curl https://ogp.me/ns/ogp.me.rdf # RDF/XML format ``` ### Response #### Success Response (200) - **Content** (string) - The RDF schema in Turtle or RDF/XML format, depending on the `Accept` header. #### Response Example ```turtle # Example Turtle response @prefix og: og:title a rdfs:Property ; rdfs:label "title" ; rdfs:comment "The title of your object as it should appear, e.g. in the feed." . ``` ``` -------------------------------- ### HTML: Custom Object Type with Namespace Source: https://context7.com/facebook/open-graph-protocol/llms.txt Illustrates the use of custom object types with namespaces for domain-specific content. It utilizes CURIE notation and a custom namespace prefix for unique content types. ```html ``` -------------------------------- ### Basic Open Graph Metadata in HTML Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html This snippet demonstrates how to add essential Open Graph metadata to the `` section of an HTML document. It includes the required og:title, og:type, og:url, and og:image properties, which are crucial for representing a web page as an object in a social graph. ```html The Rock (1996) ... ... ``` -------------------------------- ### Open Graph Protocol RDF Schema (Turtle) Source: https://github.com/facebook/open-graph-protocol/blob/master/content/index.markdown This snippet shows the Resource Description Framework (RDF) schema for the Open Graph protocol in Turtle syntax. It defines the structure and relationships of Open Graph properties. ```turtle @prefix og: a owl:Ontology ; owl:imports . og:title a rdf:Property ; rdfs:label "title"@en ; rdfs:comment "The title of your object as it should appear within the graph." . og:type a rdf:Property ; rdfs:label "type"@en ; rdfs:comment "The type of your object, e.g., video.movie." . og:image a rdf:Property ; rdfs:label "image"@en ; rdfs:comment "An image URL which should represent your object within the graph." . og:url a rdf:Property ; rdfs:label "url"@en ; rdfs:comment "The canonical URL of your object that will be used as its permanent ID in the graph." . og:audio a rdf:Property ; rdfs:label "audio"@en ; rdfs:comment "A URL to an audio file to accompany this object." . og:description a rdf:Property ; rdfs:label "description"@en ; rdfs:comment "A one to two sentence description of your object." . og:determiner a rdf:Property ; rdfs:label "determiner"@en ; rdfs:comment "The word that appears before this object's title in a sentence." . og:locale a rdf:Property ; rdfs:label "locale"@en ; rdfs:comment "The locale these tags are marked up in." . og:locale:alternate a rdf:Property ; rdfs:label "locale:alternate"@en ; rdfs:comment "An array of other locales this page is available in." . og:site_name a rdf:Property ; rdfs:label "site_name"@en ; rdfs:comment "If your object is part of a larger web site, the name which should be displayed for the overall site." . og:video a rdf:Property ; rdfs:label "video"@en ; rdfs:comment "A URL to a video file that complements this object." . ``` -------------------------------- ### Setting og:type to Website Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html This snippet demonstrates how to set the og:type meta tag to 'website' for a general webpage. It's a fundamental Open Graph tag for defining the content type. ```html ``` -------------------------------- ### Video Types Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Details the Open Graph types for video content, including movies, TV episodes, TV shows, and other video types, along with their respective metadata properties. ```APIDOC ## Video Types ### Namespace URI `https://ogp.me/ns/video#` ### `og:type` values: #### `video.movie` * **`video:actor`** (profile array) - Actors in the movie. * **`video:actor:role`** (string) - The role played by the actor. * **`video:director`** (profile array) - Directors of the movie. * **`video:writer`** (profile array) - Writers of the movie. * **`video:duration`** (integer) - The movie's length in seconds. Minimum value: 1. * **`video:release_date`** (datetime) - The date the movie was released. * **`video:tag`** (string array) - Tag words associated with this movie. #### `video.episode` * **`video:actor`** (profile array) - Identical to `video:actor` in `video.movie`. * **`video:actor:role`** (string) - The role played by the actor. * **`video:director`** (profile array) - Directors of the episode. * **`video:writer`** (profile array) - Writers of the episode. * **`video:duration`** (integer) - The episode's length in seconds. Minimum value: 1. * **`video:release_date`** (datetime) - The date the episode was released. * **`video:tag`** (string array) - Tag words associated with this episode. * **`video:series`** (video.tv_show) - The TV show this episode belongs to. #### `video.tv_show` A multi-episode TV show. The metadata is identical to `video.movie`. #### `video.other` A video that does not fit into any other category. The metadata is identical to `video.movie`. ``` -------------------------------- ### Book Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The 'book' object type is used for books and includes properties for authors, ISBN, release date, and tags. ```APIDOC ## Book Object Type ### Description Represents a book with properties for authors, ISBN, release date, and tags. ### Namespace URI `https://ogp.me/ns/book#` ### Properties - **`og:type`**: `book` (Required) - **`og:title`**: Title of the book (Required) - **`og:url`**: Canonical URL of the book page (Required) - **`og:image`**: An image representing the book cover (Required) - **`book:author`**: URL of the author's profile - **`book:isbn`**: The International Standard Book Number (ISBN) - **`book:release_date`**: Release date of the book (YYYY-MM-DD format) - **`book:tag`**: Keywords or tags associated with the book ### Example HTML ```html ``` ``` -------------------------------- ### Custom Object Types with Namespaces Source: https://context7.com/facebook/open-graph-protocol/llms.txt Define custom object types using namespaces for domain-specific content not covered by global types. ```APIDOC ## Custom Object Types with Namespaces Custom object types use CURIE notation with a custom namespace prefix for domain-specific content types not covered by global types. ### Description This section explains how to define and use custom object types with custom namespaces in the Open Graph protocol. ### Method N/A (This is a metadata standard, not an API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```html ``` ### Response #### Success Response (200) N/A (This is metadata embedded in HTML) #### Response Example N/A ``` -------------------------------- ### Music Types Source: https://github.com/facebook/open-graph-protocol/blob/master/index.html Defines the Open Graph types related to music, including songs, albums, playlists, and radio stations, along with their specific properties. ```APIDOC ## Music Types ### Namespace URI `https://ogp.me/ns/music#` ### `og:type` values: #### `music.song` * **`music:duration`** (integer) - The song's length in seconds. Minimum value: 1. * **`music:album`** (music.album array) - The album this song is from. * **`music:album:disc`** (integer) - Which disc of the album this song is on. Minimum value: 1. * **`music:album:track`** (integer) - Which track this song is on the album. Minimum value: 1. * **`music:musician`** (profile array) - The musician that created this song. #### `music.album` * **`music:song`** (music.song) - The song on this album. * **`music:song:disc`** (integer) - The disc number of the song on the album. Minimum value: 1. * **`music:song:track`** (integer) - The track number of the song on the album. Minimum value: 1. * **`music:musician`** (profile) - The musician that created this song. * **`music:release_date`** (datetime) - The date the album was released. #### `music.playlist` * **`music:song`** (music.song) - Identical to the `music:song` property on `music.album`. * **`music:song:disc`** (integer) - Identical to the `music:song:disc` property on `music.album`. * **`music:song:track`** (integer) - Identical to the `music:song:track` property on `music.album`. * **`music:creator`** (profile) - The creator of this playlist. #### `music.radio_station` * **`music:creator`** (profile) - The creator of this radio station. ``` -------------------------------- ### Profile Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The 'profile' object type is used for user profiles and includes properties for name components, username, and gender. ```APIDOC ## Profile Object Type ### Description Represents a user profile with properties for name components, username, and gender. ### Namespace URI `https://ogp.me/ns/profile#` ### Properties - **`og:type`**: `profile` (Required) - **`og:title`**: The full name of the profile owner (Required) - **`og:url`**: Canonical URL of the profile page (Required) - **`og:image`**: An image representing the profile owner (Required) - **`profile:first_name`**: The first name of the profile owner - **`profile:last_name`**: The last name of the profile owner - **`profile:username`**: The username of the profile owner - **`profile:gender`**: The gender of the profile owner ### Example HTML ```html ``` ``` -------------------------------- ### Article Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The 'article' object type is used for articles and provides properties for publication timestamps, authors, sections, and tags. ```APIDOC ## Article Object Type ### Description Represents an article with properties for publication details, authors, sections, and tags. ### Namespace URI `https://ogp.me/ns/article#` ### Properties - **`og:type`**: `article` (Required) - **`og:title`**: Title of the article (Required) - **`og:url`**: Canonical URL of the article (Required) - **`og:image`**: An image representing the article (Required) - **`article:published_time`**: The time the article was published (ISO 8601 format) - **`article:modified_time`**: The time the article was last modified (ISO 8601 format) - **`article:expiration_time`**: The time the article expires (ISO 8601 format) - **`article:author`**: URL of the author's profile - **`article:section`**: The section the article belongs to - **`article:tag`**: Keywords or tags associated with the article ### Example HTML ```html ``` ``` -------------------------------- ### Music Song Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The 'music.song' object type is used for songs and includes properties for duration, album, track number, and musicians. ```APIDOC ## Music Song Object Type ### Description Represents a song with properties for duration, album, track number, and associated musicians. ### Namespace URI `https://ogp.me/ns/music#` ### Properties - **`og:type`**: `music.song` (Required) - **`og:title`**: Title of the song (Required) - **`og:url`**: Canonical URL of the song page (Required) - **`og:image`**: An image representing the song or album (Required) - **`music:duration`**: Duration of the song in seconds - **`music:album`**: URL of the album the song belongs to - **`music:album:disc`**: The disc number the song is on - **`music:album:track`**: The track number of the song on the album - **`music:musician`**: URL of the musician or artist's profile ### Example HTML ```html ``` ``` -------------------------------- ### Video Movie Object Type Source: https://context7.com/facebook/open-graph-protocol/llms.txt The 'video.movie' object type is used for movies and includes properties for actors, directors, writers, duration, release date, and tags. ```APIDOC ## Video Movie Object Type ### Description Represents a movie with properties for cast, crew, duration, release date, and tags. ### Namespace URI `https://ogp.me/ns/video#` ### Properties - **`og:type`**: `video.movie` (Required) - **`og:title`**: Title of the movie (Required) - **`og:url`**: Canonical URL of the movie page (Required) - **`og:image`**: An image representing the movie (Required) - **`video:actor`**: URL of an actor's profile - **`video:actor:role`**: The role played by the actor - **`video:director`**: URL of the director's profile - **`video:writer`**: URL of the writer's profile - **`video:duration`**: Duration of the movie in seconds - **`video:release_date`**: Release date of the movie (YYYY-MM-DD format) - **`video:tag`**: Keywords or tags associated with the movie ### Example HTML ```html ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.