7 releases

0.0.10 Jan 29, 2024
0.0.9 Jan 19, 2024
0.0.6 Dec 30, 2023
0.0.3 Oct 30, 2023

#555 in Encoding

Download history 2/week @ 2023-12-07 8/week @ 2023-12-28 10/week @ 2024-01-04 16/week @ 2024-01-18 13/week @ 2024-01-25 1/week @ 2024-02-01 8/week @ 2024-02-22 3/week @ 2024-02-29 18/week @ 2024-03-07 173/week @ 2024-03-14

201 downloads per month
Used in 3 crates

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–30MB
~483K SLoC