<!--  Copyright (c) 1997 - 2000 Apelon, Inc. All rights reserved.   -->
<!--                                                                -->
<!--
 Ontylog is a description logic. The main terms in the logic are called
 Concepts and Roles. Concepts contain Role expressions, and can be
 defined in terms of other concepts, called superconcepts. Concepts
 have unique Kinds and are organized into a directed acyclic graph via
 a process called classification.
 Author: Ben Bitdiddle, Apelon, Inc.
-->
<!--
 A terminology is a collection of namespaces, KindDefs, RoleDefs,
 PropertyDefs, and ConceptDefs
-->
<!ELEMENT terminology
          (baselineVersion*,
           namespaceDef*,
           kindDef*,
           roleDef*,
           propertyDef*,
           associationDef*,
           qualifierDef*,
	   conceptDef*,
	   deleteConcept*)
          >
<!-- All terms are uniquely identified by name, id, or code -->
<!-- this applies to all terms in a terminology   -->
<!ATTLIST terminology ref_by (name | code | id) #REQUIRED>
<!-- what to do if a term already exists  -->
<!ATTLIST terminology if_exists_action (replace | error | ignore) #REQUIRED>
<!-- A terminology may designate a baseline version string.
-->
<!ELEMENT baselineVersion (#PCDATA) >
<!ATTLIST baselineVersion updateOnly CDATA #IMPLIED>
<!ATTLIST baselineVersion versionToUpdate CDATA #IMPLIED>
<!ELEMENT contentLicense (#PCDATA) >


<!-- a namespace is a collection of ConceptDefs, along with their -->
<!-- KindDefs, RoleDefs, and PropertyDefs -->
<!ELEMENT namespaceDef (name, code?, id?,contentLicense?) >
<!-- Every concept has a unique kind, kinds serve to break up a -->
<!-- namespace of concepts into smaller collections. -->
<!ELEMENT kindDef (name, code?, id?, namespace) >

<!-- reference kinds need not be classified as they are well-defined -->
<!ATTLIST kindDef reference (true | false) #REQUIRED>

<!ELEMENT qualifierDef (name, code?, id?, namespace, pickList?)>
<!--
Qualifier type can be CA, CP or CR.
  CA - qualifies an association between two concepts
  CP - qualifies a property attached to a concept
  CR - qualifies a role attached to a concept
-->
<!ATTLIST qualifierDef type (CR | CA | CP ) #REQUIRED>

<!-- concepts have roles, relations with other concepts -->
<!-- by defining roles as mappings between kinds we create -->
<!-- a dependency graph that generate an ordering of the Kinds -->
<!-- wrt classification. -->
<!ELEMENT roleDef (name, code?, id?, namespace,
                   domain, range, rightId?, parentRole?) >

<!-- certain properties might vary by region or geography -->
<!-- A locale provides a mechanism for this localization of properties -->
<!-- Locales form a tree, so that if a property doesn't specify -->
<!-- a value for a given locale, a value from a super locale -->
<!-- can be used. -->
<!ELEMENT localeDef (name, code?, id?, namespace, super?)>
<!--
  The value for range should be one of the following :
  string
  long_string
  real_long_string

  localized, containsIndex and pickList are used when range value is "string".

  properties have no semantic relevance in ontylog.
-->
<!ELEMENT propertyDef (name, code?, id?, namespace, range, localized?, containsIndex?, pickList?)>
<!--
  inverseName is used when the association also contains inverse relation.
  displayable is omittied when the inverse relation should not be diaplayed in GUI.
-->
<!ELEMENT associationDef (name, code?, id?, namespace, inverseName?, displayable?)>

<!ELEMENT pickList (pickListItem+)>
<!ELEMENT pickListItem (#PCDATA)>

<!-- The KindDef that a RoleDef maps from is called the domain -->
<!ELEMENT domain (#PCDATA) >
<!-- range element is used with RoleDef and PropertyDef.
  When used with RoleDef, it is the KindDef that a RoleDef maps to.
  When used with PropertyDef, it indicates the string type for the proeprty value.
-->
<!ELEMENT range (#PCDATA) >
<!-- A RoleDef can declare another RoleDef to be a Right
   Identity. When this occurs, the Right Identity is used during
   classification, composed with the given role to enable subsumption
   inferrences that would not otherwise be made.
-->
<!ELEMENT rightId (#PCDATA) >
<!-- A RoleDef can declare another RoleDef as its parent.
  This creates the role hierarchy which is used during classification.
-->
<!ELEMENT parentRole (#PCDATA) >

<!ELEMENT containsIndex EMPTY >

<!-- A ConceptDef is the major term in Ontylog. Concepts are primitive
  or defined, can have defining concepts, usually called superconcepts
  and have collections or defining roles which relate them to other
  concepts. Additionally concepts have collections of properties which
  allow non-semantic user-defined information to be added
-->
<!ELEMENT conceptDef
          (name,
           code?,
           id?,
           namespace,
           primitive?,
           kind?,
           definingConcepts,
           definingRoles,
           properties,
           associations?)
          >
<!-- A deleteConcept is a concept to be deleted from knowledgebase in case
of updates only import.
-->
<!ELEMENT deleteConcept (#PCDATA) >
<!ATTLIST deleteConcept name CDATA #REQUIRED>
<!ATTLIST deleteConcept code CDATA #REQUIRED>
<!ATTLIST deleteConcept id CDATA #REQUIRED>
<!ATTLIST deleteConcept namespace CDATA #REQUIRED>
<!-- A conceptInf is a concept that has been classified. It contains
     collections of concepts that represent the immediate concepts
     above and below the given concept.
-->
<!ELEMENT conceptInf
          (name,
           code?,
           id?,
           primitive?,
           kind?,
           directSups,
           directSubs,
           roles)
          >
<!-- The primitive tag is used to indicate whether a concept
     is primitive or defined
-->
<!ELEMENT primitive EMPTY >

<!-- every concept must have a unique kind. It can be inferred by
     the classifier and only need be defined for top level primitive
     concepts.
-->
<!ELEMENT kind (#PCDATA) >
<!-- a collection of concept references -->
<!ELEMENT definingConcepts (concept*) >
<!ELEMENT directSups (concept*) >
<!ELEMENT directSubs (concept*) >
<!-- a colleciton of Role expressions or RoleGroups -->
<!ELEMENT definingRoles (role*,roleGroup*)>
<!ELEMENT roleGroup (role+) >
<!ELEMENT roles (role*) >
<!-- a collection of Properties -->
<!ELEMENT properties (property*) >
<!-- a collection of associations -->
<!ELEMENT associations (association*) >
<!-- a collection of qualifiers -->
<!ELEMENT qualifiers (qualifier*) >
<!-- a reference to a concept -->
<!ELEMENT concept (#PCDATA) >
<!-- A role expression has a logical modifier, a name, and a value.
     .eg. "all substance_measured sodiun". The role name must be the
     name of a roleDef, the modifier can only be all or some and the
     value is a name of a concept.
 -->
<!ELEMENT role ((all | some | poss | not-all | not-some| some-not | all-not | some-or | all-or), name, value, qualifiers?)>
<!-- A property is a name, possibly locale, and value triplet. -->
<!-- The name must be the name of a propertyDef. -->
<!-- The value can be any string including an XML document. -->
<!-- The locale specifies the name of a locale -->
<!ELEMENT property (name, locale?, value, qualifiers?)>

<!ELEMENT association (name, value, qualifiers?)>

<!ELEMENT qualifier (name, value)>

<!ELEMENT term (name, id, value, properties)>

<!ELEMENT name (#PCDATA) >
<!ELEMENT namespace (#PCDATA) >
<!ELEMENT reference (boolean) >
<!ELEMENT code (#PCDATA) >
<!ELEMENT id (#PCDATA) >
<!ELEMENT value (#PCDATA) >
<!ELEMENT super (#PCDATA)>
<!ELEMENT inverseName (#PCDATA)>
<!ELEMENT qualifiedItem (#PCDATA)>
<!ELEMENT preferredName EMPTY >

<!ELEMENT all     EMPTY >
<!ELEMENT some    EMPTY >
<!ELEMENT poss    EMPTY >
<!ELEMENT not-all    EMPTY >
<!ELEMENT not-some    EMPTY >
<!ELEMENT some-not    EMPTY >
<!ELEMENT all-not    EMPTY >
<!ELEMENT some-or    EMPTY >
<!ELEMENT all-or    EMPTY >
<!ELEMENT localized EMPTY>
<!ELEMENT displayable EMPTY>
<!-- collections of various types -->
<!ELEMENT kindDefs (kindDef*) >
<!ELEMENT roleDefs (roleDef*) >
<!ELEMENT propertyDefs (propertyDef*) >
<!ELEMENT associationDefs (associationDef*) >
<!ELEMENT qualifierDefs (qualifierDef*) >

<!-- collections of properties can be loaded separately
     from terminologies and associated with concepts in
     existing database
-->
<!ELEMENT propertyValues (concept, namespace, property+)>


<!ELEMENT string (#PCDATA) >

<!ELEMENT boolean (true | false)>
<!ELEMENT true EMPTY>
<!ELEMENT false EMPTY>


