{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/journeyed-org/json-schema/journeyed-org-question-twin-schema.json",
  "title": "QuestionTwin",
  "description": "JSON twin of a question page (<path>.json). bestOf links the best-of list of the same place and walking its walking page, when the build has one. table is the comparison table the page shows under its answer. parkingPrices lists stated parking prices lowest first on a question that asks what parking costs.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/journeyed-org-openapi.json#/components/schemas/QuestionTwin",
  "type": "object",
  "required": [
    "schemaVersion",
    "url",
    "jsonUrl",
    "markdownUrl",
    "asOf",
    "publisher",
    "type",
    "question",
    "answer",
    "answerSentences",
    "countLine",
    "market",
    "anchor",
    "ranked",
    "rankedTotal",
    "notYetVerified",
    "notYetVerifiedTotal",
    "sponsored",
    "related",
    "methodology",
    "sources",
    "routing"
  ],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "const": 1
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "jsonUrl": {
      "type": "string",
      "format": "uri"
    },
    "markdownUrl": {
      "type": "string",
      "format": "uri"
    },
    "asOf": {
      "type": "string",
      "format": "date"
    },
    "publisher": {
      "$ref": "#/$defs/Publisher"
    },
    "type": {
      "const": "question"
    },
    "question": {
      "type": "string"
    },
    "answer": {
      "type": "string"
    },
    "answerSentences": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 2,
      "maxItems": 2
    },
    "countLine": {
      "type": "string"
    },
    "market": {
      "type": "string"
    },
    "anchor": {
      "type": "object",
      "required": [
        "name",
        "url",
        "lat",
        "lon"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        }
      }
    },
    "ranked": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RankedPlace"
      }
    },
    "rankedTotal": {
      "type": "integer"
    },
    "notYetVerified": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "url",
          "jsonUrl",
          "missing"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "jsonUrl": {
            "type": "string",
            "format": "uri"
          },
          "missing": {
            "type": "string"
          }
        }
      }
    },
    "notYetVerifiedTotal": {
      "type": "integer"
    },
    "sponsored": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SponsoredPlace"
      }
    },
    "related": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Link"
      }
    },
    "methodology": {
      "type": "object",
      "required": [
        "formulaVersion",
        "weights",
        "lines",
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "formulaVersion": {
          "type": "string"
        },
        "weights": {
          "$ref": "#/$defs/Weights"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Source"
      }
    },
    "routing": {
      "oneOf": [
        {
          "$ref": "#/$defs/Routing"
        },
        {
          "type": "null"
        }
      ]
    },
    "whyTrust": {
      "type": "object",
      "description": "Why trust this ranking: three checkable statements with the market counts.",
      "required": [
        "bullets",
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "bullets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "bestOf": {
      "$ref": "#/$defs/Link"
    },
    "walking": {
      "$ref": "#/$defs/Link"
    },
    "table": {
      "$ref": "#/$defs/CompareTable"
    },
    "parkingPrices": {
      "type": "object",
      "description": "Questions that ask what parking costs: every compared hotel that states a parking price, lowest first; total counts them all, rows shows at most 25. The ranked list keeps its own Fit order.",
      "required": [
        "heading",
        "answerSentences",
        "caption",
        "total",
        "rows"
      ],
      "additionalProperties": false,
      "properties": {
        "heading": {
          "type": "string"
        },
        "answerSentences": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "caption": {
          "type": "string"
        },
        "total": {
          "type": "integer"
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A hotel that states a parking price: position is its place by nightly price (then straight-line miles), never a rank. kind valet means the hotel states no self parking price. nightlyUsd is the low end of a range, 0 when free.",
            "required": [
              "position",
              "placeId",
              "name",
              "url",
              "jsonUrl",
              "price",
              "kind",
              "nightlyUsd",
              "distanceMi",
              "hotelClass",
              "facts"
            ],
            "additionalProperties": false,
            "properties": {
              "position": {
                "type": "integer"
              },
              "placeId": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "jsonUrl": {
                "type": "string",
                "format": "uri"
              },
              "price": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "self",
                  "valet"
                ]
              },
              "nightlyUsd": {
                "type": "number"
              },
              "distanceMi": {
                "type": "number"
              },
              "hotelClass": {
                "type": "string"
              },
              "facts": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Fact"
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "Backing": {
      "type": "object",
      "description": "What is on record behind a hotel score, in counts: facts read from the hotel own website (and the newest date they were checked), contact details from the open place record, recognized awards, counted reader votes, and how many of the standard facts the score counts are verified.",
      "required": [
        "ownSiteFacts",
        "ownSiteCheckedOn",
        "recordFacts",
        "awards",
        "votes",
        "standardFacts",
        "standardTotal"
      ],
      "additionalProperties": false,
      "properties": {
        "ownSiteFacts": {
          "type": "integer"
        },
        "ownSiteCheckedOn": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "recordFacts": {
          "type": "integer"
        },
        "awards": {
          "type": "integer"
        },
        "votes": {
          "type": "integer"
        },
        "standardFacts": {
          "type": "integer"
        },
        "standardTotal": {
          "type": "integer"
        }
      }
    },
    "CompareTable": {
      "type": "object",
      "description": "The comparison table a list page shows under its answer: one row per listed hotel, in the list order; cells are in column order. distance is straight-line miles; walk, walkMin, walkMi and drive follow OpenStreetMap ways (walk times are estimates). of names the guide section whose hotels the rows are. routing is present when the twin has no routing of its own.",
      "required": [
        "heading",
        "caption",
        "anchorUrl",
        "columns",
        "rows"
      ],
      "additionalProperties": false,
      "properties": {
        "heading": {
          "type": "string"
        },
        "caption": {
          "type": "string"
        },
        "anchorUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "of": {
          "type": "string"
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "enum": [
                  "distance",
                  "walk",
                  "walkMin",
                  "walkMi",
                  "drive",
                  "parking",
                  "answer",
                  "checkin",
                  "pets",
                  "recognition",
                  "verified",
                  "profile"
                ]
              },
              "label": {
                "type": "string"
              }
            }
          }
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "rank",
              "placeId",
              "name",
              "url",
              "jsonUrl",
              "cells"
            ],
            "additionalProperties": false,
            "properties": {
              "rank": {
                "type": "integer"
              },
              "placeId": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "jsonUrl": {
                "type": "string",
                "format": "uri"
              },
              "cells": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "One cell. facts are the sourced facts the text was worded from; a cell without them is computed (a distance, a walk, a count, a band). \"not stated\" means the value is not on record, never that it is no.",
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "facts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/Fact"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "routing": {
          "$ref": "#/$defs/Routing"
        }
      }
    },
    "Coordinates": {
      "type": "object",
      "required": [
        "lat",
        "lon"
      ],
      "additionalProperties": false,
      "properties": {
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        }
      }
    },
    "Fact": {
      "type": "object",
      "description": "One sourced fact. Exactly one of sourceUrl and dataset is set. text is the wording the page shows; value is the stored canonical value.",
      "required": [
        "key",
        "text",
        "value",
        "unit",
        "sourceUrl",
        "dataset",
        "sourceLabel",
        "licenseBasis",
        "checkedOn"
      ],
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "dataset": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceLabel": {
          "type": "string"
        },
        "licenseBasis": {
          "type": "string"
        },
        "checkedOn": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "Link": {
      "type": "object",
      "required": [
        "text",
        "url",
        "jsonUrl"
      ],
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "jsonUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "Publisher": {
      "type": "object",
      "description": "The publisher. disclosure and parent are present only when the publisher has a parent company.",
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "disclosure": {
          "type": "string"
        },
        "parent": {
          "type": "string"
        }
      }
    },
    "RankedPlace": {
      "type": "object",
      "description": "A ranked place on a question. fit is the question Fit Score (0 to 100), score the place score (0 to 100), distanceMi straight-line miles from the anchor. phone (E.164) and website come from the place record (its dataset is listed in sources[]). backing counts what is on record behind the score.",
      "required": [
        "rank",
        "placeId",
        "name",
        "url",
        "jsonUrl",
        "fit",
        "score",
        "distanceMi",
        "routed",
        "why",
        "address",
        "phone",
        "website",
        "coordinates",
        "answeringFacts"
      ],
      "additionalProperties": false,
      "properties": {
        "rank": {
          "type": "integer"
        },
        "placeId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "jsonUrl": {
          "type": "string",
          "format": "uri"
        },
        "fit": {
          "type": "number"
        },
        "score": {
          "type": "number"
        },
        "distanceMi": {
          "type": "number"
        },
        "routed": {
          "oneOf": [
            {
              "$ref": "#/$defs/RoutedDistance"
            },
            {
              "type": "null"
            }
          ]
        },
        "why": {
          "type": "string"
        },
        "address": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "website": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "coordinates": {
          "$ref": "#/$defs/Coordinates"
        },
        "answeringFacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Fact"
          }
        },
        "backing": {
          "$ref": "#/$defs/Backing"
        }
      }
    },
    "RoutedDistance": {
      "type": "object",
      "description": "A distance along OpenStreetMap streets and paths between a hotel and a landmark, beside the straight-line distanceMi and never shorter than it. walkMin is the routing engine's estimate (say \"about\"), never a measured time. driveMi is a distance only: no drive time is published. A null part is not on record.",
      "required": [
        "walkMi",
        "walkMin",
        "driveMi"
      ],
      "additionalProperties": false,
      "properties": {
        "walkMi": {
          "type": [
            "number",
            "null"
          ]
        },
        "walkMin": {
          "type": [
            "integer",
            "null"
          ]
        },
        "driveMi": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "Routing": {
      "type": "object",
      "description": "What sources every routed figure of a twin: the credit (OpenStreetMap contributors, routed with the named engine), the date of the map data, the date computed and the method of each figure.",
      "required": [
        "source",
        "engine",
        "mapDataOn",
        "computedOn",
        "walkMethod",
        "driveMethod",
        "note"
      ],
      "additionalProperties": false,
      "properties": {
        "source": {
          "$ref": "#/$defs/Source"
        },
        "engine": {
          "type": "string"
        },
        "mapDataOn": {
          "type": "string",
          "format": "date"
        },
        "computedOn": {
          "type": "string",
          "format": "date"
        },
        "walkMethod": {
          "type": "string"
        },
        "driveMethod": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "Source": {
      "type": "object",
      "required": [
        "label",
        "url",
        "dataset",
        "licenseBasis",
        "checkedOn"
      ],
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "dataset": {
          "type": [
            "string",
            "null"
          ]
        },
        "licenseBasis": {
          "type": "string"
        },
        "checkedOn": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "SponsoredPlace": {
      "type": "object",
      "description": "A labelled paid placement. It never appears inside ranked[]; organicRank is its position in that list.",
      "required": [
        "label",
        "placeId",
        "name",
        "url",
        "fit",
        "organicRank"
      ],
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string"
        },
        "placeId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "fit": {
          "type": "number"
        },
        "organicRank": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "Weights": {
      "type": "object",
      "description": "Component weights the ranking used; they sum to 1.",
      "required": [
        "facts",
        "opinion",
        "proximity",
        "reachability"
      ],
      "additionalProperties": false,
      "properties": {
        "facts": {
          "type": "number"
        },
        "opinion": {
          "type": "number"
        },
        "proximity": {
          "type": "number"
        },
        "reachability": {
          "type": "number"
        }
      }
    }
  }
}