[sc34wg3] CTM: Semicolons, dots and other assorted syntax issues
Lars Heuer
heuer at semagia.com
Sun Feb 8 11:14:10 EST 2009
Hi all,
Since the input for the existing proposals is near zero I try to
summarize the existing proposals and their impacts on CTM. I'll
use the same example through the proposal-tour so it should be easier
to compare these even without being deeply in the CTM spec. The
example could have been shorter but a more long-tongued example may
help also those who are not familiar with CTM.
1. Semicolons everywhere
========================
Every directive and statement needs a semicolon
%prefix ex http://psi.example.org;
# Template definition that uses the "is-member-of" template
def is-beatle($person)
is-member-of($person, The-Beatles);
end;
# Template definition
def is-member-of($member, $group)
ex:member-of(member: $member, group: $group);
end;
# Template invocation
is-beatle(ex:john);
# Topic declaration
paul isa person;
- "Paul McCartney";
website: <http://www.paulmccartney.com/>;
is-beatle().
# Topic declaration
ringo
- "Ringo Starr";
- nickname: "Ringo";
http://en.wikipedia.org/wiki/Ringo_Starr;
is-member-of(The-Beatles).
# Stand-alone association
ex:member-of(member: George, group: The-Beatles);
Possible changes:
a) The scope-syntax could be changed that it does not need a comma ','
between the themes (this wasn't possible previously since the
association didn't require a delimiter). Due to the lack of a good
scoped association example, I provide a name example:
The-Beatles
- "Fab Four" @nickname, english.
becomes:
The-Beatles
- "Fab Four" @nickname english.
2. Semicolons as directive / statement delimiter
================================================
Every directive and statements *within* a topic-block needs a
semicolon.
%prefix ex http://psi.example.org;
def is-beatle($person)
is-member-of($person, The-Beatles)
end
def is-member-of($member, $group)
ex:member-of(member: $member, group: $group)
end
is-beatle(ex:john)
paul isa person;
- "Paul McCartney";
website: <http://www.paulmccartney.com/>;
is-beatle().
ringo
- "Ringo Starr";
- nickname: "Ringo";
http://en.wikipedia.org/wiki/Ringo_Starr;
is-member-of(The-Beatles).
ex:member-of(member: George, group: The-Beatles)
Possible changes:
a) Directives are delimited by a dot '.'
b) Directives do not need any delimiter if the mergemap-directive is
changed, c.f.
<http://www.isotopicmaps.org/pipermail/sc34wg3/2009-February/003948.html>
3. The dot proposal
===================
Statements *within* a topic-block require a semicolon, everything
outside a topic-block is delimited by a dot:
%prefix ex http://psi.example.org .
def is-beatle($person)
is-member-of($person, The-Beatles).
end
def is-member-of($member, $group)
ex:member-of(member: $member, group: $group).
end
is-beatle(ex:john).
paul isa person;
- "Paul McCartney";
website: <http://www.paulmccartney.com/>;
is-beatle().
ringo
- "Ringo Starr";
- nickname: "Ringo";
http://en.wikipedia.org/wiki/Ringo_Starr;
is-member-of(The-Beatles).
ex:member-of(member: George, group: The-Beatles).
Possible changes / impacts on CTM:
a) The brackets for template invocations could be optional, i.e.
is-beatle john. # <----------- No brackets here.
ringo
- "Ringo Starr";
- nickname: "Ringo";
http://en.wikipedia.org/wiki/Ringo_Starr;
is-member-of The-Beatles. # <----------- No brackets here.
b) The scope-syntax could be changed that it does not need a comma ','
between the themes. C.f. the reason and example in 1. a).
Okay, these are the proposals and I hope I didn't forget anything. Any
opinion on these? Preferences? Other proposals (maybe a mixture of the
existing ones)? We really need to settle this issue soon (better:
*now*).
Best regards,
Lars
--
Semagia
<http://www.semagia.com>
More information about the sc34wg3
mailing list