'$RCSfile: eml-constraint.xsd,v $'
Copyright: 1997-2002 Regents of the University of California,
University of New Mexico, and
Arizona State University
Sponsors: National Center for Ecological Analysis and Synthesis and
Partnership for Interdisciplinary Studies of Coastal Oceans,
University of California Santa Barbara
Long-Term Ecological Research Network Office,
University of New Mexico
Center for Environmental Studies, Arizona State University
Other funding: National Science Foundation (see README for details)
The David and Lucile Packard Foundation
For Details: http://knb.ecoinformatics.org/
'$Author: jones $'
'$Date: 2002-12-06 22:23:42 $'
'$Revision: 1.45 $'
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
eml-constraint
The eml-constraint module - Relationships among and within
dataset entities
The eml-constraint schema defines the integrity constraints
between entities (e.g., data tables) as they would be maintained in
a relational management system. These constraints include primary
key constraints, foreign key constraints, unique key constraints,
check constraints, and not null constraints, among potential others.
All datasets where there are logical constraints
between entities
no
Relational integrity constraint descriptors
Describes the relational integrity constraints of a
relational database.
The ConstraintType type describes the relational
integrity constraints of a relational database. This includes primary
keys, foreign keys, unique keys, etc. When an eml-constraint module is
created, it should be linked into a dataset using the "triple" element,
and all of the entities that are referenced in the constraints should be
accessible within that same package.
Primary Key
The primary key in the entity
The primaryKey element declares the primary key in
the entity to which the defined constraint
pertains.
date
site
Key
The set of attributes to which this constraint
applies.
The key element defines the set of attributes
to which this constraint applies. For a primary key or a
unique key, the set of attributes must be identifying. For a
foreign key, the set of attributes must match an identifying
key in the referenced entity. For a 'not null' constraint, the
key indicates the attribute which should not be
null.
site
plot
Attribute Name
Name of an attribute found in the
identified entity
The attributeReference element is the
name of an attribute that can be found in the identified
entity. This name will be unique within an entity and
specifies that the attribute participates in the key
that is being defined.
site
Unique Key
A unique key in the entity
The uniqueKey element represents a unique key
within the referenced entity. This is different from a primary key
in that it does not form any implicit foriegn key relationships to
other entities, however it is required to be unique within the
entity.
date
Key
The set of attributes to which this constraint
applies.
The key element defines the set of attributes
to which this constraint applies. For a primary key or a
unique key, the set of attributes must be identifying. For a
foreign key, the set of attributes must match an identifying
key in the referenced entity. For a 'not null' constraint, the
key indicates the attribute which should not be
null.
date, site, plot
Attribute Name
Name of an attribute found in the
identified entity
The attributeReference element contains
the name of an attribute that can be found in the
identified entity. This name will be unique within an
entity and specifies that the attribute participates in
the key that is being defined.
site
Check Constraint
A constraint which checks a conditional clause
within an entity.
The checkConstraint element defines a constraint
which checks a conditional clause within an
entity.
if site>1 then plot>10
Check Condition
An SQL statement or other language
implementation of the condition for a check
constraint.
The checkCondition element defines an SQL
statement or other language implementation of the condition
for a check constraint. Generally this provides a means for
constraining the values within and among
entities.
(year > 1900 and year <
1990)
Language
The language that the is used to express or
implement the check constraint.
The language element declares the language
that is used to implement the check constraint. This is
typically the name and version of a programming language such as
Java, C, Perl, Basic, or other. Sometime it is the name and
version of a scriptable analysis system such as SAS, Matlab, R,
or SPlus.
perl 5.6.1
Foreign Key
A foreign key relationship among entities
The foreignKey element defines a foreign key
relationship among entities which relates this entity to another's
primary key.
Join Condition
A non primary/foreign key join
The joinCondition element describes any join of two
tables that is not done with a primary/foreign key
relationship.
JOIN code
Key
The set of attributes to which a foreign key
constraint refers.
The referencedKey element defines set of
attributes to which a foreign key constraint refers. If the
key refers to the primary key in the referenced entity, then
the "referencedKey" is optional. For a foreign key, the set
of attributes must match an identifying key in the referenced
entity.
site, plot
Attribute Name
Name of an attribute found in the
identified entity
The attributeReference element is the
name of an attribute that can be found in the identified
entity. This name will be unique within an entity and
specifies that the attribute participates in the key
that is being defined.
Not Null Constraint
A constraint that indicates that no null values
should be present for an attribute.
The notNullConstraint element defines a constraint
that indicates that no null values should be present for an
attribute in this entity.
Key
The set of attributes to which this constraint
applies.
The key element defines the set of attributes
to which this constraint applies. For a primary key or a
unique key, the set of attributes must be identifying. For a
foreign key, the set of attributes must match an identifying
key in the referenced entity. For a 'not null' constraint, the
key indicates the attribute which should not be
null.
Attribute Name
Name of an attribute found in the
identified entity
The attributeReference element is the
name of an attribute that can be found in the identified
entity. This name will be unique within an entity and
specifies that the attribute participates in the key
that is being defined.
Child portion of a cardinality expression
Child portion of a cardinality expression Allowed values
are positive integers including zero or the string value
"many".
The CardinalityChildOccurancesType element defines the
child portion of a cardinality expression. Allowed values are positive
integers including zero or the string value "many".
0,1, 2, 15,many
Name of the constraint
A meaningfull name of the constraint.
The constraintName element is a name which
represents a human readible and meaningful name for the
constraint.
PrimaryKey_birdSurvey
Description of the constraint
Descibes the purpose of the constraint.
The constraintDescription element describes the
nature of the constraint. It might be a description of a check
condition, or a statement about the composition of a primary key or
the nature of the relationship between two database tables or two
ascii files.
1.Must be greater than 0 but less than 100 2. "The
primary key of the table BIRD_SURVEY is composed of two
attributes:speciesCode and observationDate 3. The species name
associated with the species code in survey.txt can be found in the
file speciesList.txt
Key
The set of attributes to which this constraint
applies.
The key element defines the set of attributes to
which this constraint applies. For a primary key or a unique key,
the set of attributes must be identifying. For a foreign key, the
set of attributes must match an identifying key in the referenced
entity. For a 'not null' constraint, the key indicates the attribute
which should not be null.
Attribute Name
Name of an attribute found in the identified
entity
The attributeReference element is the name of
an attribute that can be found in the identified entity. This
name will be unique within an entity and specifies that the
attribute participates in the key that is being
defined.
Referenced Entity ID
The id of the parent-entity in a foreign key
constraint.
The entityReference element contains the id of the
entity to which a foreign key refers, otherwise known as the
parent-entity or parent-table. This should be an identifer that
matches one of the "identifier" elements for an
entity.
knb.79.4
Relationship type: Identifying or
non-identifying
Relationship type: Identifying or
non-identifying
The relationshipType element defines identifying
relationships that propagate from the parent entity's primary key to
the child's primary key. Non-identifying relationships propagate the
parent's primary key as a non-key attribute of the child
entity.
felationshipType code
Cardinality of the relationship between two
entities.
Cardinality of the relationship between a parent
entity and a child entity.
The cardinality element represents a statement of
the relationship between parent and child entities. Cardinality is
expressed as the ratio of related parent and child
entities. Cardinality 1 to N is a specific form of cardinalty in
which zero or one parent records are related to a specified number
of child records. The cardinality ratio for the parent entity
depends on whether the "existence" is mandatory (one or more) or
optional (zero to ...).
One to many
One to 10
Zero or One to Many
Parent portion of a 1 to exactly N
cardinality
Parent portion of a 1 to exactly N cardinality.
May have a value of either 0 or 1.
The parentOccurences element describes the
Parent portion of a 1 to exactly N cardinality. May have a
value of either 0 or 1. Value of 0 implies that the
"existence" of a child record is optional. Value of 1 implies
that the "existence" of a child record is
mandatory.
One to 10, Zero or One to Many
Child portion of the cardinality
expression
Child portion of a cardinality expression
Allowed values are positive integers including zero or the
string value "many".
The childOccurences element describes the
child portion of a cardinality expression Allowed values are
positive integers including zero or the string value
"many"
2, 15, many