From caee6369ebdee3d34f066042dea833ee37922481 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 26 May 2025 10:13:13 +0200 Subject: add syntax diagram for Curie --- _markdown.qmd | 6 +++--- _syntax.qmd | 2 ++ syntax/def_Curie.py | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 syntax/def_Curie.py diff --git a/_markdown.qmd b/_markdown.qmd index d1aa5dd..d038cc8 100644 --- a/_markdown.qmd +++ b/_markdown.qmd @@ -240,17 +240,17 @@ to denote whether it is an RDF subject, predicate or object. (Again, these RDF terms are described further in @sec-rdf). See @fig-def-additions for their syntax diagrams. -*FIXME: mention and draw `Curie`* - ::: {#fig-def-additions} ![](syntax/def_SemWords.svg) ![](syntax/def_SemWord.svg) +![](syntax/def_Curie.svg) + ![](syntax/def_SEMPREFIX.svg) -Syntax of `SemWords`, `SemWord`, `Curie`, `SEMPREFIX`. +Syntax of `SemWords`, `SemWord`, `Curie` and `SEMPREFIX`. ::: diff --git a/_syntax.qmd b/_syntax.qmd index d8af814..0dd6204 100644 --- a/_syntax.qmd +++ b/_syntax.qmd @@ -34,6 +34,8 @@ regular expressions and the negative predicate from PEG notation. ![SemWord](syntax/def_SemWord.svg) +![Curie](syntax/def_Curie.svg) + ![Url](syntax/def_Uri.svg) ![HardBreak](syntax/def_HardBreak.svg) diff --git a/syntax/def_Curie.py b/syntax/def_Curie.py new file mode 100755 index 0000000..98a69c5 --- /dev/null +++ b/syntax/def_Curie.py @@ -0,0 +1,18 @@ +#!/usr/bin/python3 + +# Copyright 2025, Jonas Smedegaard +# SPDX-License-Identifier: GPL-3+ + +from railroad import * + +Diagram( + Choice(0, + Sequence( + Choice(0, NonTerminal("CuriePrefix"), Skip() ), + (":") + ), + Skip() + ), + NonTerminal("CurieReference"), + type="complex" +).writeStandalone(sys.stdout.write) -- cgit v1.2.3