← Задача 009 — все материалы · оригинал на GitHub

EXAMPLE-task-009-gbrain-schema-pack-cons-base-v2-plus-places-and-properties.yaml

api_version: gbrain-schema-pack-v1
name: cons-gbrain-base-v2-plus-places-and-properties
version: 0.1.0
gbrain_min_version: 0.42.0
extends: gbrain-base-v2
description: |
  gbrain-base-v2 + места (place, как в gbrain-recommended) + квартиры (property).
  Цена и торг — числовыми фактами на карточке квартиры (решение Константина 02.11.2026, 1а).
  Один пакет на все источники базы.

page_types:
  - name: place
    primitive: entity
    path_prefixes:
      - places/
    subtypes:
      - name: building
        when:
          path_pattern: "^places/buildings/"
      - name: beach
        when:
          frontmatter_field: place_kind
          frontmatter_value: beach
      - name: street
        when:
          frontmatter_field: place_kind
          frontmatter_value: street
      - name: district
        when:
          frontmatter_field: place_kind
          frontmatter_value: district
    aliases:
      - location
      - area
      - district
      - building
    extractable: false
    expert_routing: false

  - name: property
    primitive: entity
    path_prefixes:
      - properties/
    subtypes:
      - name: for-sale
        when:
          frontmatter_field: purpose
          frontmatter_value: buy
      - name: for-rent
        when:
          frontmatter_field: purpose
          frontmatter_value: rent
    aliases:
      - apartment
      - flat
      - piso
    extractable: false
    expert_routing: false

link_types:
  - name: located_in
    inverse: location_of
    inference:
      page_type: property
      target_type: place

frontmatter_links:
  - page_type: property
    fields: [place, building]
    link_type: located_in
  - page_type: place
    fields: [within]
    link_type: located_in
  - page_type: company
    fields: [place]
    link_type: located_in

enrichable_types:
  - type: property

filing_rules:
  - kind: place
    directory: places/
    description: Одна страница на район, пляж, улицу; дома — places/buildings/
  - kind: property
    directory: properties/
    description: Одна страница на квартиру (объект), независимо от объявлений