Files
bps-schema/schema-community.json
ringo 1f7ba8ee47 feat(schema): 扩展社区级模式定义建筑引用和能源需求结构
- 在 schema-community.json 中扩展描述字段,增加建筑引用、气象和模拟配置支持
- 添加 BuildingRef 和 CommunityBuildingAttributes 定义社区级建筑属性
- 添加 WeatherContext 和 SimulationContext 支持气象数据和模拟参数配置
- 在 schema-community-energy.json 中扩展描述字段,增加社区级能源需求聚合功能
- 添加 BuildingEnergyDemand、AggregatedEnergyDemand 和 CommunityEnergyDemand 结构
- 添加 DistrictEnergy 的设计温度配置字段
- 格式化 JSON 模式定义,简化数组和对象表示法
- 创建 docs/cea-mapping.md 文档,详细说明 bps-schema 与 CEA 软件的字段映射关系
- 包含社区几何、能源系统、数据库引用和参考案例的完整映射示例
2026-05-29 14:33:18 +08:00

300 lines
9.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "bps/community",
"title": "Community-Scale Geometry Schema",
"description": "Community/site scale geometry: site boundaries, terrain, roads, green spaces, water bodies, building references, weather context, and simulation configuration. Energy, CFD, and other simulation parameters are in separate schema-community-*.json files.",
"$defs": {
"_IdentifiedObject": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"pattern": "^[.A-Za-z0-9_-]+$",
"minLength": 1,
"maxLength": 100
},
"display_name": {
"type": ["string", "null"]
},
"user_data": {
"type": ["object", "null"]
}
},
"required": ["identifier"]
},
"TerrainGrid": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "TerrainGrid" },
"grid_origin": {
"type": "array", "items": { "type": "number" },
"minItems": 3, "maxItems": 3
},
"grid_size_x": { "type": "integer", "minimum": 1 },
"grid_size_y": { "type": "integer", "minimum": 1 },
"cell_size": { "type": "number", "exclusiveMinimum": 0 },
"elevations": { "type": "array", "items": { "type": "number" } }
},
"required": ["type", "grid_origin", "grid_size_x", "grid_size_y", "cell_size", "elevations"],
"additionalProperties": false
}
]
},
"TerrainTIN": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "TerrainTIN" },
"vertices": {
"type": "array",
"items": {
"type": "array", "items": { "type": "number" },
"minItems": 3, "maxItems": 3
},
"minItems": 3
},
"triangles": {
"type": "array",
"items": {
"type": "array", "items": { "type": "integer", "minimum": 0 },
"minItems": 3, "maxItems": 3
},
"minItems": 1
}
},
"required": ["type", "vertices", "triangles"],
"additionalProperties": false
}
]
},
"Road": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "Road" },
"centerline": {
"type": "array",
"items": {
"type": "array", "items": { "type": "number" },
"minItems": 2, "maxItems": 3
},
"minItems": 2
},
"width": { "type": "number", "exclusiveMinimum": 0 },
"surface_material": { "type": "string", "default": "asphalt" }
},
"required": ["type", "centerline", "width"],
"additionalProperties": false
}
]
},
"GreenSpace": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "GreenSpace" },
"boundary": {
"type": "array",
"items": {
"type": "array", "items": { "type": "number" },
"minItems": 2, "maxItems": 2
},
"minItems": 3
},
"vegetation_type": { "type": "string", "default": "grass" },
"leaf_area_index": { "type": "number", "minimum": 0, "default": 1 }
},
"required": ["type", "boundary"],
"additionalProperties": false
}
]
},
"WaterBody": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "WaterBody" },
"boundary": {
"type": "array",
"items": {
"type": "array", "items": { "type": "number" },
"minItems": 2, "maxItems": 2
},
"minItems": 3
},
"depth": { "type": "number", "exclusiveMinimum": 0, "default": 1 },
"water_temperature": { "type": "number", "default": 20 }
},
"required": ["type", "boundary"],
"additionalProperties": false
}
]
},
"BuildingRef": {
"type": "object",
"properties": {
"type": { "const": "BuildingRef" },
"ref": {
"type": "string",
"description": "指向 schema-building.json 中定义的建筑 identifier"
},
"community_attributes": {
"$ref": "#/$defs/CommunityBuildingAttributes",
"description": "社区尺度的建筑属性。仅包含社区模拟必需的字段,不重复建筑 schema 的定义。"
}
},
"required": ["type", "ref"],
"additionalProperties": false
},
"CommunityBuildingAttributes": {
"type": "object",
"properties": {
"primary_use_type": {
"type": "string",
"description": "CEA use type code. 如 OFFICE, SCHOOL, RETAIL, MULTI_RES, SINGLE_RES, HOTEL, HOSPITAL, INDUSTRIAL, RESTAURANT, GYM, LIBRARY, MUSEUM, PARKING, SWIMMING, LAB, SERVERROOM, FOODSTORE, UNIVERSITY, COOLROOM"
},
"construction_standard": {
"type": "string",
"description": "CEA construction standard code, 如 STANDARD2, STANDARD5 等"
},
"year_of_construction": { "type": "integer", "minimum": 1800, "maximum": 2100 },
"floors_above_ground": { "type": "integer", "minimum": 0 },
"floors_below_ground": { "type": "integer", "minimum": 0 },
"height_above_ground_m": { "type": "number", "exclusiveMinimum": 0 },
"height_below_ground_m": { "type": "number", "minimum": 0 },
"footprint_m2": { "type": "number", "exclusiveMinimum": 0 },
"heated_share": { "type": "number", "minimum": 0, "maximum": 1, "default": 1 },
"occupied_share": { "type": "number", "minimum": 0, "maximum": 1, "default": 1 },
"electrified_share": { "type": "number", "minimum": 0, "maximum": 1, "default": 1 },
"basement_conditioned": { "type": "boolean", "default": true },
"void_deck_floors": { "type": "number", "minimum": 0, "default": 0 }
},
"required": ["primary_use_type"],
"additionalProperties": false
},
"WeatherContext": {
"type": "object",
"properties": {
"type": { "const": "WeatherContext" },
"epw_file_path": {
"type": "string",
"description": "EPW 气象文件路径"
},
"climate_zone": {
"type": "string",
"description": "气候区标识,如 CH(瑞士)/ SG(新加坡)/ DE(德国)"
},
"location": {
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" },
"timezone_offset": { "type": "integer" }
},
"additionalProperties": false
}
},
"required": ["type"],
"additionalProperties": false
},
"SimulationContext": {
"type": "object",
"properties": {
"type": { "const": "SimulationContext" },
"database_region": {
"type": "string",
"enum": ["CH", "SG", "DE"],
"default": "CH",
"description": "CEA 数据库区域。不同气候区使用不同的建筑类型学、构造和组件数据库。"
},
"scenario_name": {
"type": "string",
"default": "baseline",
"description": "CEA 场景名称,用于组织输入/输出目录"
},
"description": {
"type": "string",
"description": "场景描述,如 baseline / retrofit / future climate"
}
},
"required": ["type"],
"additionalProperties": false
},
"Site": {
"type": "object",
"allOf": [
{ "$ref": "#/$defs/_IdentifiedObject" },
{
"type": "object",
"properties": {
"type": { "const": "Site" },
"boundary": {
"type": "array",
"items": {
"type": "array", "items": { "type": "number" },
"minItems": 2, "maxItems": 2
},
"minItems": 3
},
"terrain": {
"oneOf": [
{ "$ref": "#/$defs/TerrainGrid" },
{ "$ref": "#/$defs/TerrainTIN" },
{ "type": "null" }
]
},
"roads": {
"type": "array",
"items": { "$ref": "#/$defs/Road" }
},
"green_spaces": {
"type": "array",
"items": { "$ref": "#/$defs/GreenSpace" }
},
"water_bodies": {
"type": "array",
"items": { "$ref": "#/$defs/WaterBody" }
},
"buildings": {
"type": "array",
"items": { "$ref": "#/$defs/BuildingRef" },
"description": "社区包含的建筑列表。标识符引用 schema-building.json 中定义的建筑。"
},
"weather": {
"$ref": "#/$defs/WeatherContext",
"description": "社区模拟的气象数据上下文。"
},
"simulation_context": {
"$ref": "#/$defs/SimulationContext",
"description": "社区级模拟参数配置。"
}
},
"required": ["type"],
"additionalProperties": false
}
]
}
}
}