Metadata-Version: 2.4
Name: civil-damage-ontology
Version: 0.1.0
Summary: Ontology-first civil infrastructure damage vocabulary, rule engine, validation tables, and export tooling.
Author: OpenAI Codex
License: MIT License
        
        Copyright (c) 2026
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://example.com/civil-damage-ontology
Project-URL: Documentation, https://example.com/civil-damage-ontology/docs
Project-URL: Repository, https://example.com/civil-damage-ontology/repo
Project-URL: Issues, https://example.com/civil-damage-ontology/issues
Keywords: ontology,civil-infrastructure,damage-modeling,inspection,pypi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: duckdb>=1.1
Requires-Dist: networkx>=3.2
Requires-Dist: pandas>=2.2
Requires-Dist: pydantic>=2.6
Requires-Dist: pyarrow>=16.0
Requires-Dist: PyYAML>=6.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Provides-Extra: graph
Requires-Dist: rdflib>=7.0; extra == "graph"
Dynamic: license-file

# civil-damage-ontology

[![PyPI](https://img.shields.io/badge/PyPI-placeholder-blue)](#)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](#)
[![License](https://img.shields.io/badge/license-MIT-green)](#)

`civil-damage-ontology` is a PyPI-oriented Python package for ontology-side civil infrastructure
damage modeling. It manages a controlled vocabulary, compatibility rules, observability rules,
validated ontology tables, target projection, and hard-negative metadata.

It does:

- ontology vocabulary management
- compatibility and observability validation
- validation table generation
- valid target projection
- hard-negative metadata management
- CSV / Parquet / pandas export
- CLI workflows for non-programmatic use

It does not:

- retrieve or download images
- search external data pools
- auto-label or segment imagery
- train models
- split datasets for ML workflows

The package boundary is intentional: downstream packages consume exported ontology artifacts.

## Install

```bash
python -m pip install civil-damage-ontology
```

For local development:

```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[dev]
```

## Quick Example

```python
import civil_damage_ontology as cdo

repo = cdo.load_repository()
validation = cdo.build_validation_table(repo.vocab, repo.rules)

print(cdo.is_valid("bridge", "deck", "reinforced_concrete", "longitudinal_crack"))
print(cdo.explain_validation("bridge", "girder", "steel", "pothole"))
print(validation.summary())
```

## CLI Example

```bash
cdo validate
cdo build-validation-table --output validation.csv
cdo build-valid-targets --output valid_targets.parquet
```

## Architecture Summary

- `src/civil_damage_ontology/defaults`: packaged default YAML ontology resources
- `models`: typed pydantic records and repositories
- `io`: resource loading and export helpers
- `validation`: repository integrity checks and explanation helpers
- `engine`: rule evaluation, projection, querying, and hard-negative management
- `analytics`: summaries, coverage, and graph export
- `cli`: `typer` command entry point

## Docs

- [Installation](docs/installation.md)
- [Quickstart](docs/quickstart.md)
- [Ontology Model](docs/ontology_model.md)
- [Config Reference](docs/config_reference.md)
- [API Reference](docs/api_reference.md)
- [CLI Reference](docs/cli_reference.md)
- [Release Guide](docs/packaging_release.md)

## Versioning

The package follows semantic versioning. The initial release line is `0.x` while the schema and
default ontology continue to mature.
