forked from friendica/php-json-ld
parent
57e3928ca2
commit
ea1d54b31d
1 changed files with 6 additions and 4 deletions
10
README.md
10
README.md
|
@ -36,13 +36,15 @@ compatible, and require a very small memory footprint in order to operate.
|
||||||
```php
|
```php
|
||||||
$doc = (object)array(
|
$doc = (object)array(
|
||||||
"http://schema.org/name" => "Manu Sporny",
|
"http://schema.org/name" => "Manu Sporny",
|
||||||
"http://schema.org/url" => {"@id": "http://manu.sporny.org/"},
|
"http://schema.org/url" => (object)array("@id" => "http://manu.sporny.org/"),
|
||||||
"http://schema.org/image" => {"@id": "http://manu.sporny.org/images/manu.png"});
|
"http://schema.org/image" => (object)array("@id" => "http://manu.sporny.org/images/manu.png")
|
||||||
|
);
|
||||||
|
|
||||||
$context = (object)array(
|
$context = (object)array(
|
||||||
"name" => "http://schema.org/name",
|
"name" => "http://schema.org/name",
|
||||||
"homepage" => {"@id": "http://schema.org/url", "@type": "@id"},
|
"homepage" => (object)array("@id" => "http://schema.org/url", "@type" => "@id"),
|
||||||
"image" => {"@id": "http://schema.org/image", "@type": "@id"});
|
"image" => (object)array("@id" => "http://schema.org/image", "@type" => "@id")
|
||||||
|
);
|
||||||
|
|
||||||
// compact a document according to a particular context
|
// compact a document according to a particular context
|
||||||
// see: http://json-ld.org/spec/latest/json-ld/#compacted-document-form
|
// see: http://json-ld.org/spec/latest/json-ld/#compacted-document-form
|
||||||
|
|
Loading…
Reference in a new issue