# Rich Results Profiles
`schemaorg-rs` includes built-in profiles for Google Rich Results validation.
Each profile checks whether your structured data meets the requirements for
Google to display enhanced search results.
## Overview
| [Product](product.md) | `Product` | -- |
| [Article](article.md) | `Article` | `NewsArticle`, `BlogPosting` |
| [FAQPage](faqpage.md) | `FAQPage` | -- |
| [BreadcrumbList](breadcrumb.md) | `BreadcrumbList` | -- |
| [LocalBusiness](local_business.md) | `LocalBusiness` | `Restaurant`, `Store`, and all subtypes |
| [Event](event.md) | `Event` | -- |
| [Recipe](recipe.md) | `Recipe` | -- |
| [Baseline](baseline.md) | All types | Generic best practices |
## How Profiles Work
1. The engine matches each node in the graph to profiles via type checking
(including subtype inheritance)
2. Each matching profile evaluates the node for required and recommended fields
3. Results are aggregated into an overall eligibility verdict
## Eligibility Verdicts
| **Eligible** | All requirements met -- rich result should display |
| **WarningsOnly** | Requirements met but optional improvements exist |
| **NotEligible** | Missing required fields -- no rich result |
| **Restricted** | Structurally valid but external factors apply |
## Usage
```rust
use schemaorg_rs::profiles::{ProfileRegistry, Eligibility};
// Google Rich Results profiles
let registry = ProfileRegistry::with_google();
let result = registry.evaluate("google", &graph, &diagnostics)?;
// Baseline profile (generic best practices)
let registry = ProfileRegistry::with_baseline();
let result = registry.evaluate("baseline", &graph, &diagnostics)?;
```
## Adding Custom Profiles
Implement the `Profile` trait and register it:
```rust
use schemaorg_rs::profiles::{Profile, ProfileRegistry, NodeProfileResult};
struct MyProfile;
impl Profile for MyProfile {
fn name(&self) -> &'static str { "custom" }
fn version(&self) -> &'static str { "2024-01-01" }
fn source_url(&self) -> &'static str { "https://example.com/docs" }
fn supported_types(&self) -> &[&str] { &["Product"] }
fn evaluate_node(&self, node: &SchemaNode, _vocab: &[ValidationDiagnostic])
-> NodeProfileResult {
// Your validation logic here
}
}
let mut registry = ProfileRegistry::new();
registry.register(Box::new(MyProfile));
```