SST: The Semi-Structured Toolkit

SSOPTIONS=...
ssopts = getenv ("SSOPTIONS")
nstr = strsub (ssopts, " \t", argv2, 0, max)
optind = initial (nstr, argv2)
free options

#define MAXKEY MAXFIELDS
Make MAXFIELDS a variable

Move ssfeval in SSadd to its own file
have a bit to say if free space is being overwritten

Field Specific Functions
	Author:
		compare to match (modulo insignificant changes)
		reverse format
		sort by last name
	Date:
		handle different formats
Bibliography Mail Handling
	use SS tools

sssearch
	add substring operator or wildcards
	need to add value/name matching options
	break out into its own file (rename yy to zz)
sssort
	Maximum number of sorting keys -> MAXKEY, not MAXFIELDS

two pass indexing to reduce allocation of space
	frees up head and tail pointers for LOC
	can also reduce size of loc (shorts or 3-bytes for offset)
	also space for tree is freed and access to sorted list is faster

	for each file
		for each record R
			set offset
			for each field F in R
				get termstore for F
				for each term T in value using tokenparser (F)
					if term is not in stoplist (F)
						add T to termstore field
		write index for file
			removing duplicate terms with same loc
		clean termstores

	header
		file         # fields         widths of fields
	index headers (one entry for each field)
		fieldname    # terms          loc of field index
	field index (one primary index entry for each term in field index)
		term         # offsets        loc of first loc
	location index (one secondary index for each posting per record)
		offsets

	Building indices
		need to compute offsets in file, probably in two passes over structure
	Merging indexes
		for each file indexed
			hash filename to array of files
			read all field headers
			hash fieldnames and #entries for each primary index
		for each hashed field
			allocate space for primary entries
		for each primary index
			read it into big array
			add file number to high bits in offset

		sort big array
		when searching, skip low back from mid to first hit,
			skip high forward to final hit
			(need multiple entries for hits because of the overlapping
			offset ranges in the secondary index)

eval field
	@nlines
	@nfields
	@nchars
	@width
		above have parenthesis problems if field is first expanded
	@min
	@max
	@sum
	@mean
	@file
	@recno
	@reverse(many instances of same field)
	@author

mail format reader
sssearch
	correct semantics
sstools for carl phillips
	table of contents
	manual name - e.g., Sun OS Ref. Manual 2
	shelf location
	access policy (e.g., locked)
	keywords

multiple types of records in one file

ssadd
	option to only add field if not already there
	allow adding after a named field
ssgetval
	add option to get last or nth value specified

ssformat
	for each of a multiple field, print template

sscount
	list all fields
	max field width
	max field lines
	max field len

counter to show how many records have been read so far
	feedback needed

add filename to ssread

application-specific schema (map file) for types

_reduction_ of number of systems, not just _addition_ of better

distinction of attributes and relations
	no such distinction in basic sst

usability, scalability, functionality

collaboration via schedules
	finding open times

proprietary vs. universal format

Oval = Object Lens
	Lotus Notes
	gIBIS
	OVAL objects views actions links
		many views
		tailorable applications
	halasz - done by dbs
	malone - some views not thought of by dbs
	so what's new here?
		semi structured info
		are we reinventing frames
		are we reinventing 4gl
	why are DBs not more successful
		overhead of startup
		committment to format
		complexity
		too easy for CIS?
	semi-formal semi-structured
		system provides support for as much structure as you want,
		but does not impose structure

it must be as easy to share information as not share.
That is, information users should not need to do extra work
to share their infomation with others.
	Effort (myinfo) !< Effort (share)

point-point linking
	node/record, field, byte

why has sst not been done?
	contact Larry Wall, Mike Lesk, etc.

programming language
	[condition] text [action] (al la SNOBOL)
	import environment variables

allow conditional strings in %format
ss
	make fields a linked list of arrays of fields - reddy

exact match of field name

	ssread
		provide an empty record to fill

ssr
	add input number to record to break ties in sssort
	field spec by names or numbers
	case sensitivity on names/values/both
	reverse

case sensitivity
	use -I for field values

-m	method
	change to -s syntax
global output syntax option

perlman@poppy: sssort perlman.bib | ssforder | SSOPTIONS= ssextract
Assertion (nargs == argc) failed: FILE "strsub.c", LINE 87

field-type files - schemas
	field name
	longer name
	type - date, person's name, title of paper
	...

sseval
	eval fields with format template
	include environment variables?

ssuntable
	convert tabular form to tagged form
	option for delimiter separating fields
	-f option names fields

ssformat
	set startcol
	...
	if (c == '\n')
		then to to startcol to line up continuation,
			save rest of line in lincontinue

ssmail
	get pagemail code
	rework with ss code
	build email server
	use pointer (long addr) for beginning of mail body
	use series of fields to hold body that is too large
	mail patch
		alternate headers with bodies
	news patch - same as mail (without tab continue),
		but one message per file,
		and concatenation removes message delimiters (convert to mail)
	need requeue buffer (maybe only 6 chars) to read again
		requeue(text)
		next read must look in buffer
		removes all need for ungetc

filltext rules
	TAB at start of line means break
	TAB anywhere in line means break (may still fold long lines)
	3SP at start of line cause break at start but not at end
		sets indent
	if spaces or spaces + (#), *, o, tag, + space then
		start a new line
		put indent/tag
		if tage then set indent
		getlines, stripping off leading tage and filling
	while input lines match defining indentation
	NOTE: most filling is done by changing spaces to newline,
	except for indented text (shortening lines may make more lines,
		adding 3 characters each

Structure of SS Tools
	ss.h	SSR (ss tools)
		ssexpr.h	SEXPR (search expressions)
		sssyntax.h	SYNTAX (file formats)
			ssmain.h (main programs)

Notes for Ed Swan
	* in the record view, you can't get rid of the side scroll
	* hiding a field changes the size of the window,
	  even if the window has scrolled material
	* how about a feature for resizing a window that shrinks
	  the "larger" field sizes instead of clipping the last?
	* usage messages should not contain quotes
	* do not prompt for input from the console window
	* always have a current window/field to act on
		do not default to deselect
	* allow newlines in the format string
	* fields flash when selected
	* format string is not being entered properly
	* allow editing, not reentry of format string
	* regular crashing

Swan - july 26
	field attributes
		text wrapped vs carriage returns
		editable
	parse method
		SYNTAX structure
	mapfile --> SCHEMA
		name A
		name Author
		desc alksdj lakdjlaksjdlasj dlkasjdas
		type title, name, graphic
		test min length, max length
	get all names of record fields - null-terminated array
		get all widths of names/values
	need record types - required and otional fields

ssdb = nrec ssrec*
ssrec = ssfield*
ssfield = name value [type hidden]

sexpr = '(' sexpr ')'
	| sexpr '&' sexpr
	|  sexpr '|' sexpr
	|  relational
relational = namelist relop termlist
relop =  '=' | '!=' | '<' | '<=' | '>' | '>='
termlist = termlist ',' termlist
	| termlist '+' termlist
	| term
namelist = namelist ',' namelist
	| namelist '+' namelist
	| name
name = [A-Za-z0-9-.:]+
value = text
	| '(' text ')'
	| '[' text ']'
	| '{' text '}'
	| '<' text '>'
	| '"' text '"'
	| '`' text '''
	| ''' text '''

index = primary secondary
primary = (term count address)*
secondary = address*
address = file offset

format = text conversion text
conversion = % [[-][w] [.d]] name {index}
	instead of index, use conversion function that is evaluated


Interdisciplinary Seed Grant Program
	HySearch: Using Hypertext for Library Research

	An online bibliography is a useful research tool.
	Current online bibliographic databases and services
	provide keyword search for relevant information,
	usually augmented by Boolean combinations, synonyms,

