35 releases

new 0.1.93 Sep 18, 2025
0.1.87 Aug 28, 2025
0.1.79 Jun 29, 2025
0.1.60 Mar 11, 2025
0.0.3 Oct 30, 2023

#1777 in Database interfaces

Download history 154/week @ 2025-05-28 97/week @ 2025-06-11 46/week @ 2025-06-18 135/week @ 2025-06-25 38/week @ 2025-07-02 23/week @ 2025-07-09 7/week @ 2025-07-16 13/week @ 2025-07-23 279/week @ 2025-08-20 174/week @ 2025-08-27 237/week @ 2025-09-03 100/week @ 2025-09-10

790 downloads per month
Used in 10 crates (7 directly)

MIT/Apache

1MB
23K 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

~18–35MB
~558K SLoC