My New Hugo Site

  1. Bash
    1. Filters
      1. grep
      2. Sed
      3. jq
    2. Shellspec
  2. Design
  3. Architectural Patterns
    1. Systemd
    2. Message Broker
    3. JSON-RPC
  4. Go
    1. Concurrency
    2. Web Applications
    3. Compound Data
    4. Json
    5. Go vs Erlang
  5. Prolog Cookbook
  6. Documentation
    1. Hugo
      1. Go Html Template
      2. Table of Contents
    2. HTML
    3. CSS
      1. Color
      2. Style Guides
      3. Layout
    4. Mathjax
  7. Visualization
    1. D3
      1. Venn Diagrams
    2. SVG
    3. Visjs
      1. Network
  8. Data
    1. Yaml
    2. Events
      1. JSON-LD
    3. JSON
      1. jCal
    4. SQL
  9. JavaScript

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

  1. Publish data using developer friendly JSON
  2. Use a top-level object
  3. Use native values
  4. Assume arrays are unordered
  5. Use well-known identifiers when describing data
  6. Provide one or more types for JSON objects
  7. Identify objects with a unique identifier (should be using @id instead of url for artists and venues)
  8. Things not strings
  9. Nest referenced inline objects

Data on the Web Best Practices

  1. Provide metadata

SDK

OpenAPI

Swager

Google