StruQL is a query language created in 1999 by Mary Fernández and Dan Suciu and and Igor Tatarinov.
#2325on PLDB | 25Years Old |
A StruQL query is a function from a set of input graphs to an output graph.
// Link root page to page of all accounts
link Root() -> "Accounts" -> AccountsPage()
// AccountsPage refers to each account in account database and its associated page
{ where (acct, name, street, city, state, zip) in SQL.query("AccountDB", "select acct ...")
link AccountsPage() -> "Info" -> Info(acct),
Info(acct) -> { "Acct" acct, "Name" name, "Street" street,
"City" city, "State" state, "Zip" zip,
"AcctPage" AcctPage(acct) },
AcctPage(acct) -> "Info" -> Info(acct)
// AcctPage refers to non-zero usage records in the usage database.
{ where (date, dom is int, intl is int) in SQL.query("UsageDB", "select date ...", acct)
dom + intl > 0
link AcctPage(acct) -> "UsageData" -> UsageData(acct),
UsageData(acct) -> "Entry" -> UsageEntry(acct, date),
UsageEntry(acct, date) -> { "Date" date, "Total" (dom + intl) }
}
// Query postal database to determine possible aliases for account
{ where XMLRoot{root}, root -> "addresses"."entry" -> addr,
addr -> { "name" alias, "address"."street" street1, "address"."zip" zip },
street1 = street
link Info(acct) -> "Alias" -> alias
}
}
Feature | Supported | Example | Token |
---|---|---|---|
Comments | ✓ | // A comment | |
Line Comments | ✓ | // A comment | // |
Semantic Indentation | X |