# panproto-protocols
[](https://crates.io/crates/panproto-protocols)
[](https://docs.rs/panproto-protocols)
Built-in protocol definitions for panproto.
Each of the 50 protocols is defined by a schema theory [GAT](https://ncatlab.org/nlab/show/generalized+algebraic+theory) and an instance theory GAT, composed via [colimit](https://ncatlab.org/nlab/show/colimit) from 27 reusable building-block theories organized in six groups. This crate includes parsers for each protocol's native schema format.
Programming language and data format parsing (previously handled by hand-written protocol parsers for SQL, Protobuf, GraphQL, and others) is now handled by tree-sitter grammars in `panproto-parse`. The protocols that remain here are semantic protocols: annotation formats, domain-specific schemas, and formats that have no tree-sitter grammar.
## Protocols
| [ATProto](https://atproto.com/) | Constrained multigraph | W-type | Lexicon JSON |
| [OpenAPI](https://www.openapis.org/) | Constrained multigraph | W-type | YAML/JSON |
| [WASI](https://wasi.dev/) | Simple graph | Flat | WIT |
| [Cap'n Proto](https://capnproto.org/) | Simple graph | Flat | `.capnp` files |
| ...and 46 more | | | |
See the [protocol catalog](https://panproto.dev/tutorial/appendices/D-protocol-catalog.html) for the full list.
## Building-Block Theories (27)
Protocols compose their schema and instance theories from reusable building blocks via colimit:
| A: Core graphs | ThGraph, ThSimpleGraph, ThHypergraph, ThConstraint, ThMulti, ThInterface |
| B: Instance shapes | ThWType, ThMeta, ThFunctor, ThFlat |
| C: Structure | ThOrder, ThCoproduct, ThRecursion, ThSpan, ThCospan, ThPartial, ThLinear, ThNominal |
| D: Symmetry | ThReflexiveGraph, ThSymmetricGraph |
| E: Process | ThPetriNet, ThCausal |
| F: Composition | ThGraphInstance, ThAnnotation, ThOperad, ThTracedMonoidal, ThSimplicial |
## API
| `atproto` / `openapi` / `wasi` / `capnp` / ... | Protocol modules with definitions, parsers, and theory registration |
| `theories` | All 27 building-block theory definitions |
| `ProtocolError` | Error type |
## Example
```rust,ignore
use panproto_protocols::atproto;
let protocol = atproto::protocol();
let schema = atproto::parse_lexicon(&lexicon_json)?;
```
## License
[MIT](../../LICENSE)