-
Notifications
You must be signed in to change notification settings - Fork 8
Schema output is malformed / invalid / has structural errors #38
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The current schema output is malformed / invalid / has structural errors.
For example:
- The
@versionparameter is intended to set the JSON-LD processing mode for the whole document, not to specify a version of a given context (see https://www.w3.org/TR/json-ld11/#json-ld-1-1-processing-mode). - Best practice is for a
@contextto use a URI pattern, which can then also act as the canonical location for that context, and forms the root URI for specific types (e.g., aPersonin a@contextofhttps://schema.org/is shorthand forhttps://schema.org/Person). - Individual timestamp properties are orphaned in an unstructured graph / lack a
@type(which I presume is meant to beArticleTimestamp. - URL values should not be escaped.
As such, I'd recommend restructuring the output to align with the following example (based on https://yoast.com/wordpress-5-7/):
Examples
Before
<script type="application/ld+json" class="wordproof-schema">
{
"@context": {
"@type":"ArticleTimestamp",
"@version":"0.2.0"
},
"blockchain": "eosio_main",
"transactionId": "9e72f05cd1f03474db452daa93eccfd90b03c06ce6eaf85efb757eee79f67b46",
"hash": "451a293ed8eed619a4ed19d81c96fb52c0f4b6499935ccab3cd7d176fce81eb2",
"title": "WordPress 5.7: What's new in this release?",
"content": "[...]",
"date": "2021-03-10T09:29:06+01:00",
"url": "https:\/\/yoast.com\/wordpress-5-7\/"
}
</script>
After
<script type="application/ld+json" class="wordproof-schema">
{
"@context": "https://wordproof.com/schema/",
"@graph": [{
"@type":"ArticleTimestamp",
"blockchain": "eosio_main",
"transactionId": "9e72f05cd1f03474db452daa93eccfd90b03c06ce6eaf85efb757eee79f67b46",
"hash": "451a293ed8eed619a4ed19d81c96fb52c0f4b6499935ccab3cd7d176fce81eb2",
"title": "WordPress 5.7: What's new in this release?",
"content": "[...]",
"date":"2021-03-10T09:29:06+01:00",
"url": "https://yoast.com/wordpress-5-7/"
}]
}
</script>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working