<!--  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,
	   linkDef*,
	   termDef*,
	   conceptDecl*,
	   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) >
<!ELEMENT contentLicense (#PCDATA) >

<!--New elements to support qualifiers and associations-->
<!ELEMENT inverseName (#PCDATA)>
<!ELEMENT associationDef (name, code, id, namespace, inverseName)>
<!ELEMENT qualifiers (qualifier)>
<!ELEMENT qualifier (name, value)>
<!ELEMENT qualifierDef (name, code, id, namespace)>
<!ATTLIST qualifierDef
	type CDATA #REQUIRED
>
<!-- 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>

<!-- 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 parentRole (#PCDATA)>
<!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?)>
<!-- properties have no semantic relevance in ontylog -->
<!ELEMENT propertyDef (name, code?, id?, namespace, range, localized?, containsIndex?, pickList?)>
<!ELEMENT pickList (pickListItem+)>
<!ELEMENT pickListItem (#PCDATA)>

<!ELEMENT termDef (name, code?, id?, namespace)>
<!ELEMENT linkDef (#PCDATA)>
<!-- The KindDef that a RoleDef maps from is called the domain -->
<!ELEMENT domain (#PCDATA) >
<!-- The KindDef that a RoleDef maps to is called the range -->
<!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) >

<!ELEMENT containsIndex EMPTY >

<!ELEMENT conceptDecl
          (name,
           code?,
           id?,
           namespace,
           terms,
           links,
           properties)
           >

<!-- 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)
          >
<!-- 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 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 ),name,value)>
<!-- 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 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 all     EMPTY >
<!ELEMENT some    EMPTY >
<!ELEMENT localized EMPTY>
<!-- collections of various types -->
<!ELEMENT kindDefs (kindDef*) >
<!ELEMENT roleDefs (roleDef*) >
<!ELEMENT propertyDefs (propertyDef*) >

<!-- 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>


