Skip to content

Commit c3f7e7c

Browse files
authored
Update n3.pest
For the tbox rule `{?X :src_advisor ?Y} => {?X :advisor ?Y}.` we currently get ``` Loading data ABox and TBox thread 'main' panicked at 'Unable to read: Error { variant: ParsingError { positives: [WS], negatives: [] }, location: Pos(161), line_col: Pos((5, 9)), path: None, line: "{?X :src_advisor ?Y} => {?X :advisor ?Y}.␊", continued_line: None }', lib/src/n3_parser.rs:44:71 ``` Underscores are allowed in local name part of a qname and this PR is a quick hack to adsress that.
1 parent 7ba626f commit c3f7e7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/parsing/n3.pest

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ NewLine = { "\r" | "\n" }
7575
Var = {"?"~ASCII_ALPHA+~ASCII_ALPHANUMERIC*}
7676
Prefix = {"@prefix"~SPACE+~PrefixIdentifier~":"~SPACE+~"<"~Iri~">"~WS* ~"."~WS*}
7777
PrefixIdentifier = {ASCII_ALPHANUMERIC*}
78-
Prefixed = {PrefixIdentifier ~":"~ASCII_ALPHANUMERIC+}
78+
LocalNameChar = {ASCII_ALPHANUMERIC | "_"}
79+
Prefixed = {PrefixIdentifier ~":"~LocalNameChar+}
7980
Term = {"<"~Iri~">" | Prefixed}
8081
varOrTerm = { Term | Var}
8182
Subject = { Term | Var}
@@ -85,4 +86,4 @@ TP = { WS*~Subject ~WS+~ Property ~WS+~ Object ~WS* ~"."? ~WS* }
8586
Body = {"{"~TP+~"}"}
8687
Head = {"{"~WS*~TP~WS*~"}"}
8788
rule = { Body~WS*~"=>"~WS*~Head~WS*~"."? ~WS*}
88-
document = {Prefix* ~ NewLine* ~rule+}
89+
document = {Prefix* ~ NewLine* ~rule+}

0 commit comments

Comments
 (0)