{
  "about": "PrompTugal.news as data: every table, its columns and where to fetch it; the graph traversals the query page offers; the example queries. Rows are arrays in the order of `columns`.",
  "version": "v0.1.1514",
  "built": "2026-11-15",
  "by": "data.places@PrompTugal.dinis",
  "page": "query/index.html",
  "engine": [
    "assets/query/sql.js",
    "assets/query/graph.js"
  ],
  "tables": [
    {
      "name": "places",
      "about": "One row per place of PrompTugal.news by place (data/by-place/places.json and each place's file): the country, the Algarve and its towns.",
      "url": "api/v1/data/tables/places.json",
      "count": 19,
      "columns": [
        {
          "name": "id",
          "type": "text",
          "about": "the place's id, as in data/by-place/<id>.json"
        },
        {
          "name": "name",
          "type": "text",
          "about": "its name"
        },
        {
          "name": "kind",
          "type": "text",
          "about": "country, region or municipality"
        },
        {
          "name": "parent",
          "type": "text",
          "about": "the id of the place it is in"
        },
        {
          "name": "node",
          "type": "text",
          "about": "its node in the graph (place:<id>)"
        },
        {
          "name": "page",
          "type": "text",
          "about": "its page on the site"
        },
        {
          "name": "agent",
          "type": "text",
          "about": "the agent that keeps its file"
        },
        {
          "name": "status",
          "type": "text",
          "about": "stub, researching or live"
        },
        {
          "name": "updated",
          "type": "text",
          "about": "when its agent last changed it"
        },
        {
          "name": "lon",
          "type": "real",
          "about": "longitude of its seat"
        },
        {
          "name": "lat",
          "type": "real",
          "about": "latitude of its seat"
        },
        {
          "name": "key_id",
          "type": "text",
          "about": "the site's own key in board/keys.json"
        },
        {
          "name": "news",
          "type": "integer",
          "about": "local AI stories"
        },
        {
          "name": "map",
          "type": "integer",
          "about": "organisations on its AI map"
        },
        {
          "name": "events",
          "type": "integer",
          "about": "events"
        },
        {
          "name": "sources",
          "type": "integer",
          "about": "sources read"
        },
        {
          "name": "gaps",
          "type": "integer",
          "about": "gaps written down"
        },
        {
          "name": "mandate",
          "type": "text",
          "about": "its mandate, in its agent's words"
        },
        {
          "name": "gravity",
          "type": "text",
          "about": "its centre of gravity, in its agent's words"
        }
      ]
    },
    {
      "name": "news",
      "about": "Every local AI story on a place's page (ai_news), with its source, when it was read and its path to AI.",
      "url": "api/v1/data/tables/news.json",
      "count": 106,
      "columns": [
        {
          "name": "place",
          "type": "text",
          "about": "the place's id"
        },
        {
          "name": "n",
          "type": "integer",
          "about": "its position in the place's file"
        },
        {
          "name": "node",
          "type": "text",
          "about": "its node in the graph (news:<hash of its URL>)"
        },
        {
          "name": "title",
          "type": "text",
          "about": "the headline, in the agent's words"
        },
        {
          "name": "date",
          "type": "text",
          "about": "the story's date"
        },
        {
          "name": "publisher",
          "type": "text",
          "about": "who published it"
        },
        {
          "name": "url",
          "type": "text",
          "about": "the source"
        },
        {
          "name": "host",
          "type": "text",
          "about": "the source's web host"
        },
        {
          "name": "read_on",
          "type": "text",
          "about": "when it was read"
        },
        {
          "name": "steps",
          "type": "integer",
          "about": "steps from AI (0: about AI directly)"
        },
        {
          "name": "ai_path",
          "type": "text",
          "about": "the path to AI, written down"
        },
        {
          "name": "summary",
          "type": "text",
          "about": "the summary"
        }
      ]
    },
    {
      "name": "map",
      "about": "Every entry of a place's AI map (ai_map): companies, startups, institutions, communities and public bodies, with the source that supports it.",
      "url": "api/v1/data/tables/map.json",
      "count": 161,
      "columns": [
        {
          "name": "place",
          "type": "text",
          "about": "the place's id"
        },
        {
          "name": "n",
          "type": "integer",
          "about": "its position in the place's file"
        },
        {
          "name": "node",
          "type": "text",
          "about": "the node it resolves to: a company:, organisation: of the graph, or local:<slug>"
        },
        {
          "name": "name",
          "type": "text",
          "about": "the name, as the agent wrote it"
        },
        {
          "name": "kind",
          "type": "text",
          "about": "company, startup, institution, organisation, public body, community or investor"
        },
        {
          "name": "url",
          "type": "text",
          "about": "its own site, where given"
        },
        {
          "name": "source_url",
          "type": "text",
          "about": "the source that supports the entry"
        },
        {
          "name": "host",
          "type": "text",
          "about": "the source's web host"
        },
        {
          "name": "read_on",
          "type": "text",
          "about": "when the source was read"
        },
        {
          "name": "steps",
          "type": "integer",
          "about": "steps from AI"
        },
        {
          "name": "ai_path",
          "type": "text",
          "about": "the path to AI"
        },
        {
          "name": "what",
          "type": "text",
          "about": "what it is and does"
        }
      ]
    },
    {
      "name": "events",
      "about": "Events on the places' pages (the place files' events) and the summit's agenda in the graph, one table.",
      "url": "api/v1/data/tables/events.json",
      "count": 55,
      "columns": [
        {
          "name": "place",
          "type": "text",
          "about": "the place's id (null for an agenda item of the graph)"
        },
        {
          "name": "node",
          "type": "text",
          "about": "its node in the graph"
        },
        {
          "name": "title",
          "type": "text",
          "about": "its title"
        },
        {
          "name": "date",
          "type": "text",
          "about": "its date"
        },
        {
          "name": "url",
          "type": "text",
          "about": "the organiser's page"
        },
        {
          "name": "read_on",
          "type": "text",
          "about": "when it was read"
        },
        {
          "name": "ai_path",
          "type": "text",
          "about": "the path to AI (place events)"
        },
        {
          "name": "layer",
          "type": "text",
          "about": "by-place or graph"
        }
      ]
    },
    {
      "name": "sources",
      "about": "The sources and feeds each place's agent reads (sources), and how many of the place's items rest on each host.",
      "url": "api/v1/data/tables/sources.json",
      "count": 150,
      "columns": [
        {
          "name": "place",
          "type": "text",
          "about": "the place's id"
        },
        {
          "name": "n",
          "type": "integer",
          "about": "its position"
        },
        {
          "name": "name",
          "type": "text",
          "about": "its name"
        },
        {
          "name": "url",
          "type": "text",
          "about": "its address"
        },
        {
          "name": "host",
          "type": "text",
          "about": "its web host"
        },
        {
          "name": "kind",
          "type": "text",
          "about": "council, news, university, feed and so on"
        },
        {
          "name": "feed",
          "type": "text",
          "about": "its feed, where it has one"
        },
        {
          "name": "items",
          "type": "integer",
          "about": "stories and map entries of this place whose source is on this host"
        }
      ]
    },
    {
      "name": "gaps",
      "about": "What each place's agent says it has not found or could not check (gaps): the honest edge of the data.",
      "url": "api/v1/data/tables/gaps.json",
      "count": 141,
      "columns": [
        {
          "name": "place",
          "type": "text",
          "about": "the place's id"
        },
        {
          "name": "n",
          "type": "integer",
          "about": "its position"
        },
        {
          "name": "text",
          "type": "text",
          "about": "the gap, in the agent's words"
        }
      ]
    },
    {
      "name": "companies",
      "about": "The companies of the graph (data/companies/), public fields only, after the websummit-only pass.",
      "url": "api/v1/data/tables/companies.json",
      "count": 115,
      "columns": [
        {
          "name": "id",
          "type": "text",
          "about": "its id"
        },
        {
          "name": "node",
          "type": "text",
          "about": "company:<id>"
        },
        {
          "name": "name",
          "type": "text",
          "about": "its name"
        },
        {
          "name": "category",
          "type": "text",
          "about": "its field"
        },
        {
          "name": "country",
          "type": "text",
          "about": "its country"
        },
        {
          "name": "website",
          "type": "text",
          "about": "its site"
        },
        {
          "name": "attending",
          "type": "integer",
          "about": "1 if it is listed at Web Summit 2026"
        },
        {
          "name": "what",
          "type": "text",
          "about": "what it does"
        },
        {
          "name": "sources",
          "type": "integer",
          "about": "how many sources support it"
        },
        {
          "name": "page",
          "type": "text",
          "about": "its page"
        }
      ]
    },
    {
      "name": "articles",
      "about": "PrompTugal.news articles (content/articles/), with the region and town they are tagged with.",
      "url": "api/v1/data/tables/articles.json",
      "count": 63,
      "columns": [
        {
          "name": "slug",
          "type": "text",
          "about": "its slug"
        },
        {
          "name": "node",
          "type": "text",
          "about": "article:<slug>"
        },
        {
          "name": "title",
          "type": "text",
          "about": "its title"
        },
        {
          "name": "date",
          "type": "text",
          "about": "its date"
        },
        {
          "name": "author",
          "type": "text",
          "about": "its byline"
        },
        {
          "name": "region",
          "type": "text",
          "about": "the region it is tagged with"
        },
        {
          "name": "town",
          "type": "text",
          "about": "the town it is tagged with"
        },
        {
          "name": "page",
          "type": "text",
          "about": "its page"
        }
      ]
    },
    {
      "name": "nodes",
      "about": "Every node of the graph: the shared graph and the by-place layer, one id space (<type>:<slug>).",
      "url": "api/v1/data/tables/nodes.json",
      "count": 1567,
      "columns": [
        {
          "name": "id",
          "type": "text",
          "about": "the node's id"
        },
        {
          "name": "type",
          "type": "text",
          "about": "company, organisation, place, event, news, article, topic, product, source, fact, evidence, story, day, track"
        },
        {
          "name": "kind",
          "type": "text",
          "about": "a finer kind (a place's kind, a map entry's kind, an event's kind)"
        },
        {
          "name": "label",
          "type": "text",
          "about": "its name or title"
        },
        {
          "name": "page",
          "type": "text",
          "about": "its page on the site, where it has one"
        },
        {
          "name": "source",
          "type": "text",
          "about": "the URL or repository file it comes from"
        },
        {
          "name": "read",
          "type": "text",
          "about": "when its source was read, where known"
        },
        {
          "name": "layer",
          "type": "text",
          "about": "graph, by-place or connections"
        },
        {
          "name": "places",
          "type": "text",
          "about": "the places whose files name it (by-place layer), comma-separated"
        }
      ]
    },
    {
      "name": "edges",
      "about": "Every edge of the graph: a verb from one node to another, with its source and when it was read.",
      "url": "api/v1/data/tables/edges.json",
      "count": 3552,
      "columns": [
        {
          "name": "id",
          "type": "text",
          "about": "verb:src:dst"
        },
        {
          "name": "src",
          "type": "text",
          "about": "the node it goes from"
        },
        {
          "name": "verb",
          "type": "text",
          "about": "the relation: the ontology's verbs, and on_ai_map_of, reported_in, mentions, held_in, about_place (by-place layer)"
        },
        {
          "name": "dst",
          "type": "text",
          "about": "the node it goes to"
        },
        {
          "name": "source",
          "type": "text",
          "about": "the URL or file that supports it"
        },
        {
          "name": "read",
          "type": "text",
          "about": "when that source was read"
        },
        {
          "name": "layer",
          "type": "text",
          "about": "graph, by-place or connections"
        },
        {
          "name": "note",
          "type": "text",
          "about": "the path to AI, or how the edge was derived"
        }
      ]
    },
    {
      "name": "merges",
      "about": "How the by-place layer resolved each map entry to a node: matched to the graph, merged with another town's entry, or new. So a merge can be checked, and refused.",
      "url": "api/v1/data/tables/merges.json",
      "count": 142,
      "columns": [
        {
          "name": "node",
          "type": "text",
          "about": "the node"
        },
        {
          "name": "how",
          "type": "text",
          "about": "graph-name (matched to a company or organisation of the graph by name), graph-site (by its home page), same-name (the same name in several places), alias (names merged by hand in the catalogue) or new"
        },
        {
          "name": "names",
          "type": "text",
          "about": "the names it was written as, | separated"
        },
        {
          "name": "places",
          "type": "text",
          "about": "the places that list it"
        },
        {
          "name": "entries",
          "type": "integer",
          "about": "how many map entries"
        }
      ]
    },
    {
      "name": "connections",
      "about": "Links between companies, institutions, events and programmes across the places, found by detective.places@PrompTugal.dinis (data/by-place/connections/connections.json), each with its source and whether the page itself was read.",
      "url": "api/v1/data/tables/connections.json",
      "count": 13,
      "columns": [
        {
          "name": "id",
          "type": "text",
          "about": "its id"
        },
        {
          "name": "src",
          "type": "text",
          "about": "from (a node id, resolved by name as a map entry is)"
        },
        {
          "name": "verb",
          "type": "text",
          "about": "the relation: builds_with, funded_by, piloted_in, hosted_at, part_of, incubated_by, founded_with, holds_role_at, organises, participates_in, serves"
        },
        {
          "name": "dst",
          "type": "text",
          "about": "to (a node id)"
        },
        {
          "name": "source",
          "type": "text",
          "about": "its source"
        },
        {
          "name": "read_on",
          "type": "text",
          "about": "when it was read"
        },
        {
          "name": "verified",
          "type": "text",
          "about": "read (the page itself was opened) or search_extract (seen only in a search result)"
        },
        {
          "name": "steps",
          "type": "integer",
          "about": "steps from AI"
        },
        {
          "name": "what",
          "type": "text",
          "about": "what the source says"
        },
        {
          "name": "ai_path",
          "type": "text",
          "about": "the path to AI"
        },
        {
          "name": "places",
          "type": "text",
          "about": "the places it concerns, comma-separated"
        }
      ]
    },
    {
      "name": "captures",
      "about": "Captures of the third-party pages the place files cite: a screenshot and the visible text of each, hashed (SHA-256), kept in the sgit vault promptugal-captures (board/team/data.places/tools/capture.mjs).",
      "url": "api/v1/data/tables/captures.json",
      "count": 271,
      "columns": [
        {
          "name": "url",
          "type": "text",
          "about": "the page cited"
        },
        {
          "name": "host",
          "type": "text",
          "about": "its web host"
        },
        {
          "name": "captured_at",
          "type": "text",
          "about": "when it was captured (UTC)"
        },
        {
          "name": "ok",
          "type": "integer",
          "about": "1 if the page was captured as a reader sees it"
        },
        {
          "name": "status",
          "type": "integer",
          "about": "the HTTP status"
        },
        {
          "name": "title",
          "type": "text",
          "about": "the page's title"
        },
        {
          "name": "note",
          "type": "text",
          "about": "why it was not captured, where it was not"
        },
        {
          "name": "image_sha256",
          "type": "text",
          "about": "the screenshot's SHA-256"
        },
        {
          "name": "image_path",
          "type": "text",
          "about": "the screenshot's path in the vault"
        },
        {
          "name": "text_sha256",
          "type": "text",
          "about": "the text's SHA-256"
        },
        {
          "name": "text_path",
          "type": "text",
          "about": "the text's path in the vault"
        },
        {
          "name": "document_sha256",
          "type": "text",
          "about": "for a document (a PDF), the file's SHA-256"
        },
        {
          "name": "document_path",
          "type": "text",
          "about": "for a document, its path in the vault"
        },
        {
          "name": "cited_by",
          "type": "integer",
          "about": "how many items of the places cite it"
        },
        {
          "name": "places",
          "type": "text",
          "about": "the places whose items cite it"
        }
      ]
    },
    {
      "name": "nr_articles",
      "about": "newsroom.sgit.ai's articles (a snapshot of its article graph, CC BY 4.0, assets/query/newsroom-graphs.json): Dinis's newsroom, the AgentiCCells cluster among them; each is a node nr:<slug> of the graph.",
      "url": "api/v1/data/tables/nr_articles.json",
      "count": 419,
      "columns": [
        {
          "name": "slug",
          "type": "text",
          "about": "its slug on newsroom.sgit.ai"
        },
        {
          "name": "node",
          "type": "text",
          "about": "nr:<slug>"
        },
        {
          "name": "title",
          "type": "text",
          "about": "its title"
        },
        {
          "name": "date",
          "type": "text",
          "about": "its date"
        },
        {
          "name": "url",
          "type": "text",
          "about": "its page"
        },
        {
          "name": "topics",
          "type": "text",
          "about": "its topics, comma-separated"
        },
        {
          "name": "tags",
          "type": "text",
          "about": "its tags, comma-separated"
        },
        {
          "name": "core_idea",
          "type": "text",
          "about": "its core idea, in the newsroom's words"
        }
      ]
    },
    {
      "name": "nr_links",
      "about": "Which newsroom.sgit.ai article links to which (links_to edges in the graph).",
      "url": "api/v1/data/tables/nr_links.json",
      "count": 2038,
      "columns": [
        {
          "name": "src",
          "type": "text",
          "about": "the linking article's slug"
        },
        {
          "name": "dst",
          "type": "text",
          "about": "the linked article's slug"
        }
      ]
    },
    {
      "name": "nr_nodes",
      "about": "The entities inside each newsroom.sgit.ai article's own graph: artefacts, claims, concepts, examples, methods, questions.",
      "url": "api/v1/data/tables/nr_nodes.json",
      "count": 4415,
      "columns": [
        {
          "name": "article",
          "type": "text",
          "about": "the article's slug"
        },
        {
          "name": "id",
          "type": "text",
          "about": "the node's id inside the article"
        },
        {
          "name": "label",
          "type": "text",
          "about": "its label"
        },
        {
          "name": "kind",
          "type": "text",
          "about": "artefact, claim, concept, example, method or question"
        },
        {
          "name": "summary",
          "type": "text",
          "about": "what it is, in one line"
        }
      ]
    },
    {
      "name": "nr_edges",
      "about": "The typed links inside each newsroom.sgit.ai article's graph: answers, compared-with, contrasts, depends-on, example-of, extends, leads-to, produces.",
      "url": "api/v1/data/tables/nr_edges.json",
      "count": 4235,
      "columns": [
        {
          "name": "article",
          "type": "text",
          "about": "the article's slug"
        },
        {
          "name": "src",
          "type": "text",
          "about": "from (a node id inside the article)"
        },
        {
          "name": "rel",
          "type": "text",
          "about": "the relation"
        },
        {
          "name": "dst",
          "type": "text",
          "about": "to (a node id inside the article)"
        }
      ]
    }
  ],
  "functions": [
    {
      "name": "neighbours",
      "args": [
        "start",
        "depth",
        "verbs?"
      ],
      "columns": [
        "id",
        "type",
        "label",
        "depth",
        "verb",
        "via",
        "path",
        "path_ids"
      ]
    },
    {
      "name": "paths",
      "args": [
        "from",
        "to",
        "max_depth?",
        "verbs?"
      ],
      "columns": [
        "n",
        "hops",
        "path",
        "path_ids",
        "verbs"
      ]
    }
  ],
  "places": [
    {
      "id": "portugal",
      "name": "Portugal",
      "url": "api/v1/data/places/portugal.json",
      "page": "query/portugal/index.html"
    },
    {
      "id": "algarve",
      "name": "The Algarve",
      "url": "api/v1/data/places/algarve.json",
      "page": "query/algarve/index.html"
    },
    {
      "id": "faro",
      "name": "Faro",
      "url": "api/v1/data/places/faro.json",
      "page": "query/faro/index.html"
    },
    {
      "id": "loule",
      "name": "Loulé",
      "url": "api/v1/data/places/loule.json",
      "page": "query/loule/index.html"
    },
    {
      "id": "quarteira",
      "name": "Quarteira",
      "url": "api/v1/data/places/quarteira.json",
      "page": "query/quarteira/index.html"
    },
    {
      "id": "silves",
      "name": "Silves",
      "url": "api/v1/data/places/silves.json",
      "page": "query/silves/index.html"
    },
    {
      "id": "tavira",
      "name": "Tavira",
      "url": "api/v1/data/places/tavira.json",
      "page": "query/tavira/index.html"
    },
    {
      "id": "vila-real-de-santo-antonio",
      "name": "Vila Real de Santo António",
      "url": "api/v1/data/places/vila-real-de-santo-antonio.json",
      "page": "query/vila-real-de-santo-antonio/index.html"
    },
    {
      "id": "portimao",
      "name": "Portimão",
      "url": "api/v1/data/places/portimao.json",
      "page": "query/portimao/index.html"
    },
    {
      "id": "lagos",
      "name": "Lagos",
      "url": "api/v1/data/places/lagos.json",
      "page": "query/lagos/index.html"
    },
    {
      "id": "olhao",
      "name": "Olhão",
      "url": "api/v1/data/places/olhao.json",
      "page": "query/olhao/index.html"
    },
    {
      "id": "albufeira",
      "name": "Albufeira",
      "url": "api/v1/data/places/albufeira.json",
      "page": "query/albufeira/index.html"
    },
    {
      "id": "lagoa",
      "name": "Lagoa",
      "url": "api/v1/data/places/lagoa.json",
      "page": "query/lagoa/index.html"
    },
    {
      "id": "monchique",
      "name": "Monchique",
      "url": "api/v1/data/places/monchique.json",
      "page": "query/monchique/index.html"
    },
    {
      "id": "aljezur",
      "name": "Aljezur",
      "url": "api/v1/data/places/aljezur.json",
      "page": "query/aljezur/index.html"
    },
    {
      "id": "vila-do-bispo",
      "name": "Vila do Bispo",
      "url": "api/v1/data/places/vila-do-bispo.json",
      "page": "query/vila-do-bispo/index.html"
    },
    {
      "id": "castro-marim",
      "name": "Castro Marim",
      "url": "api/v1/data/places/castro-marim.json",
      "page": "query/castro-marim/index.html"
    },
    {
      "id": "alcoutim",
      "name": "Alcoutim",
      "url": "api/v1/data/places/alcoutim.json",
      "page": "query/alcoutim/index.html"
    },
    {
      "id": "sao-bras-de-alportel",
      "name": "São Brás de Alportel",
      "url": "api/v1/data/places/sao-bras-de-alportel.json",
      "page": "query/sao-bras-de-alportel/index.html"
    }
  ],
  "examples": [
    {
      "id": "map-by-town",
      "title": "The AI map of the Algarve, by town and kind",
      "about": "How many organisations each place's agent has mapped, by kind.",
      "sql": "SELECT p.name AS place, m.kind, count(*) AS entries\nFROM map m JOIN places p ON p.id = m.place\nGROUP BY p.name, m.kind\nORDER BY entries DESC, place\nLIMIT 20"
    },
    {
      "id": "shared",
      "title": "Who is on more than one town's AI map",
      "about": "Connecting the dots: the organisations that several place agents found on their own, merged by name.",
      "sql": "SELECT n.label AS organisation, n.kind, count(DISTINCT e.dst) AS towns,\n       group_concat(DISTINCT replace(e.dst, 'place:', '')) AS places\nFROM edges e JOIN nodes n ON n.id = e.src\nWHERE e.verb = 'on_ai_map_of'\nGROUP BY n.id\nHAVING towns > 1\nORDER BY towns DESC, organisation"
    },
    {
      "id": "detectives",
      "title": "What the detectives connected, and how sure they are",
      "about": "detective.places@'s links, each end resolved to a node of the graph; 'read' means the page itself was opened, 'search_extract' only a search result.",
      "sql": "SELECT a.label AS from_node, c.verb, b.label AS to_node, c.verified, c.places\nFROM connections c\nJOIN nodes a ON a.id = c.src\nJOIN nodes b ON b.id = c.dst\nORDER BY c.verified, a.label"
    },
    {
      "id": "ualg-two-steps",
      "title": "Every company and organisation within two steps of the Universidade do Algarve, through the stories",
      "about": "A graph traversal inside SQL: neighbours(start, depth, verbs) walks the edges both ways. Through mentions, two steps is \"named in the same story\": the university, a story that names it, and who else that story names.",
      "sql": "SELECT n.depth, n.label, n.type, n.path\nFROM neighbours((SELECT id FROM nodes WHERE label LIKE 'Universidade do Algarve%' ORDER BY id LIMIT 1), 2, 'mentions') n\nWHERE n.type IN ('company', 'organisation') AND n.depth > 0\nORDER BY n.depth, n.label\nLIMIT 40"
    },
    {
      "id": "loule-faro-paths",
      "title": "How Loulé connects to Faro, not counting the region",
      "about": "paths(from, to, max_depth, verbs) finds the shortest paths; '-located_in' skips the trivial path through the Algarve.",
      "sql": "SELECT hops, path, verbs\nFROM paths('place:loule', 'place:faro', 4, '-located_in')\nLIMIT 10"
    },
    {
      "id": "newest",
      "title": "The newest local AI stories, and how far each is from AI",
      "about": "Every story carries its source, the day it was read and its path to AI (steps 0 is about AI directly).",
      "sql": "SELECT date, place, title, publisher, steps, ai_path\nFROM news\nORDER BY date DESC\nLIMIT 15"
    },
    {
      "id": "who-is-named",
      "title": "Which stories name an organisation on the map",
      "about": "The mentions edges join a story to the organisations whose names are in its headline or summary.",
      "sql": "SELECT s.label AS story, o.label AS names, group_concat(DISTINCT replace(r.dst, 'place:', '')) AS reported_in\nFROM edges m\nJOIN nodes s ON s.id = m.src AND s.type = 'news'\nJOIN nodes o ON o.id = m.dst\nJOIN edges r ON r.src = s.id AND r.verb = 'reported_in'\nWHERE m.verb = 'mentions'\nGROUP BY s.id, o.id\nORDER BY o.label\nLIMIT 25"
    },
    {
      "id": "hosts",
      "title": "What the places rest on: the sources by web host",
      "about": "Every story and map entry by the host of its source: a newsroom's dependency on a few outlets, in one query.",
      "sql": "SELECT host, count(*) AS items, count(DISTINCT place) AS places\nFROM (SELECT place, host FROM news UNION ALL SELECT place, host FROM map) x\nWHERE host IS NOT NULL\nGROUP BY host\nORDER BY items DESC\nLIMIT 15"
    },
    {
      "id": "freshness",
      "title": "How fresh each place is",
      "about": "When each place's items were read, and its status.",
      "sql": "SELECT p.name, p.status, p.updated, p.news, p.map, p.gaps,\n       (SELECT max(read_on) FROM map WHERE place = p.id) AS map_read\nFROM places p\nORDER BY p.news + p.map DESC"
    },
    {
      "id": "graph-shape",
      "title": "The shape of the whole graph",
      "about": "Nodes by type and layer: the shared graph and the by-place layer in one id space.",
      "sql": "SELECT layer, type, count(*) AS nodes\nFROM nodes\nGROUP BY layer, type\nORDER BY layer, nodes DESC"
    },
    {
      "id": "captures",
      "title": "Which sources are captured, and their hashes",
      "about": "Every cited page and its capture: join the stories to the captures by URL to see what each story rests on, and the SHA-256 that proves what the page said when it was read.",
      "sql": "SELECT n.place, n.title, c.host, c.captured_at, substr(c.image_sha256, 1, 16) AS image_sha256\nFROM news n JOIN captures c ON c.url = n.url\nWHERE c.ok = 1\nORDER BY n.place, n.date DESC"
    },
    {
      "id": "agenticcells",
      "title": "The AgentiCCells cluster on newsroom.sgit.ai, and what links into it",
      "about": "newsroom.sgit.ai's article graph is a layer of this one: the articles tagged agenticcells, how many of the newsroom's articles link to each, and each one's core idea.",
      "sql": "SELECT a.slug, a.date, (SELECT count(*) FROM nr_links l WHERE l.dst = a.slug) AS linked_from, a.core_idea\nFROM nr_articles a\nWHERE a.tags LIKE '%agenticcells%'\nORDER BY linked_from DESC, a.date DESC"
    },
    {
      "id": "nr-meets-places",
      "title": "Where Dinis's newsroom meets the Algarve's AI map",
      "about": "newsroom.sgit.ai articles whose title or core idea names an organisation on a place's AI map: two corpora, one graph.",
      "sql": "SELECT o.label AS organisation, o.places, a.title AS newsroom_article, a.date\nFROM edges m\nJOIN nr_articles a ON a.node = m.src\nJOIN nodes o ON o.id = m.dst\nWHERE m.verb = 'mentions' AND m.layer = 'newsroom'\nORDER BY o.label, a.date DESC"
    }
  ]
}
