29 releases

new 0.1.76 Jun 16, 2025
0.1.60 Mar 11, 2025
0.1.52 Nov 1, 2024
0.1.5 Jul 30, 2024
0.0.3 Oct 30, 2023

#2659 in Database interfaces

Download history 2/week @ 2025-02-26 59/week @ 2025-03-05 80/week @ 2025-03-12 3/week @ 2025-03-19 4/week @ 2025-03-26 8/week @ 2025-04-02 1/week @ 2025-04-09 14/week @ 2025-04-16 14/week @ 2025-04-23 16/week @ 2025-04-30 14/week @ 2025-05-07 52/week @ 2025-05-14 71/week @ 2025-05-21 154/week @ 2025-05-28 97/week @ 2025-06-11

368 downloads per month
Used in 9 crates (7 directly)

MIT/Apache

750KB
20K SLoC

ShEx compact syntax

This module contains a compact syntax parser and serializer for ShEx.


lib.rs:

ShEx compact syntax parser

Example


use shex_ast::{Schema, Shape, ShapeExpr, ShapeExprLabel};
use shex_compact::ShExParser;

let str = r#"prefix : <http://example.org/>
             :S {}
            "#;

let schema = ShExParser::parse(str, None).unwrap();
let mut expected = Schema::new();
expected.add_prefix("", &IriS::new_unchecked("http://example.org/"));
expected.add_shape(
  ShapeExprLabel::iri_unchecked("http://example.org/S"),
  ShapeExpr::empty_shape(),
  false
);
assert_eq!(schema,expected)

Dependencies

~16–29MB
~425K SLoC