Ex100 - Persons in Single Hierarchy

Background: Hierarchy, GUI, NLI
Related: Examples, Ex001, Ex060, Ex100 Source Code, Ex105, Ex720

Description:
This example stores a simple hierarchy where the Universe has planets named Mars and Venus. And Mars has a person named John. And Venus has a person named Mary.


NLI Script

(; Create universe)
(new 'universe)

(; Create planets named mars & venus)
(new 'mars 'planet)
(new 'venus 'planet)

(; Create persons named john & mary)
(new 'john 'person)
(new 'mary 'person)

(; Create universe has hierarchy)
(; Note: has is part of system data)
(set  universe has mars)
(set  universe has venus)
(set  mars has john)
(set  venus has mary)


(; Get things that universe has)
(; Gets mars and venus)
(get universe has *)

(; Get persons that mars has)
(; Gets john)
(and (get person instance *)
     (get mars has *))

(; Get path from universe to mary)
(; Gets (venus has mary))
(getPath universe has mary)

(; Get hierarchy universe has)
(; Gets mars, john, venus and mary)
(getHier universe has *)

Notes:

Download Database:
Ex100.zip (20 KB)
The creation of rolex replica the watch is inspired by the retro and elegant money of rolex replica watches the brand's round watch. The chronograph is omega replica simple and stylish, with the line features of rolex replica uk the watch series.

CM ©2000-2007