Skip to main content

Crate schemaorg_rs

Crate schemaorg_rs 

Source
Expand description

§schemaorg-rs

A high-performance Rust library for extracting and validating Schema.org structured data from HTML documents.

§Supported Formats

  • JSON-LD<script type="application/ld+json">
  • Microdataitemscope/itemprop attributes
  • RDFa Litevocab/typeof/property attributes

§Quick Start

use schemaorg_rs::extract_all;

let html = r#"<html><head>
<script type="application/ld+json">{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Widget"
}</script>
</head></html>"#;

let graph = extract_all(html).unwrap();
assert_eq!(graph.nodes[0].types, vec!["Product"]);

Re-exports§

pub use error::ExtractionError;
pub use error::ExtractionWarning;
pub use error::WarningCode;
pub use types::SchemaNode;
pub use types::SchemaValue;
pub use types::SourceFormat;
pub use types::SourceLocation;
pub use extraction::ExtractionOutput;
pub use extraction::Extractor;
pub use extraction::JsonLdExtractor;
pub use extraction::MicrodataExtractor;
pub use extraction::RdfaLiteExtractor;
pub use graph::extract_all;
pub use graph::StructuredDataGraph;
pub use validation::DiagnosticCode;
pub use validation::Severity;
pub use validation::ValidationDiagnostic;
pub use validation::ValidationResult;
pub use profiles::Eligibility;
pub use profiles::Profile;
pub use profiles::ProfileError;
pub use profiles::ProfileRegistry;
pub use profiles::ProfileResult;

Modules§

error
Error and warning types for structured data extraction.
extraction
Structured data extractors for JSON-LD, Microdata, and RDFa Lite.
graph
Unified structured data graph combining all extraction formats.
profiles
Rich Results profile system – platform-specific validation beyond Schema.org.
sarif
SARIF 2.1.0 output support for structured data validation.
types
Core data types for Schema.org structured data extraction.
validation
Schema.org vocabulary validation engine.
vocabulary
Schema.org vocabulary lookup – generated at compile time from the official definitions.
wasm
WASM bindings for schemaorg-rs.

Structs§

Html
An HTML tree.