[N3] What is the meaning of '=', 'has ...', and 'is ... of'?

Dear Notation-3 authors,

In the process of implementing Solid, I am starting with a Notation-3
parser. I made good progress, however I am still puzzled about a few
aspects of the specification.

I intended to use the same parser for both Turtle and Notation3, but
the incompatibility between N3 collections and RDF collections is
worrying me a bit. It is not explicitely incompatible, but I wonder
what would happen if a N3 PATCH request were to modify a RDF collection
with a N3 syntax. This is a purely hypothetical problem right now, as
Solid won’t accept blank nodes in PATCH requests.

I am leaning on the Turtle specification to know how to parse a stream
of triples. I believe the parser state and productions described in the
Turtle document could be adapted to Notation3 by simply recording the
current formula and adjusting for pathes, but I may be missing
something still.

I use a yacc/bison-like parser generator. It is possible to produce the
triples (quads if we are working with formulas) in the correct order,
but it requires overloading the IPLSTART, [, ( and { terminals with
non-terminals (to mint the new node early) and make sure the triple
with the new node is emitted only once. I also had to create a couple
extra nonterminals to clear the state for path resolution. The
formulaContent rule is hard to translate to yacc/bison, because of the
separation dot after n3Statements. The rule for a collection is also
hard to translate. I managed to bypass both problems by adding new
rules.

Other than that, I am not sure what the verb keywords "has expression",
"is expression of" and "=" mean. I guess "is expression of" is the same
as "<-". Maybe "has expression" is the same as "expression"? I don’t
know for "=".

In section Relationship to Other Languages, Turtle (5.1), you write
about these keywords:

    All keywords can be optionally preceded by "@", for consistency   
    with the "@prefix" and "@base" keywords.

I am not sure this is reflected in the grammar.

Best regards,

Vivien

Received on Sunday, 12 November 2023 22:40:30 UTC