Data
JSON-LD
Syntax Tokens and Keywords
JSON-LD keywords start with @ (which breaks go, so I’m translating to at_ and back. Probably better to escape with ).
I’ve been using schema.org’s indentifier property, but according to the background notes, it’s best to use @id instead. I’m guessing it’s also better to use @graph rather than https://schema.org/ItemList
@context
Usually https://schema.org/
@type
These are set by the context schema.org
Thanks to the @context identifier, we can say
{ "@type": "Event" }
rather than give the full name
{ "@type": "https://schema.org/Event" }
Types can be compound, type map in JSON-LD jargon, or atomic.
@id
Vocabularies
schema.org
Thing
├── Event
│ ├── MusicEvent
│ └── …
├── Intangible
│ ├── Enumeration
│ │ ├── DayOfWeek
│ │ │ ├── Sunday
│ │ └── …
│ ├── ItemList
│ └── …
├── …
└── …
GoodRelations
Microdata
- itemscope
- Creates the Item and indicates that descendants of this element contain information about it.
<tr itemscope ...>...</tr>
- itemtype
- A valid URL of a vocabulary that describes the item and its properties context.
<tr itemscope itemtype="https://schema.org/MusicEvent">
...
</tr> - itemid
- Indicates a unique identifier of the item.
- itemprop
- The property's name and value as defined by the item's vocabulary. These can contain nested scopes:
<tr itemscope itemtype="https://schema.org/MusicEvent">
<td itemprop="location" itemscope itemtype="https://schema.org/MusicVenue">
...
</td>
</tr> - itemref
- Not part of the microdata data model. It is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure.
- datetime
- Indicates date or duration as specified by ISO 8601 standard.
JSON-LD Best Practices
- Publish data using developer friendly JSON
- Use a top-level object
- Use native values
- Assume arrays are unordered
- Use well-known identifiers when describing data
- Provide one or more types for JSON objects
- Identify objects with a unique identifier (should be using @id instead of url for artists and venues)
- Things not strings
- Nest referenced inline objects
Data on the Web Best Practices
- Provide metadata