<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
          <!ENTITY rat  "http://www.tvblob.com/ratings/#" >
          <!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
          <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
          <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
          <!ENTITY owl  "http://www.w3.org/2002/07/owl#" >
          <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
          <!ENTITY dc  "http://purl.org/dc/elements/1.1/" >
]>
<rdf:RDF xmlns="&rat;" xml:base="&rat;" xmlns:owl="&owl;"
	xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:dc="&dc;"
	xmlns:foaf="&foaf;">

	<!-- header -->
	<owl:AnnotationProperty rdf:about="&dc;creator" />

	<owl:Ontology rdf:about="">
		<owl:versionInfo>0.8</owl:versionInfo>
		<rdfs:label>Ratings Ontology</rdfs:label>
		<rdfs:comment>Ratings about heterogeneous items.</rdfs:comment>
		<dc:creator>
			Cristiano Longo at TvBlob S.r.l Milan, Italy
		</dc:creator>
		<rdfs:seeAlso rdf:resource="http://xmlns.com/foaf/0.1/" />
	</owl:Ontology>

	<!-- ratings class -->
	<owl:Class rdf:ID="Rating">
		<rdfs:label>Rating</rdfs:label>
		<rdfs:comment>
			a sort of preference, or judgment, assessed by a user or a
			software agent about a generic item.
		</rdfs:comment>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#assessedBy" />
				<owl:cardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:cardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#about" />
				<owl:cardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:cardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#collectedBy" />
				<owl:cardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:cardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#value" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
	</owl:Class>

	<!-- Rating propery -->
	<owl:Datatype rdf:ID="numerical">
		<owl:unionOf parseType="Collection">
			<owl:Datatype rdf:about="&xsd;decimal" />
			<owl:Datatype rdf:about="&xsd;float" />
		</owl:unionOf>
	</owl:Datatype>
	
	<owl:ObjectProperty rdf:ID="assessedBy">
		<rdfs:label>assessedBy</rdfs:label>
		<rdfs:comment>The rating asserter.</rdfs:comment>
		<rdfs:domain rdf:resource="#Rating" />
		<rdfs:range>
			<owl:Class rdf:about="&foaf;Agent" />
		</rdfs:range>
	</owl:ObjectProperty>

	<owl:ObjectProperty rdf:ID="about">
		<rdfs:label>about</rdfs:label>
		<rdfs:comment>The rated item.</rdfs:comment>
		<rdfs:domain rdf:resource="#Rating" />
	</owl:ObjectProperty>

	<owl:DatatypeProperty rdf:ID="value">
		<rdfs:label>value</rdfs:label>
		<rdfs:comment>
			A numerical value assigned to this rating.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#Rating" />
		<rdfs:range rdf:resource="#numerical" />
	</owl:DatatypeProperty>

	<owl:ObjectProperty rdf:ID="collectedBy">
		<rdfs:label>collectedBy</rdfs:label>
		<rdfs:comment>
			The engine that collected this rating.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#Rating" />
		<rdfs:range rdf:resource="#RatingsCollector" />
	</owl:ObjectProperty>

	<!-- Rating collectors -->

	<owl:Class rdf:ID="RatingsCollector">
		<rdfs:label>RatingsCollector</rdfs:label>
		<rdfs:comment>
			An engine that collects ratings. Usually a web site or an
			automated agent.
		</rdfs:comment>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#mode" />
				<owl:cardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:cardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Class>
				<owl:unionOf rdf:parseType="Collection">
					<owl:Class rdf:about="#RatingValuesEnumeration" />
					<owl:Class rdf:about="#RatingValuesRange" />
				</owl:unionOf>
			</owl:Class>
		</rdfs:subClassOf>
	</owl:Class>

	<!-- Allowed ratings descriptors -->

	<owl:Class rdf:ID="RatingValuesEnumeration">
		<rdfs:label>Allowed Rating Values Enumeration</rdfs:label>
		<rdfs:comment>
			Models a discrete ﬁnite ratings set via exhaustive
			enumeration of available rating values.
		</rdfs:comment>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#hasAllowedRatingValue" />
				<owl:minCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:minCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#hasRatingValuesRangeLowerBound" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					0
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#hasRatingValuesRangeUpperBound" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					0
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#ratingValuesEquispacedWithDistance" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					0
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
	</owl:Class>

	<owl:Class rdf:ID="RatingValuesRange">
		<rdfs:label>Allowed Rating Values Interval</rdfs:label>
		<rdfs:comment>
			Describe the set of allowed rating values as an interval.
		</rdfs:comment>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty rdf:resource="#hasAllowedRatingValue" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					0
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#hasRatingValuesRangeLowerBound" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#hasRatingValuesRangeUpperBound" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
		<rdfs:subClassOf>
			<owl:Restriction>
				<owl:onProperty
					rdf:resource="#ratingValuesEquispacedWithDistance" />
				<owl:maxCardinality
					rdf:datatype="&xsd;nonNegativeInteger">
					1
				</owl:maxCardinality>
			</owl:Restriction>
		</rdfs:subClassOf>
	</owl:Class>

	<!--  hybrid descriptors are forbidden. -->
	<owl:Class rdf:about="#RatingValuesEnumeration">
		<owl:disjointWith rdf:resource="#RatingValuesEnumeration" />
	</owl:Class>

	<!-- Rating Collector properties -->

	<owl:ObjectProperty rdf:ID="mode">
		<rdfs:label>mode</rdfs:label>
		<rdfs:comment>
			How this ratings has been collected.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#RatingsCollector" />
		<rdfs:range>
			<owl:Class>
				<owl:oneOf rdf:parseType="Collection">
					<owl:Thing rdf:ID="IMPLICIT_MODE">
						<rdfs:label>
							Implicit collection mode
						</rdfs:label>
						<rdfs:comment>
							Implicit model should be used when the
							ratings collector does not ask explicitly
							the user to enter a rating, but observe the
							user behaviour to infer the rating value.
						</rdfs:comment>
					</owl:Thing>
					<owl:Thing rdf:ID="EXPLICIT_MODE">
						<rdfs:label>
							Explicit collection mode
						</rdfs:label>
						<rdfs:comment>
							Must be used with rating collectors that
							deal with ratings assessed explicitly by
							users.
						</rdfs:comment>
					</owl:Thing>
				</owl:oneOf>
			</owl:Class>
		</rdfs:range>
	</owl:ObjectProperty>


	<!-- Ratings Collector rating values description properties -->

	<owl:DatatypeProperty rdf:ID="hasAllowedRatingValue">
		<rdfs:label>hasAllowedRatingValue</rdfs:label>
		<rdfs:comment>
			Used to describe allowed rating values discrete finite set.
			Add a value to a discrete finite set of allowed rating
			values.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#RatingsCollector" />
		<rdfs:range rdf:resource="#numerical" />
	</owl:DatatypeProperty>

	<owl:DatatypeProperty rdf:ID="hasRatingValuesRangeLowerBound">
		<rdfs:label>Ratings Range Lower Bound</rdfs:label>
		<rdfs:comment>
			Lower bound of the allowed ratings interval. This value
			belong to the interval.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#RatingsCollector" />
		<rdfs:range rdf:resource="#numerical" />
	</owl:DatatypeProperty>

	<owl:DatatypeProperty rdf:ID="hasRatingValuesRangeUpperBound">
		<rdfs:label>Ratings Range Lower Bound</rdfs:label>
		<rdfs:comment>
			Upper bound of the allowed ratings interval. This value
			belong to the interval.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#RatingsCollector" />
		<rdfs:range rdf:resource="#numerical" />
	</owl:DatatypeProperty>

	<owl:DatatypeProperty rdf:ID="ratingValuesEquispacedWithDistance">
		<rdfs:label>Equally spaced ratings distance</rdfs:label>
		<rdfs:comment>
			Distance between two consecutive ratings in the allowed
			ratings interval.
		</rdfs:comment>
		<rdfs:domain rdf:resource="#RatingsCollector" />
		<rdfs:range rdf:resource="#numerical" />
	</owl:DatatypeProperty>
</rdf:RDF>