aspen icon indicating copy to clipboard operation
aspen copied to clipboard

Feature request: Predicate lists

Open cristianvasquez opened this issue 4 years ago • 1 comments

Hello,

Great work with Aspen, thank you very much!. I will start experimenting with it :)

I have a suggestion, which is to borrow the 'predicate lists' feature from the turtle syntax (https://www.w3.org/TR/turtle/#sec-intro)

This allows to not repeat the starting nodes each time, by using the ';' character

So if you have


default Person, name
default_attribute Employer, company_name
reciprocal knows, is friends with

# Write out the narrative data
(Matt) [is friends with] (Brianna).
(Eliza) [knows] (Brianna).
(Matt) [is friends with] (Eliza).

(Matt) [works for] (Employer, UMass Boston).

This can be prettified to:


default Person, name
default_attribute Employer, company_name
reciprocal knows, is friends with

# Write out the narrative data
(Matt) 	[is friends with] (Brianna) ;
	[is friends with] (Eliza) ;
	[works for] (Employer, UMass Boston) .

(Eliza) [knows] (Brianna).

cristianvasquez avatar Dec 10 '20 14:12 cristianvasquez

This is a great idea, @cristianvasquez! Definitely open to a PR, since I'm not sure when I'd be able to get to this.

To be in line with Aspen's goal of having natural-ish syntax, I'd like to see both commas and semicolons allowed as predicate list separators, and allowing a final bare "and", so people could write:

(Liz) [knows] (Jack), [supervises] (Jenna), and [supervises] (Tracy).

Perhaps this is scope creep, but maybe this would be a good foundation for predicate lists with inner lists! Like English grammar, commas would separate inner lists, and semicolons would separate predicate lists.

(Liz) [knows] (Jack); [supervises] (Jenna), (Tracy), and (Frank); and [works with] (Pete).

beechnut avatar Dec 24 '20 13:12 beechnut