{"id":19784320,"url":"https://github.com/alexprut/phpstructureddata","last_synced_at":"2025-04-30T22:32:07.670Z","repository":{"id":14787764,"uuid":"17509713","full_name":"alexprut/PHPStructuredData","owner":"alexprut","description":"A set of PHP libraries that use the http://schema.org vocabulary to implement and output Microdata or RDFa Lite 1.1 semantics.","archived":true,"fork":false,"pushed_at":"2019-07-14T18:08:52.000Z","size":709,"stargazers_count":34,"open_issues_count":2,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-06T19:16:38.257Z","etag":null,"topics":["microdata","php","php-library","rdfa-lite","schema-org"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexprut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-07T09:52:01.000Z","updated_at":"2024-06-04T11:15:00.000Z","dependencies_parsed_at":"2022-09-23T23:13:19.163Z","dependency_job_id":null,"html_url":"https://github.com/alexprut/PHPStructuredData","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FPHPStructuredData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FPHPStructuredData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FPHPStructuredData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FPHPStructuredData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexprut","download_url":"https://codeload.github.com/alexprut/PHPStructuredData/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251791742,"owners_count":21644448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microdata","php","php-library","rdfa-lite","schema-org"],"created_at":"2024-11-12T06:11:10.951Z","updated_at":"2025-04-30T22:32:07.404Z","avatar_url":"https://github.com/alexprut.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHPStructuredData [![Build Status](https://travis-ci.org/alexprut/PHPStructuredData.svg)](https://travis-ci.org/alexprut/PHPStructuredData)\n=================\nA set of PHP libraries that use the http://schema.org vocabulary to implement and output Microdata or RDFa Lite 1.1 semantics.  \nThis library is used in the Joomla CMS since version 3.2 (called [JMicrodata](https://github.com/joomla/joomla-cms/tree/master/libraries/joomla/microdata \"JMicrodata\")).  \nCreated during the Google Summer of Code 2013 and 2014.\n\nQuick overview\n--------------\nThe library was designed with this goals in mind:  \n1. Having the possibility to __switch between Microdata__ and __RDFa Lite 1.1__ semantics.  \n2. Having the possibility to __switch the Type dynamically__, you just change the Type (there are more than 550+ different available Types).  \n3. Display  __validated semantics__, the library takes care of displaying data in the correct format (e.g. all the dates in the ISO standard).  \n4. __Enable/disable__ the __library__ output.  \n5. __Fallbacks__, you should never lose any meaningful semantic (e.g. if you change the Type and it does not have an _author_ Property, it will fallback to the _Person_ Type with the _name_ Property).  \n\nClass diagram\n-------------\n![Class Diagram](https://alexprut.github.io/PHPStructuredData/images/classdiagram-v2.0.0.png)\n\nInstallation\n------------\n* __Composer__:  \n    Add in your ```composer.json``` file:\n\n    ``` json\n    {\n        \"require\": {\n            \"palex/phpstructureddata\": \"*\"\n        }\n    }\n    ```\n* __From Source__:  \n    Run ```git clone https://github.com/alexprut/PHPStructuredData.git```\n* __Direct download__:  \n    Download the last version from [here](https://github.com/alexprut/PHPStructuredData/archive/master.zip \"download\")\n\nUsage Example\n-------------\nLet's suppose that you already have an instance of the Microdata or RDFa library. And you need to add Microdata or RDFa semantics to the following HTML which is part of an article (_e.g._ ```$sd = new PHPStructuredData\\Microdata('Article');```).\n```php\n\u003cdiv \u003c?php echo $sd-\u003edisplayScope();?\u003e\u003e\n    \u003c!-- Language --\u003e\n    \u003c?php echo $sd-\u003econtent(null, 'en-GB')-\u003eproperty('inLanguage')-\u003edisplay('meta', true)?\u003e\n    \u003c!-- Title --\u003e\n    \u003c?php echo $sd-\u003econtent('How to Tie a Reef Knot')-\u003eproperty('name')-\u003edisplay();?\u003e\n\t\u003c!-- Author--\u003e\n    \u003cspan\u003e\n    \tWritten by \u003c?php echo $sd-\u003econtent('John Doe')-\u003eproperty('author')-\u003efallback('Person', 'name')-\u003edisplay();?\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003c?php echo $sd-\u003econtent('1 January 2014', '2014-01-01T00:00:00+00:00')-\u003eproperty('datePublished')-\u003edisplay();?\u003e\n    \u003c!-- Content --\u003e\n    \u003c?php echo $sd-\u003econtent('Lorem ipsum dolor sit amet...')-\u003eproperty('articleBody')-\u003edisplay();?\u003e\n\u003cdiv\u003e\n```\nThe ```Microdata``` library will render:\n```html\n\u003cdiv itemscope itemtype='https://schema.org/Article'\u003e\n    \u003c!-- Language --\u003e\n    \u003cmeta itemprop='inLanguage' content='en-GB'/\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan itemprop='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n    \tWritten by\n        \u003cspan itemprop='author' itemscope itemtype='https://schema.org/Person'\u003e\n            \u003cspan itemprop='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta itemprop='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan itemprop='articleBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nThe ```RDFa``` library will render:\n```html\n\u003cdiv vocab='https://schema.org' typeof='Article'\u003e\n    \u003c!-- Language --\u003e\n    \u003cmeta property='inLanguage' content='en-GB'/\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan property='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n    \tWritten by\n        \u003cspan property='author' vocab='https://schema.org' typeof='Person'\u003e\n            \u003cspan property='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta property='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan property='articleBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nInstead, if you decide to change the current Type (_e.g._ ```$sd-\u003esetType('Review');```).  \nThe ```Microdata``` library will render:\n```html\n\u003cdiv itemscope itemtype='https://schema.org/Review'\u003e\n    \u003c!-- Language --\u003e\n    \u003cmeta itemprop='inLanguage' content='en-GB'/\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan itemprop='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n    \tWritten by\n        \u003cspan itemscope itemtype='https://schema.org/Person'\u003e\n            \u003cspan itemprop='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta itemprop='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    Lorem ipsum dolor sit amet...\n\u003cdiv\u003e\n```\nThe ```RDFa``` library will render:\n```html\n\u003cdiv vocab='https://schema.org' typeof='Review'\u003e\n    \u003c!-- Language --\u003e\n    \u003cmeta property='inLanguage' content='en-GB'/\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan property='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n    \tWritten by\n        \u003cspan vocab='https://schema.org' typeof='Person'\u003e\n            \u003cspan property='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta property='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    Lorem ipsum dolor sit amet...\n\u003cdiv\u003e\n```\nAs you can see ```John Doe``` __fallbacks__ to the _Person_ Type, and there is no loss of information, even if the current Type doesn't have an _author_ Property it will display important information for the machines, search engines know that there is a Person ```John Doe```.  \nInstead, if you decide to not render Microdata or RDFa semantics, you just __disable the library__ output (_e.g._ ```$sd-\u003eenable('false');```).  \nBoth ```Microdata``` and ```RDFa``` library will render:\n```html\n\u003cdiv \u003e\n    \u003c!-- Language --\u003e\n    \u003c!-- Title --\u003e\n    How to Tie a Reef Knot\n\t\u003c!-- Author--\u003e\n    \u003cspan\u003e\n    \tWritten by John Doe\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    1 January 2014\n    \u003c!-- Content --\u003e\n    Lorem ipsum dolor sit amet...\n\u003cdiv\u003e\n```\nCurrently both ```RDFa``` and ```Microdata``` library doesn't support multiple fallbacks.\n\nParserPlugin\n============\nIf you want to keep your views separated from the logic, ```ParserPlugin``` is a PHP class for parsing the HTML markup and converting the ```data-*``` HTML5 attributes into the correctly formatted Microdata or RDFa Lite 1.1 semantics.  \n\nThe ```data-*``` attributes are new in HTML5, they gives us the ability to embed custom data attributes on all HTML elements. So if you disable the library output, the HTML will still be validated. The default suffix the library will search for is ```data-sd```, where sd stands for structured data, but you can register more than one custom suffix.   \n   \nMarkup Syntax\n-------------\n##### setType\n![ParserPlugin Syntax](https://alexprut.github.io/PHPStructuredData/images/parser-plugin-syntax-v1.3.0-setType.png)  \nThe _type_ defines which schema is being used for the following markup.  The Type must always have the first character Uppercase to be correctly interpreted. If the type is a valid schema, the global scope for the page from this point onwards is updated to this schema. The plugin will replace the data tag with ```itemscope itemtype='https://schema.org/Type'``` in case of Microdata semantics or ```vocab='https://schema.org' typeof='Type'``` in case of RDFa Lite 1.1 semantics.  \n  \n###### Example:\n```html\n\u003cdiv data-sd=\"Article\"\u003e\n    \u003cp\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will be output using ```Microdata``` semantics as:\n```html\n\u003cdiv itemscope itemtype=\"http://schema.org/Article\"\u003e\n    \u003cp\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\nOr using ```RDFa``` semantics as:\n```html\n\u003cdiv vocab=\"http://schema.org\" typeof=\"Article\"\u003e\n    \u003cp\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\n\n##### Specifying generic item properties\n![ParserPlugin Syntax](https://alexprut.github.io/PHPStructuredData/images/parser-plugin-syntax-v1.3.0-global.png)  \nOnce a schema has been declared, the next step is to declare individual properties – explaining the content and giving it semantic meaning.\n  \nThe _property_ must always have the first character as lowercase to be correctly interpreted. If the property is found to be part of the current schema, the plugin will replace the data tag with ```itemprop='property'``` in case of Microdata semantics or ```property='property'``` in case of RDFa Lite 1.1 semantics.  If the property is not found to be a valid property of the active schema, it will be ignored and the next available property will be parsed.\n\n###### Example:\n```html\n\u003cdiv data-sd=\"Article\"\u003e\n    \u003cp data-sd=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will be output using ```Microdata``` semantics as:\n```html\n\u003cdiv itemscope itemtype=\"http://schema.org/Article\"\u003e\n    \u003cp itemprop=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\nOr using ```RDFa``` semantics as:\n```html\n\u003cdiv vocab=\"http://schema.org\" typeof=\"Article\"\u003e\n    \u003cp property=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n\u003c/div\u003e\n```\n\n##### Specifying schema—dependant item properties\n![ParserPlugin Syntax](https://alexprut.github.io/PHPStructuredData/images/parser-plugin-syntax-v1.3.0-specialized.png)  \nSometimes you may want to explicitly state a property which should only be used when a specific schema is active – for example, if the property has a specific property in one schema, which is called something different in another schema.\n\nIt is possible to achieve this by using a schema–dependant property.  This works by using a combination between both _Type_ and _property_, separated by a full stop. In short, if the current global scope is equal to Type and the property is part of that Type, the plugin will replace the data tag with ```itemprop='property'``` in case of Microdata semantics or ```property='property'``` in case of RDFa Lite 1.1.\n\n###### Example:\n```html\n\u003cdiv data-sd=\"Article\"\u003e\n    \u003cp data-sd=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp data-sd=\"Article.wordcount\"\u003e4\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will be output using ```Microdata``` semantics as:\n```html\n\u003cdiv itemscope itemtype=\"http://schema.org/Article\"\u003e\n    \u003cp itemprop=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp itemprop=\"wordcount\"\u003e4\u003c/p\u003e\n\u003c/div\u003e\n```\nOr using ```RDFa``` semantics as:\n```html\n\u003cdiv vocab=\"http://schema.org\" typeof=\"Article\"\u003e\n    \u003cp property=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp property=\"wordcount\"\u003e4\u003c/p\u003e\n\u003c/div\u003e\n```\n\n### Using multiple properties\n![ParserPlugin Syntax](https://alexprut.github.io/PHPStructuredData/images/parser-plugin-syntax-v1.3.0.png)  \nIt is possible, using a combination of these, to specify multiple properties including some which are specific for a schema and others which are generic. The order of the building blocks isn't significant and a white space is used as a separator.\n\n###### Example:\n```html\n\u003cdiv data-sd=\"Article\"\u003e\n    \u003cp data-sd=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp data-sd=\"Article.wordcount\"\u003e4\u003c/p\u003e\n    \u003cp data-sd=\"Recipe.recipeCategory Article.articleSection description\"\u003eAmazing dessert recipes\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will be output using ```Microdata``` semantics as:\n```html\n\u003cdiv itemscope itemtype=\"http://schema.org/Article\"\u003e\n    \u003cp itemprop=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp itemprop=\"wordcount\"\u003e4\u003c/p\u003e\n    \u003cp itemprop=\"articleSection\"\u003eAmazing dessert recipes\u003c/p\u003e\n\u003c/div\u003e\n```\nOr using ```RDFa``` semantics as:\n```html\n\u003cdiv vocab=\"http://schema.org\" typeof=\"Article\"\u003e\n    \u003cp property=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp property=\"wordcount\"\u003e4\u003c/p\u003e\n    \u003cp property=\"articleSection\"\u003eAmazing dessert recipes\u003c/p\u003e\n\u003c/div\u003e\n```\n\n##### Nesting schemas\nSometimes it is necessary to nest schemas – for example if you want to describe a person when you have the Article schema open. This is possible using nested schemas. To use this, simply append the schema preceeded by a full stop, __after__ the property.  Once you have finished using the nested schema, close the containing tag, and re-set the original schema.\n\n###### Example:\n```html\n\u003cdiv data-sd=\"Article\"\u003e\n    \u003cp data-sd=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp data-sd=\"Article.wordcount\"\u003e4\u003c/p\u003e\n    \u003cdiv data-sd=\"author.Person\"\u003e\n        \u003cp data-sd=\"Person name\"\u003eJohn Doe\u003c/p\u003e\n    \u003c/div\u003e\n    \u003cp data-sd=\"Article keywords\"\u003eCake\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will be output using ```Microdata``` semantics as:\n```html\n\u003cdiv itemscope itemtype=\"http://schema.org/Article\"\u003e\n    \u003cp itemprop=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp itemprop=\"wordcount\"\u003e4\u003c/p\u003e\n    \u003cdiv itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\"\u003e\n        \u003cp itemprop=\"name\"\u003eJohn Doe\u003c/p\u003e\n    \u003c/div\u003e\n    \u003cp itemprop=\"keywords\"\u003eCake\u003c/p\u003e\n\u003c/div\u003e\n```\nOr using ```RDFa``` semantics as:\n```html\n\u003cdiv vocab=\"http://schema.org\" typeof=\"Article\"\u003e\n    \u003cp property=\"articleBody\"\u003eThis is my article\u003c/p\u003e\n    \u003cp property=\"wordcount\"\u003e4\u003c/p\u003e\n    \u003cdiv property=\"author\" vocab=\"http://schema.org\" typeof=\"Person\"\u003e\n        \u003cp property=\"name\"\u003eJohn Doe\u003c/p\u003e\n    \u003c/div\u003e\n    \u003cp itemprop=\"keywords\"\u003eCake\"\u003c/p\u003e\n\u003c/div\u003e\n```\n\n##### The Algorithm:\n1. First the parser checks for __setTypes__. If one or more matches are found then the current global scope will be updated with the first match. At this point if there are no specific or generic properties the algorithm will finish and replace the data tag with the specified scope. Otherwise continue to point 2.\n2. The parser checks for __specific item properties__. If one or more valid matches are found, then the algorithm will finish and replace the data tag with the first match property. Otherwise go to point 3\n3. The parser checks for __generic properties__. If one or more valid matches are found, then the algorithm will replace the data tag with the first property that is matched, and complete the algorithm.\n\nUsage Example\n-------------\nLet's suppose that you already have an instance of the ```ParserPlugin``` library. And you need to add Microdata or RDFa semantics to the following HTML which is part of an article (_e.g._ ```$parser = new PHPStructuredData\\ParserPlugin('microdata'); $scope='Article';```).\n```html\n\u003cdiv data-sd=\"\u003c?php echo $scope;?\u003e\"\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan data-sd=\"Review.itemReviewed name\"\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n        Written by\n        \u003cspan data-sd=\"author.Person\"\u003e\n            \u003cspan data-sd=\"name\"\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta data-sd='\u003c?php echo $scope;?\u003e datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan data-sd='reviewBody articleBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nThe ```Microdata``` output will be:\n```html\n\u003cdiv itemscope itemtype='https://schema.org/Article'\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan itemprop='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n        Written by\n        \u003cspan itemprop='author' itemscope itemtype='https://schema.org/Person'\u003e\n            \u003cspan itemprop='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta itemprop='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan itemprop='articleBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nThe ```RDFa``` output will be:\n```html\n\u003cdiv vocab='https://schema.org' typeof='Article'\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan property='name'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n        Written by\n        \u003cspan property='author' vocab='https://schema.org' typeof='Person'\u003e\n            \u003cspan property='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta property='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan property='articleBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nInstead, if you decide to change the current Type (_e.g._ ```$scope=\"Review\";```).  \nThe ```Microdata``` output will be:\n```html\n\u003cdiv itemscope itemtype='https://schema.org/Review'\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan itemprop='itemReviewed'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n        Written by\n        \u003cspan itemprop='author' itemscope itemtype='https://schema.org/Person'\u003e\n            \u003cspan itemprop='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta itemprop='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan itemprop='reviewBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\nThe ```RDFa``` output will be:\n```html\n\u003cdiv vocab='https://schema.org' typeof='Review'\u003e\n    \u003c!-- Title --\u003e\n    \u003cspan property='itemReviewed'\u003e\n        How to Tie a Reef Knot\n    \u003c/span\u003e\n    \u003c!-- Author --\u003e\n    \u003cspan\u003e\n        Written by\n        \u003cspan property='author' vocab='https://schema.org' typeof='Person'\u003e\n            \u003cspan property='name'\u003eJohn Doe\u003c/span\u003e\n        \u003c/span\u003e\n    \u003c/span\u003e\n    \u003c!-- Date published --\u003e\n    \u003cmeta property='datePublished' content='2014-01-01T00:00:00+00:00'/\u003e1 January 2014\n    \u003c!-- Content --\u003e\n    \u003cspan property='reviewBody'\u003e\n        Lorem ipsum dolor sit amet...\n    \u003c/span\u003e\n\u003cdiv\u003e\n```\n\nDocumentation\n-------------\n```PHPStructuredData``` libraries use the ```types.json``` file to check and output validated semantics, that file contains all the available Types and Properties from the http://schema.org vocabulary, and it was generated automatically with the https://github.com/alexprut/Spider4Schema web crawler.\n\nTodos\n-----\n##### StructuredData  \n* Add ```itemref``` support.\n* Add multiple fallbacks support to ```StructuredData```.\n* Add to the ```types.json``` all the required properties specified by Google, Yandex, Baidu.\n\nLicense\n-------\nPHPStructuredData is licensed under the MIT License – see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexprut%2Fphpstructureddata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexprut%2Fphpstructureddata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexprut%2Fphpstructureddata/lists"}