<?xml version='1.0'?>

<!-- LOGML schema for XGMML 1.0 -->
<!-- Authors: John Punin, Mukkai Krishnamoorthy and Gerard Uffelman -->
<!-- Computer Science Department -->
<!-- Rensselaer Polytechnic Institute -->
<!-- logml.xsd,v 1.0 10/11/2000 -->

<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN" "http://www.w3.org/2000/10/XMLSchema.dtd" [
<!ATTLIST schema xmlns:xml CDATA #IMPLIED
		 xmlns:xlink CDATA #IMPLIED
		 xmlns:xgmml CDATA #IMPLIED
		 xmlns:lml CDATA #IMPLIED> 
                 <!-- keep this schema XML1.0 valid -->
]>

<schema xmlns="http://www.w3.org/2000/10/XMLSchema" 
	targetNamespace="http://www.cs.rpi.edu/LOGML" 
	xmlns:xml="http://www.w3.org/XML/1998/namespace"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:xgmml="http://www.cs.rpi.edu/XGMML" 
	xmlns:lml="http://www.cs.rpi.edu/LOGML" 
	elementFormDefault="unqualified"
	attributeFormDefault="unqualified"
	version="logml 1.0">

<!-- get access to the xml: attribute groups for xml:lang -->
<import namespace="http://www.w3.org/XML/1998/namespace" 
	schemaLocation="http://www.w3.org/2000/10/xml.xsd"/>

<!-- Boolean type -->
<simpleType name="lml:boolean.type">
 <restriction base="nonNegativeInteger">
	  <enumeration value="0"/>
	  <enumeration value="1"/>
 </restriction>
</simpleType>

<!-- Positive number type -->
<simpleType name="lml:number.type">
  <restriction base="nonNegativeInteger"/>
</simpleType>

<!-- Token type -->
<simpleType name="lml:nmtoken.type">
  <restriction base="NMTOKEN"/>
</simpleType>

<!-- ID type -->
<simpleType name="lml:id.type">
  <restriction base="NMTOKEN"/>
</simpleType>

<!-- String type -->
<simpleType name="lml:string.type">
  <restriction base="string"/>
</simpleType>

<!-- URI type -->
<simpleType name="lml:uri.type">
  <restriction base="uriReference"/>
</simpleType>

<!--Date Type-->
<simpleType name="lml:date.type">
  <restriction base="string"/>
</simpleType>

<!-- Global Attributes -->
<attributeGroup name="lml:global-atts">
		<attribute name="lml:id" type="lml:id.type"/>
		<attribute name="lml:name" type="lml:string.type"/>
		<attribute name="lml:label" type="lml:string.type"/>
</attributeGroup>

<!-- Global Required Attributes -->
<attributeGroup name="lml:global-req-atts">
		<attribute name="lml:id" type="lml:id.type" use="required"/>
		<attribute name="lml:name" type="lml:string.type"/>
		<attribute name="lml:label" type="lml:string.type"/>
</attributeGroup>

<!-- Standard XML Attributes -->
<attributeGroup name="lml:xml-atts">
		<attribute name="xmlns" type="string" use="fixed"
		           value="http://www.cs.rpi.edu/LOGML"/>
		<attributeGroup ref="xml:lang"/>
		<attributeGroup ref="xml:space"/>
</attributeGroup>

<!-- XGMML Attributes -->
<attributeGroup name="lml:xgmml-atts">
		<attribute name="lml:weight" type="lml:number.type"/>
</attributeGroup>

<!-- General Access Log Attributes -->
<attributeGroup name="lml:log-acc-atts">
		<attribute name="lml:access_count" type="lml:number.type"/>
		<attribute name="lml:bytes" type="lml:number.type"/>
		<attribute name="lml:html_pages" type="lml:number.type"/>
</attributeGroup>


<!-- General Hit Log Attributes -->
<attributeGroup name="lml:log-hit-atts">
		<attribute name="lml:hits" type="lml:number.type"/>
		<attribute name="lml:bytes" type="lml:number.type"/>
		<attribute name="lml:html_pages" type="lml:number.type"/>
</attributeGroup>


<!-- General Count Log Attributes -->
<attributeGroup name="lml:log-count-atts">
		<attribute name="lml:total_count" type="lml:number.type"/>
		<attribute name="lml:bytes" type="lml:number.type"/>
		<attribute name="lml:html_pages" type="lml:number.type"/>
</attributeGroup>

<!-- Counter of Elements Attribute -->
<attributeGroup name="lml:count-att">
		<attribute name="lml:count" type="lml:number.type"/>
</attributeGroup>

<!--ROOT ELEMENT-->
<!--================================================================-->
<element name="lml:logml">
   <complexType>
     <sequence>
        <element ref="lml:graph" minOccurs="1" maxOccurs="1"/>
        <element ref="lml:hosts" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:domains" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:directories" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:userAgents" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:referers" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:hostReferers" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:keywords" minOccurs="0" maxOccurs="unbounded"/>
        <element ref="lml:summary" minOccurs="0" maxOccurs="1"/>
        <element ref="lml:userSessions" minOccurs="0" maxOccurs="1"/>
     </sequence>
       <attributeGroup ref="lml:global-atts"/>
       <attributeGroup ref="lml:xml-atts"/>
       <attribute name="lml:start_date" type="lml:date.type" use="required"/>
       <attribute name="lml:end_date" type="lml:date.type" use="required"/>
   </complexType>
</element>

<!--WEBSITE INFORMATION-->
<!--================================================================-->

<complexType name="lml:simpleLogGraph">
   <complexContent>
      <restriction base="xgmml:simpleGraph">
         <sequence>
	    <element ref="lml:att" minOccurs="0" maxOccurs="unbounded"/>
	    <choice minOccurs="0" maxOccurs="unbounded"> 
	        <element ref="xgmml:node"/>
		<element ref="xgmml:edge"/>
            </choice>
            <element ref="lml:att" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
           <attributeGroup ref="lml:global-atts"/>
	   <attribute name="lml:directed" type="lml:boolean.type"/>
      </restriction>
   </complexContent>
</complexType>

<!-- Graph Element -->
<element name="lml:graph" type="lml:simpleLogGraph"/>

<complexType name="lml:simpleLogNode">
   <complexContent>
      <restriction base="xgmml:simpleNode">
         <sequence>
	    <element ref="lml:att" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
           <attributeGroup ref="lml:global-req-atts"/>
           <attributeGroup ref="lml:xgmml-atts"/>
	   <attribute name="lml:hits" type="lml:number.type"/>
	   <attribute name="lml:ehits" type="lml:number.type"/>
	   <attribute name="lml:indp" type="lml:boolean.type"/>
      </restriction>
   </complexContent>
</complexType>

<!-- Node Element -->
<element name="lml:node" type="lml:simpleLogNode"/>


<!-- Edge Attributes (GML) -->
<attributeGroup name="lml:edge-atts">
    <attribute name="lml:source" type="lml:nmtoken.type" use="required"/>
    <attribute name="lml:target" type="lml:nmtoken.type" use="required"/>
</attributeGroup>

<complexType name="lml:simpleLogEdge">
   <complexContent>
      <restriction base="xgmml:simpleEdge">
         <sequence>
	    <element ref="lml:att" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
           <attributeGroup ref="lml:global-atts"/>
           <attributeGroup ref="lml:xgmml-atts"/>
           <attributeGroup ref="lml:edge-atts"/>
	   <attribute name="lml:hits" type="lml:number.type"/>
	   <attribute name="lml:indp" type="lml:boolean.type"/>
      </restriction>
   </complexContent>
</complexType>

<!-- Edge Element -->
<element name="lml:edge" type="lml:simpleLogEdge"/>

<!-- Att Element -->
<element name="lml:att">
     <complexType>
       <sequence>
	 <element ref="lml:att" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:value" type="lml:number.type"/>
     </complexType>
</element>

<!--HOST INFORMATION-->
<!--================================================================-->

<element name="lml:hosts">
     <complexType>
       <sequence>
	 <element ref="lml:host" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:host">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:ip" type="lml:string.type"/>
	 <attribute name="lml:is_internal" type="lml:boolean.type"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
     </complexType>
</element>

<!--DOMAIN INFORMATION-->
<!--================================================================-->

<element name="lml:domains">
     <complexType>
       <sequence>
	 <element ref="lml:domain" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:domain">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
     </complexType>
</element>

<!--DIRECTORY INFORMATION-->
<!--================================================================-->

<element name="lml:directories">
     <complexType>
       <sequence>
	 <element ref="lml:directory" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:directory">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:total_count" type="lml:number.type"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
     </complexType>
</element>

<!--USER AGENT INFORMATION-->
<!--================================================================-->

<element name="lml:userAgents">
     <complexType>
       <sequence>
	 <element ref="lml:userAgent" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:userAgent">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
	 <attribute name="lml:is_spider" type="lml:boolean.type"/>
     </complexType>
</element>

<!--REFERER INFORMATION-->
<!--================================================================-->

<element name="lml:referers">
     <complexType>
       <sequence>
	 <element ref="lml:referer" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:referer">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:target" type="lml:nmtoken.type"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
	 <attribute name="lml:is_internal" type="lml:boolean.type"/>
     </complexType>
</element>

<element name="lml:hostReferers">
     <complexType>
       <sequence>
	 <element ref="lml:hostReferer" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:hostReferer">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-acc-atts"/>
	 <attribute name="lml:is_search_engine" type="lml:boolean.type"/>
     </complexType>
</element>

<!--KEYWORD INFORMATION-->
<!--================================================================-->

<element name="lml:keywords">
     <complexType>
       <sequence>
	 <element ref="lml:keyword" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attribute name="lml:search_engine_name" type="lml:string.type"/>
	 <attribute name="lml:search_count" type="lml:number.type"/>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:keyword">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:total_count" type="lml:number.type"/>
     </complexType>
</element>


<!--GENERAL STATISTICS INFORMATION-->
<!--================================================================-->
<element name="lml:summary">
     <complexType>
       <sequence>
	<choice minOccurs="0" maxOccurs="unbounded"> 
            <element ref="lml:att"/>
	    <element ref="lml:httpCode"/>
	    <element ref="lml:httpMethod"/>
	    <element ref="lml:httpVersion"/>
	 </choice>
	 <element ref="lml:dateStat" minOccurs="0" maxOccurs="1"/>
       </sequence>
       <attribute name="lml:requests" type="lml:number.type"/>
       <attribute name="lml:sessions" type="lml:number.type"/>
       <attribute name="lml:bytes" type="lml:number.type"/>
       <attribute name="lml:html_pages" type="lml:number.type"/>
       <attribute name="lml:nhtml_pages" type="lml:number.type"/>
       <attribute name="lml:inline_objects" type="lml:number.type"/>
       <attribute name="lml:hyperlinks_html" type="lml:number.type"/>
       <attribute name="lml:hyperlinks_nhtml" type="lml:number.type"/>
       <attribute name="lml:html_entry_pages" type="lml:number.type"/>
       <attribute name="lml:nhtml_entry_pages" type="lml:number.type"/>
       <attribute name="lml:unique_sites" type="lml:number.type"/>
       <attribute name="lml:unique_host_referers" type="lml:number.type"/>
       <attribute name="lml:unique_se_referers" type="lml:number.type"/>
       <attribute name="lml:unique_external_url_referers" type="lml:number.type"/>
       <attribute name="lml:unique_internal_url_referers" type="lml:number.type"/>
       <attribute name="lml:unique_user_agents" type="lml:number.type"/>
       <attribute name="lml:requests_hour" type="lml:number.type"/>
       <attribute name="lml:requests_day" type="lml:number.type"/>
       <attribute name="lml:kbytes_day" type="lml:number.type"/>
       <attribute name="lml:kbytes_hour" type="lml:number.type"/>
       <attribute name="lml:searches" type="lml:number.type"/>
       <attribute name="lml:unique_keywords" type="lml:number.type"/>
     </complexType>
</element>

<element name="lml:httpCode">
     <complexType>
	 <attribute name="lml:code" type="lml:number.type"/>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-count-atts"/>
     </complexType>
</element>

<element name="lml:httpMethod">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-count-atts"/>
     </complexType>
</element>

<element name="lml:httpVersion">
     <complexType>
	 <attributeGroup ref="lml:global-atts"/>
	 <attributeGroup ref="lml:log-count-atts"/>
     </complexType>
</element>

<element name="lml:dateStat">
     <complexType>
       <sequence>
	 <choice minOccurs="1" maxOccurs="unbounded"> 
            <element ref="lml:monthStat"/>
	    <element ref="lml:dayStat"/>
	    <element ref="lml:hourStat"/>
	 </choice>
       </sequence>
     </complexType>
</element>

<element name="lml:monthStat">
     <complexType>
	 <attribute name="lml:month" type="lml:nmtoken.type"/>
	 <attributeGroup ref="lml:log-hit-atts"/>
     </complexType>
</element>


<element name="lml:dayStat">
     <complexType>
	 <attribute name="lml:day" type="lml:nmtoken.type"/>
	 <attributeGroup ref="lml:log-hit-atts"/>
     </complexType>
</element>


<element name="lml:hourStat">
     <complexType>
	 <attribute name="lml:hour" type="lml:nmtoken.type"/>
	 <attributeGroup ref="lml:log-hit-atts"/>
     </complexType>
</element>

<!--USER SESSION INFORMATION-->
<!--================================================================-->


<element name="lml:userSessions">
     <complexType>
       <sequence>
	 <element ref="lml:userSession" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
	 <attribute name="lml:max_edges" type="lml:number.type"/>
	 <attribute name="lml:min_edges" type="lml:number.type"/>
     </complexType>
</element>

<element name="lml:userSession">
     <complexType>
       <sequence>
	 <element ref="lml:path" minOccurs="1" maxOccurs="1"/>
       </sequence>
	 <attributeGroup ref="lml:global-atts"/>
	 <attribute name="lml:ureferer" type="lml:uri.type"/>
	 <attribute name="lml:entry_page" type="lml:uri.type"/>
	 <attribute name="lml:start_time" type="lml:date.type"/>
	 <attribute name="lml:access_count" type="lml:number.type"/>
     </complexType>
</element>

<element name="lml:path">
     <complexType>
       <sequence>
	 <element ref="lml:uedge" minOccurs="1" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="lml:count-att"/>
     </complexType>
</element>

<element name="lml:uedge">
     <complexType>
	 <attributeGroup ref="lml:edge-atts"/>
	 <attribute name="lml:utime" type="lml:date.type"/>
     </complexType>
</element>

</schema>





