Syntax for Set based DB

From: Neo <>
Date: 1 Mar 2007 14:24:08 -0800
Message-ID: <>

Comments/suggestions appreciated on syntax for an experimental db based on sets. The sample script creates a db equivalent to an RMDB with the following tables.

Below script creates/queries two things with different typing and attributes. The first is a person/doctor named John who is male, age 75 yr and weight 75 kg. The second is an untyped thing named Mary whose gender is female. Note: lines starting with "(;" are comments. Each expression begins with a function. For example "g" is short for Get. "g+" is short for Get Else Create. Sub expressions that do not specify a function default to that of parent expression.

(; Create a person/doctor named john)
(g+ (type 'person)

      (type 'doctor)
      (name 'john)
      ((type 'gender) 'male)
      ((type 'age) ((type 'qty) '75) ((type 'unit) 'yr))
      ((type 'weight) 75 (unit 'kg)

(; Create a female thing named mary)
(g+ (name 'mary)

      (gender 'female))

(; Get doctors who are 75 yr)
(; Gets john)
(g doctor (75 yr))

(; Get persons whose weight qty is 75 and unit is kg)
(; Gets john)
(g person (weight '75) (unit 'kg))

(; Get things that are female)
(; Gets mary)
(g female)

(; Get things that have a gender)
(; Gets john and mary)
(g (gender))
Received on Thu Mar 01 2007 - 23:24:08 CET

Original text of this message