13 releases

new 0.1.1 Jul 12, 2024
0.1.0 Jul 5, 2024
0.0.14 Jul 3, 2024
0.0.13 Jun 22, 2024
0.0.3 Oct 30, 2023

#443 in Encoding

Download history 21/week @ 2024-03-15 11/week @ 2024-03-29 5/week @ 2024-05-24 7/week @ 2024-05-31 165/week @ 2024-06-07 139/week @ 2024-06-14 179/week @ 2024-06-21 2/week @ 2024-06-28

486 downloads per month
Used in 5 crates

MIT/Apache

755KB
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

~15–32MB
~459K SLoC