<?xml version="1.0"?>

<!-- Created by Paolo Ciccarese http://www.hcklab.org/people/pc/ on October 7th, 2008 -->

<!DOCTYPE rdf:RDF [
    <!-- Support namespaces -->
    <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY owl  "http://www.w3.org/2002/07/owl#" >
    <!ENTITY dc   "http://purl.org/dc/elements/1.1/" >
    <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
    
    <!-- Main namespace -->
    <!ENTITY collections "http://swan.mindinformatics.org/ontologies/1.2/collections/" >
    
    <!-- Main Files -->
  	<!ENTITY local "file:///Users/paolociccarese/Websites/Mindinformatics/ontologies/1.2/collections.owl">
  	<!ENTITY path "http://swan.mindinformatics.org/ontologies/1.2/collections.owl">
  	<!ENTITY file "&path;">
]>


<rdf:RDF 
    xml:base="&collections;"
	xmlns="&collections;"
    xmlns:xsd="&xsd;"
    xmlns:rdf="&rdf;"
    xmlns:rdfs="&rdfs;" 
    xmlns:owl="&owl;"
    xmlns:dc="&dc;"
    xmlns:foaf="&foaf;">

	<owl:Ontology rdf:about="&file;">
		<rdf:type rdf:resource="&owl;Ontology"/>
        <rdfs:label rdf:datatype="&xsd;string">Collections v. 1.2</rdfs:label>
        <owl:versionInfo rdf:datatype="&xsd;string">1.2</owl:versionInfo>
        
        <dc:language>en</dc:language>
        <dc:title xml:lang="en">Collections ontology</dc:title>
        <dc:creator rdf:resource="http://www.hcklab.org/people/paolo-ciccarese/" />
        <dc:contributor rdf:datatype="&xsd;string">Paolo Ciccarese</dc:contributor>
        <dc:contributor rdf:datatype="&xsd;string">Marco Ocana</dc:contributor>
        <dc:publisher rdf:resource="http://swan.mindinformatics.org" />
        <dc:date rdf:datatype="&xsd;string">January 14, 2009</dc:date>
        <dc:format rdf:datatype="&xsd;string">rdf/xml</dc:format>
  	</owl:Ontology>
	
    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Annotation Properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->
  	<rdf:Description rdf:about="&dc;title">
  	  	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	<rdf:Description rdf:about="&dc;date">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
 	</rdf:Description>
  	<rdf:Description rdf:about="&dc;creator">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	<rdf:Description rdf:about="&dc;format">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	<rdf:Description rdf:about="&dc;language">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	<rdf:Description rdf:about="&dc;publisher">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	<rdf:Description rdf:about="&dc;contributor">
    	<rdf:type rdf:resource="&owl;AnnotationProperty"/>
  	</rdf:Description>
  	
    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Object Properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->
    
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/element -->
    <owl:ObjectProperty rdf:about="element">
        <rdfs:comment rdf:datatype="&xsd;string"
            >element - The link to the members of a Set</rdfs:comment>
        <rdfs:domain rdf:resource="Collection"/>
    </owl:ObjectProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections.owl#firstItem -->
    <owl:FunctionalProperty rdf:about="firstItem">
    	<rdf:type rdf:resource="&owl;ObjectProperty"/>
        <rdfs:domain rdf:resource="List"/>
        <rdfs:subPropertyOf rdf:resource="item"/>
        <rdfs:range rdf:resource="ListItem"/>
    </owl:FunctionalProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/followedBy -->
    <owl:ObjectProperty rdf:about="followedBy">
        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >followedBy - The link to the first item of the list</rdfs:comment>
        <rdfs:domain rdf:resource="ListItem"/>
        <rdfs:range rdf:resource="ListItem"/>
    </owl:ObjectProperty>
    
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/item -->
    <owl:ObjectProperty rdf:about="item">
        <rdfs:comment rdf:datatype="&xsd;string"
            >item - The link to every item of the Bag</rdfs:comment>
        <rdfs:subPropertyOf rdf:resource="element"/>
        <rdfs:domain rdf:resource="Bag"/>
        <rdfs:range rdf:resource="Item"/>
    </owl:ObjectProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/itemContent -->
    <owl:ObjectProperty rdf:about="itemContent">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >itemContent - The link to the actual resource to which the item refers.</rdfs:comment>
        <rdfs:domain rdf:resource="Item"/>
        <rdfs:range>
			<owl:Class>
		    	<owl:complementOf>		    		<owl:Class rdf:about="Item"/>		    	</owl:complementOf>
		    </owl:Class>
        </rdfs:range>
    </owl:ObjectProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/lastItem -->
    <owl:FunctionalProperty rdf:about="lastItem">
    	<rdf:type rdf:resource="&owl;ObjectProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >lastItem - The link to the first item of the list</rdfs:comment>
        <rdfs:domain rdf:resource="List"/>
        <rdfs:subPropertyOf rdf:resource="item"/>
        <rdfs:range rdf:resource="ListItem"/>
    </owl:FunctionalProperty>   

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/nextItem -->
    <owl:ObjectProperty rdf:about="nextItem">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >nextItem - The link to the next item in a list (ordered collection)</rdfs:comment>
        <rdfs:subPropertyOf rdf:resource="followedBy"/>
    </owl:ObjectProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/preceededBy -->
    <owl:ObjectProperty rdf:about="preceededBy">
        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >preceededBy - The link to the previous item in a list (ordered collection)</rdfs:comment>
        <rdfs:domain rdf:resource="ListItem"/>
        <rdfs:range rdf:resource="ListItem"/>
    </owl:ObjectProperty>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/previousItem -->
    <owl:ObjectProperty rdf:about="previousItem">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >previousItem - The link to the previous item in a list (ordered collection)</rdfs:comment>
        <owl:inverseOf rdf:resource="nextItem"/>
        <rdfs:subPropertyOf rdf:resource="preceededBy"/>
    </owl:ObjectProperty>


    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Data properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/size -->
    <owl:DatatypeProperty rdf:about="size">
        <rdfs:comment rdf:datatype="&xsd;string"
            >size - The number of item belonging to a collection</rdfs:comment>
        <rdfs:domain rdf:resource="Collection"/>
        <rdfs:range rdf:resource="&xsd;int"/>
    </owl:DatatypeProperty>
    

    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/Item -->
    <owl:Class rdf:about="Item" rdfs:label="(collections) Item">
        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
        <owl:disjointWith rdf:resource="Collection"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >Item - Element belonging to a Bag</rdfs:comment>
    </owl:Class>
    
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/ListItem -->
    <owl:Class rdf:about="ListItem" rdfs:label="(collections) ListItem">
        <rdfs:subClassOf rdf:resource="Item"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >ListItem - Element belonging to a list</rdfs:comment>	
    </owl:Class>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/List -->
    <owl:Class rdf:about="List" rdfs:label="(collections) List">
        <rdfs:subClassOf rdf:resource="Bag"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >List - An ordered array of items, that can be present in multiple copies</rdfs:comment>
            
        <rdfs:subClassOf>
		    <owl:Restriction>
		      	<owl:onProperty rdf:resource="lastItem"/>
		      	<owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
		    </owl:Restriction>
		</rdfs:subClassOf>
        <rdfs:subClassOf>
		    <owl:Restriction>
		      	<owl:onProperty rdf:resource="firstItem"/>
		      	<owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
		    </owl:Restriction>
		</rdfs:subClassOf>	
    </owl:Class>

    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/Bag -->
    <owl:Class rdf:about="Bag"  rdfs:label="(collections) Bag">
        <rdfs:subClassOf rdf:resource="Collection"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >Bag - Collection that can have a number of copies of each object</rdfs:comment>
        <owl:disjointWith rdf:resource="Set"/>
    </owl:Class>
    
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/Set -->
    <owl:Class rdf:about="Set"  rdfs:label="(collections) Set">
        <rdfs:subClassOf rdf:resource="Collection"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >Set - A collection that cannot contain duplicate elements.</rdfs:comment>
    </owl:Class>
    
    <!-- http://swan.mindinformatics.org/ontologies/1.2/collections/Collection -->
    <owl:Class rdf:about="Collection"  rdfs:label="(collections) Collection">
        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
        <rdfs:comment rdf:datatype="&xsd;string"
            >Collection - A group of objects that can be considered as a whole.</rdfs:comment>
    </owl:Class>

    <!-- http://www.w3.org/2002/07/owl#Thing -->

    <owl:Class rdf:about="&owl;Thing"/>
</rdf:RDF>

