Contents - Index


DL LANGUAGE
The DL Protocol is specified below the commands are given in blue followed by a description of their usage. Examples of importing are given in the UCINET users guide. 


DL

DESCRIPTION Identifies the file as a Data Language file. This is a required command.

SYNTAX DL

COMMENTS Must be the first word in the data file.



N


DESCRIPTION Specifies the number of rows and columns in a matrix.

SYNTAX N = <integer>

COMMENTS Should be placed before any phrases that can only be interpreted if the number of rows or columns is already known. For example, it should be placed before any command regarding labels.



NR



DESCRIPTION Specifies the number of rows in a matrix.

SYNTAX NR = <integer>

COMMENTS Should be placed before any commands that depend on the number of rows, such as the ROW LABELS command.


NM



DESCRIPTION Specifies the number of matrices in a dataset.

SYNTAX NM = <integer>

COMMENTS Should be placed before any commands that depend on the number of matrices, such as the MATRIX LABELS command.



ROW LABELS:



DESCRIPTION Indicates the start of a series of row labels. The labels may be up to 18 characters in length (if longer they are truncated). They must be separated by spaces, carriage returns, equal signs or commas. Labels with embedded spaces are not advisable, but can be entered by surrounding the label in quotes (e.g., "Humpty Dumpty"). Labels are automatically converted to uppercase. 

SYNTAX ROW LABELS:

COMMENTS Must not precede a dimension command like N or NR.



COLUMN LABELS:



DESCRIPTION Indicates the start of a series of column labels. The labels may be up to 18 characters in length (if longer they are truncated). They must be separated by spaces, carriage returns, equal signs or commas. Labels with embedded spaces are not advisable, but can be entered by surrounding the label in quotes (e.g., "Humpty Dumpty"). Labels are automatically converted to uppercase. 

SYNTAX COLUMN LABELS:

COMMENTS Must not precede a dimension command like N or NC.



LABELS:



DESCRIPTION Indicates the start of a series of labels applicable to both the rows and the columns. Warning: The matrix must be square! The labels may be up to 18 characters in length (if longer they are truncated). They must be separated by spaces, carriage returns, equal signs or commas. Labels with embedded spaces are not advisable, but can be entered by surrounding the label in quotes (e.g., "Humpty Dumpty"). Labels are automatically converted to uppercase. 

SYNTAX LABELS:

COMMENTS Must not precede a dimension command like N.



MATRIX LABELS:



DESCRIPTION Signals the start of a series of matrix labels. The labels may be up to 19 characters in length (if longer they are truncated). They must be separated by spaces, carriage returns, equal signs or commas. Labels with embedded spaces are NOT advisable, but can be entered by surrounding the label in quotes (e.g., "Humpty Dumpty"). Labels are automatically converted to uppercase. 

SYNTAX MATRIX LABELS:

COMMENTS Must not precede a dimension command like NM.




EMBEDDED



DESCRIPTION If present, this keyword always follows the word LABELS, as in ROW LABELS EMBEDDED or LABELS EMBEDDED. It indicates that dimension labels are found embedded in the data itself. For example in the case of ROW LABELS EMBEDDED, it means the first item (up to a blank or comma) in every line of the data is a row label. In the case of COL LABELS EMBEDDED, it indicates that the first line of data should be treated as column labels.


SYNTAX ROW LABELS EMBEDDED
COLUMN LABELS EMBEDDED
MATRIX LABELS EMBEDDED
LABELS EMBEDDED

COMMENTS None.



FORMAT



DESCRIPTION Identifies the layout of the data. The following formats are available:  

FULLMATRIX. Indicates the data are in the form of a matrix. This is the default format. Example (with DIAGONAL = PRESENT):

  2 1 1 0
  1 2 0 1
  0 0 2 0
  1 0 0 2

UPPERHALF. The data consist of the values xij where j > i or j i. Only the values in the upper right triangle of a square matrix are included. The diagonal may or may not be included, depending on the value of the DIAGONAL parameter. Example (with DIAGONAL = PRESENT):

  2 1 1 0
     2 0 1
        2 0
           2

LOWERHALF. The data consist of the values xij where j < i or j i. Only the values in the lower left triangle of a square matrix are included. The diagonal may or may not be included, depending on the value of the DIAGONAL parameter. Example (with DIAGONAL = PRESENT):

  2 
  1 2
  0 0 2
  1 0 0 2

NODELIST1. This is used to read 1/0 matrices only. Each line of data consists of a row number (call it i) followed by a list of column numbers (call each one j) such that xij = 1. For example, the following matrix

  1 1 1 0
  1 1 0 1
  0 0 0 0
  1 0 0 1

is coded this way:

  1  3 2 1
  4  1 4
  2  2 4 1

NODELIST1B. This is used to read 1/0 matrices only. Each line of data corresponds to a matrix row (call it i). The first number on the line is the number of non-zero cells in that row. This is followed by a list of column numbers (call each one j) such that xij = 1. For example, the following matrix

  1 1 1 0
  1 1 0 1
  0 0 0 0
  1 0 0 1

is coded this way:

  3  1 2 3
  3  1 2 4
  0
  2  1 4

Note that rows must appear in numerical order, and none may be skipped (unlike the NODELIST1 format).

EDGELIST1. This format is used to read in data forming a matrix in which the rows and columns refer to the same kinds of objects (e.g., an illness-by-illness proximity matrix, or a person-by-person network). The 1-mode matrix X is built from pairs of indices (a row and a column indicator). Pairs are typed one to a line, with indices separated by spaces or commas. The presence of a pair i,j indicates that there is a link from i to j, which is to say a non-zero value in xij. Optionally, the pair may be followed by a value representing an attribute of the link, such as its strength or quality. If no value is present, it is assumed to be 1.0. If a pair is omitted altogether, it is assigned a value of 0.0. For example, the following matrix, 

  0 0 5 3
  0 0 0 0
  0 0 0 0
  0 1 0 0

is coded this way:

  1 3  5.0
  4 2
  1 4  3.0

Node labels may be used instead of node numbers, as follows:

  Amy  Cathy   5
  Denise  Bonnie
  Amy  Denise  3

If the datafile includes a LABELS statement with the labels (Amy, Cathy, Bonnie, Denise), in that order, the matrix will look like the matrix shown above. However, if a LABELS statement is not present, then the program will assign labels to rows/columns in the order in which they are encountered {Amy, Cathy, Denise, Bonnie}. So the matrix will look like this:

  0 0 3 5
  0 0 0 0
  0 1 0 0
  0 0 0 0

If you do include labels as part of a LABELS statement, they must match the labels in the data exactly. Otherwise, the labels in the data will be considered additional nodes. Also, since the EDGELIST1 format automatically accepts labels as part of the data, the LABELS=EMBEDDED statement is not necessary (but doesn't hurt). 

EDGELIST2. This is used to read in data forming a matrix in which the rows and columns refer to different kinds of objects (e.g., illnesses and treatments). The 2-mode matrix X is built from pairs of indices (a row and a column indicator). Pairs are typed one to a line, with indices separated by spaces or commas. The presence of a pair i,j indicates that there is a link from row i to column j, which is to say a non-zero value in xij. Optionally, the pair may be followed by a value representing an attribute of the link, such as its strength or quality. If no value is present, it is assumed to be 1.0. If a pair is omitted altogether, it is assigned a value of 0.0. For example, the following matrix, 

  6 4
  3 5
  7 9

is coded this way:

  1 1  6
  2 1  3
  3 2  9
  3 1  7
  1 2  4

The row index is always given first, followed by the column index. Index labels may be used instead of index numbers, as follows:

  afghan size 6
  beagle size 3
  chow ferocity 9
  chow size 7
  afghan ferocity 4

For further details concerning labels, see the description of the EDGELIST1 format.

BLOCKMATRIX. This format is used to read highly structured matrices, such as those representing simple models of real data. Values for blocks of adjacent cells are given. For example, the matrix

  2 1 1 1 1 0 0 0
  1 2 1 1 1 0 0 0
  1 1 2 1 1 0 0 0
  1 1 1 2 1 0 0 0
  1 1 1 1 2 0 0 0
  0 0 0 0 0 2 1 1
  0 0 0 0 0 1 2 1
  0 0 0 0 0 1 1 2

is written like this:

  rows 1 to 8 
  cols 1 to 8 
  value = 0
  rows 1 to 5 
  cols 1 to 5
  value = 1
  rows 5 6 7 8
  cols 5 to 8
  value = 1
  diagonal 0
  value = 2 

The first three lines of data assign a value of 0 to all cells in the matrix. The next three lines, isolate the top left quadrant of the matrix and assign all cells a value of 1. The next three lines do the same for the bottom right quadrant. The last two lines give a value of 2 to every cell along the main or 0th diagonal. 

The keywords ROWS, COLUMNS, VALUE, and DIAGONAL may be abbreviated to the first letter. Lists of row and column indices may use conventions like ALL, FIRST <n>, and LAST <n>.

PARTITION. This format is used to read collections of partitions, such as pile sorts. For example, the equivalence matrices

  1 1 0 0
  1 1 0 0
  0 0 1 1
  0 0 1 1

and

  1 1 1 0
  1 1 1 0
  1 1 1 0
  0 0 0 1

are coded as follows:


  dl n=4 nm=2 format=partition
  data:
  1 2
  3 4
  #
  1 2 3
  4

The first line of data ("1 2") indicates that items 1 and 2 belong in the same class or pile. The second line indicates that 3 and 4 belong together. The pound sign (#) separates one partition from another. 

SYNTAX FORMAT = <keyword>
where <keyword> is one of the following:

  FULLMATRIX|FM
  UPPERHALF|UH
  LOWERHALF|LH
  NODELIST1|NL1
  NODELIST2|NL2
  NODELIST1B|NL1B
  EDGELIST1|EL1
  EDGELIST2|EL2
  BLOCKMATRIX|BM
  PARTITION|PT|PS|PR

The vertical bar separates alternative spellings.

COMMENTS None.



DIAGONAL



DESCRIPTION For square matrices, indicates whether the main diagonal is present or absent. The default is present. If absent, the program expects that diagonal values will have been omitted from the file. Example of a 4-by-4 matrix with no diagonal:

    2 3 4
  5   7 8
  9 1   3
  4 5 6  

SYNTAX DIAGONAL = PRESENT|ABSENT

COMMENTS None.