Exercise 9: Relationships with properties

Summary

The core objective of exercise 9 is to allow relationships to be defined that themselves have parameters. For example:

person has(count:0+) sister

This says that a person can have 0 or more sisters. It defines the base relationship person has sister and then attaches the property count = 0+ to that relationship. Another way it could be notated:

(person has sister).count = 0

A transformation's output specification must support this new notation, which may contain variables. For example:

{noun} {has_have} {number} {noun} -> $1 has(count:$3) $4

A secondary objective is to ensure that entities can have not only properties, but properties of properties. For example:

speaker.eye.color = blue

Test cases

Click here

Solution

Click here

Web UI

Click here