shapemap/
lib.rs

1//! This module defines [ShapeMaps](https://shexspec.github.io/shape-map/)
2//!
3//! ShapeMaps are used by [ShEx](https://shex.io/) to trigger validation and present validation results.
4//!
5//! ShapeMaps can associate RDF nodes with shapes indicating whether the RDF nodes conform or not to those shapes.
6//!
7pub mod association;
8pub mod node_selector;
9pub mod query_shape_map;
10pub mod result_shape_map;
11pub mod shape_selector;
12pub mod shapemap;
13pub mod shapemap_config;
14pub mod shapemap_error;
15pub mod shapemap_state;
16pub mod validation_status;
17
18pub use association::*;
19pub use node_selector::*;
20pub use query_shape_map::*;
21pub use result_shape_map::*;
22pub use shape_selector::*;
23pub use shapemap::*;
24pub use shapemap_config::*;
25pub use shapemap_error::*;
26pub use shapemap_state::*;
27pub use validation_status::*;
28
29/// Format of Shapemap files
30#[derive(Debug, Clone, PartialEq, Default)]
31pub enum ShapeMapFormat {
32    #[default]
33    Compact,
34    JSON,
35}
36
37impl ShapeMapFormat {
38    /// Returns the MIME type associated with the format
39    pub fn mime_type(&self) -> &str {
40        match self {
41            ShapeMapFormat::Compact => "text/plain",
42            ShapeMapFormat::JSON => "application/json",
43        }
44    }
45}