<?xml version="1.0" encoding="UTF-8"?>
<!--  $Id: comm_para.xsd,v 1.18 2011/04/18 21:08:09 ginger Exp $--> 
<xs:schema 
targetNamespace="http://ns.nsdl.org/ncs/comm_para" 
xmlns="http://ns.nsdl.org/ncs/comm_para" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" 
attributeFormDefault="unqualified" 
version="1.00">
	<xs:annotation>
		<xs:documentation>********************************************</xs:documentation>
		<xs:documentation>***** SCHEMA DEVELOPMENT  *****</xs:documentation>
		<xs:documentation>********************************************</xs:documentation>
		<xs:documentation>Created: 2011-01-10</xs:documentation>
		<xs:documentation>Author: Katy Ginger, University Corporation for Atmospheric Research (UCAR), ginger@ucar.edu</xs:documentation>
		<xs:documentation>Purpose: support the exchange of summative paradata (information about resource use)</xs:documentation>
		<xs:documentation>Copyright for this file: See LICENSE AND COPYRIGHT at the end of this file.</xs:documentation>
	</xs:annotation>
		
		<xs:annotation>
		<xs:documentation>****************************************************</xs:documentation>
		<xs:documentation>***** HISTORY of IMPORTANT CHANGES *****</xs:documentation>
		<xs:documentation>****************************************************</xs:documentation>
		<xs:documentation>2011-04-15: added language and catalog attributes, broke the audience attribute into 3 attributes (audience, edLevel, subject), added usageDataResourceIdentifier element</xs:documentation>
		<xs:documentation>There is an older version 0.1. This version 1.00 came into effect 2001-01-10.</xs:documentation>
		<xs:documentation>2011-02-23: Design notes: 1) removed record date because each paradata element now has its own date which should be used in all processing. 2) removed urlType because if one wants to add/correlate a standard or say the resource is featured in another resource, an annotation record (not this paradata record) should be used. 3) did not really account for language 4) removed usageDataProvidedForId because not sure if anyone was going to use it. It was required and occurred once. 5) made usageDataReferenceURL optional instead of required 5) added an audience (with a controlled vocab) to each element.</xs:documentation>
	</xs:annotation>

<xs:annotation>
		<xs:documentation>******************************************************</xs:documentation>
		<xs:documentation>***** INCLUDED/ IMPORTED SCHEMAS  *****</xs:documentation>
		<xs:documentation>******************************************************</xs:documentation>
		<xs:documentation>See individual schemas for documentation</xs:documentation>
	</xs:annotation>
	<xs:include schemaLocation="vocabs/audience.xsd"/>
	<xs:include schemaLocation="vocabs/subject.xsd"/>
	<xs:include schemaLocation="vocabs/edLevel.xsd"/>
	<xs:include schemaLocation="vocabs/integerType.xsd"/>
	<xs:include schemaLocation="vocabs/stringType.xsd"/>
	<xs:include schemaLocation="vocabs/ratingType.xsd"/>
	<xs:include schemaLocation="vocabs/rankType.xsd"/>
	<xs:include schemaLocation="vocabs/voteType.xsd"/>
	
	
	<xs:annotation>
		<xs:documentation>***************************************************</xs:documentation>
		<xs:documentation>*****  COMPLEX TYPES  (alpha order) *****</xs:documentation>
		<xs:documentation>***************************************************</xs:documentation>
		<xs:documentation>floatType - is part of usageDataSummaryType</xs:documentation>
		<xs:documentation>integerType - is part of usageDataSummaryType</xs:documentation>
		<xs:documentation>languageStringType - is part of paradataRecordType</xs:documentation>
		<xs:documentation>langStringType - is part of paradataRecordType</xs:documentation>
		<xs:documentation>moreInfoType - is part of paradataRecordType</xs:documentation>
		<xs:documentation>paradataRecordType - is the ROOT type</xs:documentation>
		<xs:documentation>rankType - is part of usageDataSummaryType</xs:documentation>
		<xs:documentation>ratingType - is part of usageDataSummaryType</xs:documentation>
		<xs:documentation>stringType - is part of usageDataSummaryType</xs:documentation>
		<xs:documentation>usageDataSummaryType - is part of paradataRecordType</xs:documentation>
		<xs:documentation>voteType - is part of usageDataSummaryType</xs:documentation>
	</xs:annotation>

	<xs:annotation>
		<xs:documentation>*********************************</xs:documentation>
		<xs:documentation>*****  ROOT ELEMENT *****</xs:documentation>
		<xs:documentation>*********************************</xs:documentation>
			<xs:documentation>commParadata - the root element of the community paradata record</xs:documentation>
	</xs:annotation>
	<xs:element name="commParadata" type="paradataRecordType"/>

	<xs:annotation>
		<xs:documentation>*********************************</xs:documentation>
		<xs:documentation>*****  ATTRIBUTE GROUPS  *****</xs:documentation>
		<xs:documentation>*********************************</xs:documentation>
		<xs:documentation>timeAudience - tracks start and end time, audience and language for the usage data</xs:documentation>
	</xs:annotation>
	<xs:attributeGroup name="timeAudience">
		<xs:annotation>
				<xs:documentation>dateTimeStart - the beginning valid date and time for the usage data</xs:documentation>
				<xs:documentation>dateTimeStart - the ending valid date and time for the usage data</xs:documentation>
				<xs:documentation>audience - the audience providing the usage data</xs:documentation>
		</xs:annotation>
		<xs:attribute name="dateTimeStart" type="xs:dateTime" use="required"/>
		<xs:attribute name="dateTimeEnd" type="xs:dateTime" use="required"/>
		<xs:attribute name="audience" type="audienceType" use="optional"/>
		<xs:attribute name="edLevel" type="edLevelType" use="optional"/>
		<xs:attribute name="subject" type="subjectType" use="optional"/>
	</xs:attributeGroup>

<!--
		<xs:complexType name="floatType">
		<xs:annotation>
			<xs:documentation>*****  floatType  *****</xs:documentation>
			<xs:documentation>type - the kind of float data being summarized</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:float">
				<xs:attribute name="type" type="floatTypeType" use="required"/>
				<xs:attributeGroup ref="timeAudience"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
-->

	<xs:complexType name="integerType">
		<xs:annotation>
			<xs:documentation>*****  integerType  *****</xs:documentation>
			<xs:documentation>type - the kind of integer data being summarized</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:nonNegativeInteger">
				<xs:attribute name="type" type="integerTypeType" use="required"/>
				<xs:attributeGroup ref="timeAudience"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="languageStringType">
		<xs:annotation>
			<xs:documentation>*****  languageStringType  *****</xs:documentation>
			<xs:documentation>string content for paradataTitle, paradataDescription and usageDataProvidedForName elements so that information can be provided in multiple languages</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="string" type="langStringType" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="langStringType">
		<xs:annotation>
			<xs:documentation>*****  langStringType  *****</xs:documentation>
			<xs:documentation>the two-letter abbreviation for the language of the contents of the string element</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="language" type="xs:language" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

<xs:complexType name="moreInfoType">
	<xs:annotation>
		<xs:documentation>***** moreInfoType *****</xs:documentation> 
		<xs:documentation>moreInfoType - allows any additional XML elements (not plain text) to be in the paradata record</xs:documentation> 
	</xs:annotation>
	<xs:sequence>
		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" /> 
	</xs:sequence>
</xs:complexType>
	
	<xs:complexType name="paradataRecordType">
		<xs:annotation>
			<xs:documentation>*****  paradataRecordType  *****</xs:documentation>
			<xs:documentation>paradataRecordType - the root element type for the community paradata record</xs:documentation>
			<xs:documentation>recordId - a unique identification number used to identify an individual paradata record (not the resource)</xs:documentation>
			<xs:documentation>recordDate - calendar date for the creation or modification of the paradata record</xs:documentation>
			<xs:documentation>paradataTitle - the title of the paradata/annotation if one exists or is appropriate</xs:documentation>
			<xs:documentation>paradataDescription - a narrative of the paradata/annotation if one exists or is appropriate</xs:documentation>
			<xs:documentation>usageDataReferenceURL - a URL to a landing page that has the summary of paradata information from a particular provider</xs:documentation>
			<xs:documentation>usageDataResourceURL - a URL to the resource to which the paradata applies</xs:documentation>
			<xs:documentation>usageDataResourceIdentifier - a number, handle, code to the resource to which the paradata applies (for use in local applications; do not expect others to know how to process the content</xs:documentation>
			<xs:documentation>usageDataProvidedForName - the title of the resource to which the paradata applies</xs:documentation>
			<xs:documentation>usageDataSummary - a set of several usage statistics/information about a resource</xs:documentation>
			<xs:documentation>moreInfo - an element for any additional well-formed XML to be placed in the paradata record</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="recordId" type="recordIdType" minOccurs="1" maxOccurs="unbounded"/>
 			<xs:element name="paradataTitle" type="languageStringType" minOccurs="0" maxOccurs="1"/>
 			<xs:element name="paradataDescription" type="languageStringType" minOccurs="0" maxOccurs="1"/>
 			<xs:element name="usageDataReferenceURL" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
 			<xs:element name="usageDataResourceURL" type="xs:anyURI" minOccurs="1" maxOccurs="1"/>
 			<xs:element name="usageDataResourceIdentifier" type="recordIdType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="usageDataProvidedForName" type="languageStringType" minOccurs="0" maxOccurs="1"/>
 			<xs:element name="usageDataSummary" type="usageDataSummaryType" minOccurs="0" maxOccurs="1"/>
 			<xs:element name="moreInfo" type="moreInfoType" minOccurs="0" maxOccurs="1"/> 
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="rankType">
		<xs:annotation>
			<xs:documentation>*****  rankType  *****</xs:documentation>
			<xs:documentation>the content value for the rank element is the position of the resource in a hierarchy</xs:documentation>
			<xs:documentation>type - the kind of ranking information (position in a hierarchy) being summarized</xs:documentation>
			<xs:documentation>name - the title of the ranking performed (popular, easiest, of something)</xs:documentation>
			<xs:documentation>best - the best value in the ranking</xs:documentation>
			<xs:documentation>worst- the worst value in the ranking</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:nonNegativeInteger">
				<xs:attribute name="type" type="rankTypeType" use="required"/>
				<xs:attribute name="name" type="xs:string" use="required"/>
				<xs:attribute name="best" type="xs:nonNegativeInteger" use="required"/>
				<xs:attribute name="worst" type="xs:nonNegativeInteger" use="required"/>
				<xs:attributeGroup ref="timeAudience"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="ratingType">
		<xs:annotation>
			<xs:documentation>*****  ratingType  *****</xs:documentation>
			<xs:documentation>the content value for the rating element is the average rating for the resource</xs:documentation>
			<xs:documentation>type - the kind of rating information being summarized</xs:documentation>
			<xs:documentation>min - the minimal allowable rating value</xs:documentation>
			<xs:documentation>max - the maximum allowable rating value</xs:documentation>
			<xs:documentation>total - the number of ratings used in the average calculation</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:float">
				<xs:attribute name="type" type="ratingTypeType" use="required"/>
				<xs:attribute name="min" type="xs:float" use="required"/>
				<xs:attribute name="max" type="xs:float" use="required"/>
				<xs:attribute name="total" type="xs:nonNegativeInteger" use="required"/>
				<xs:attributeGroup ref="timeAudience"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="recordIdType">
		<xs:annotation>
			<xs:documentation>*****  recordIdType  *****</xs:documentation>
			<xs:documentation>catalog - the name, code or indentifying information for the recordID number of the paradata record (not resource metadata record)</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="catalog" type="xs:string" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="stringType">
		<xs:annotation>
			<xs:documentation>*****  stringType  *****</xs:documentation>
			<xs:documentation>type - the kind of string or textual data being summarized</xs:documentation>
			<xs:documentation>total - the number of times the string or textual data has been associated with the resource</xs:documentation>
			<xs:documentation>langugae - the language of the usage data</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="type" type="stringTypeType" use="required"/>
				<xs:attribute name="total" type="xs:nonNegativeInteger" use="optional"/>
				<xs:attributeGroup ref="timeAudience"/>
				<xs:attribute name="language" type="xs:language" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="usageDataSummaryType">
		<xs:annotation>
			<xs:documentation>*****  usageDataSummaryType  *****</xs:documentation>
			<xs:documentation>integer - an integer value representing the number of times certain actions (viewed, favorited, featured) have been performed on the resource</xs:documentation>
			<xs:documentation>float - a float value representing the number of times certain actions  () have been performed on the resource</xs:documentation>
			<xs:documentation>string - a textual value that has been associated to the resource; can also indicate the number of times the textual value has been associated with the resource</xs:documentation>
			<xs:documentation>rating - a numerical average that represents the judging of a resource on a numerical scale; includes: 1) the minimum and maximum numerical values of the scale used, 2) the type of rating performed (e.g. star, usability) and 3) the total number of ratings performed</xs:documentation>
			<xs:documentation>voting - the numerical values representing the number of positive and negative responses to a resource; includes the type of voting performed (accurate, useful)</xs:documentation>
			<xs:documentation>rank - the numerical value representing the standing of a resource in a hierarchy; includes 1) the numerical minimum and maximum ranking values, 2) the type of ranking performed (best, most) and the 3) the name of the ranking (e.g. of 2010, popular, used, easiest)</xs:documentation>
		</xs:annotation>
		<xs:sequence>
<!--			<xs:element name="float" type="floatType" minOccurs="0" maxOccurs="1"/>--> <!--do not have a good example yet-->
			<xs:element name="integer" type="integerType" minOccurs="0" maxOccurs="unbounded"/>
 			<xs:element name="string" type="stringType" minOccurs="0" maxOccurs="unbounded"/>
 			<xs:element name="rating" type="ratingType" minOccurs="0" maxOccurs="unbounded"/>
 			<xs:element name="vote" type="voteType" minOccurs="0" maxOccurs="unbounded"/>
 			<xs:element name="rank" type="rankType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="voteType">
		<xs:annotation>
			<xs:documentation>*****  voteType  *****</xs:documentation>
			<xs:documentation>there is no content value for the vote element; content only appears in attributes</xs:documentation>
			<xs:documentation>type - the kind of voting information being summarized</xs:documentation>
			<xs:documentation>positive - the minimal allowable rating value expressed as a decimal</xs:documentation>
			<xs:documentation>negative - the maximum allowable rating value expressed as a decimal</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="type" type="voteTypeType" use="required"/>
				<xs:attribute name="positive" type="xs:nonNegativeInteger" use="required"/>
				<xs:attribute name="negative" type="xs:nonNegativeInteger" use="required"/>
				<xs:attributeGroup ref="timeAudience"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:schema>
<!--LICENSE AND COPYRIGHT
The contents of this file are subject to the Educational Community License v1.0 (the "License"); you may not use this file except in compliance with the License. You should obtain a copy of the License from http://www.opensource.org/licenses/ecl1.php. Files distributed under the License are distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyright 2002-2011 by Digital Learning Sciences, University Corporation for Atmospheric Research (UCAR). All rights reserved.-->