#
# Copyright (c) 2010 Evgeny Egorochkin <phreedom.stdin@gmail.com>
# Copyright (c) 2011 Sebastian Trueg <trueg@kde.org>
#
# All rights reserved, licensed under either CC-BY or BSD.
#
# You are free:
#  * to Share - to copy, distribute and transmit the work
#  * to Remix - to adapt the work
# Under the following conditions:
#  * Attribution - You must attribute the work in the manner specified by the author
#    or licensor (but not in any way that suggests that they endorse you or your use 
#    of the work).
#
# Redistribution and use in source and binary forms, with or without modification, 
# are permitted provided that the following conditions are met:
#  * Redistributions of source code must retain the above copyright notice, this 
#    list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright notice, this 
#    list of conditions and the following disclaimer in the documentation and/or 
#    other materials provided with the distribution.
#  * Neither the names of the authors nor the names of contributors may
#    be used to endorse or promote products derived from this ontology without 
#    specific prior written permission.
#
# THIS ONTOLOGY IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS ONTOLOGY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix nrl:     <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
@prefix nao:     <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix nie:     <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#> .
@prefix nuao:    <http://www.semanticdesktop.org/ontologies/2010/01/25/nuao#> .

nuao: {

    nuao:Event
        a rdfs:Class ;
        rdfs:comment "An event: activity that have a specific start datetime and possibly a duration" ;
        rdfs:label "event" ;
        rdfs:subClassOf rdfs:Resource ;
        nao:userVisible false .

    nuao:start
        a rdf:Property ;
        rdfs:comment "The time of the start of the event" ;
        rdfs:domain nuao:Event ;
        rdfs:label "start time" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:end
        a rdf:Property ;
        rdfs:comment "The time the event finished" ;
        rdfs:domain nuao:Event ;
        rdfs:label "end time" ;
        rdfs:range xsd:dateTime;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:duration
        a rdf:Property ;
        rdfs:comment "Duration of the event. Deprecated in favor of nuao:end." ;
        rdfs:domain nuao:Event ;
        rdfs:label "duration" ;
        rdfs:range xsd:duration ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger ;
        nao:deprecated true .

    nuao:involves
        a rdf:Property ;
        rdfs:comment "Relates an event to the resources that are involved in the event." ;
        rdfs:domain nuao:Event ;
        rdfs:label "involves" ;
        rdfs:range rdfs:Resource .


    nuao:DesktopEvent
        a rdfs:Class ;
        rdfs:comment """A desktop event: activity performed by an user. A "hook" class that should be extended by other ontologies such as desktop service ontology to specify which application or service was involved in the desktop event.""" ;
        rdfs:label "desktop event" ;
        rdfs:subClassOf nuao:Event .


    nuao:firstEvent
        a rdf:Property ;
        rdfs:comment "The start time of the first event" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "first event" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:lastEvent
        a rdf:Property ;
        rdfs:comment "The start time of the last event" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "last event" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:eventCount
        a rdf:Property ;
        rdfs:comment "The total number of events" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "event count" ;
        rdfs:range xsd:nonNegativeInteger ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:totalEventDuration
        a rdf:Property ;
        rdfs:comment "The total duration of all events" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "event count" ;
        rdfs:range xsd:duration ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .



    nuao:UsageEvent
        a rdfs:Class ;
        rdfs:comment "An event of primary or intended use of the resource by the user. Primary or intended use is defined as the use by the consumer of the resource, such as watching a movie or listening to a song. Not to be confused with a low-level read on a file." ;
        rdfs:label "desktop event" ;
        rdfs:subClassOf nuao:DesktopEvent .

    nuao:firstUsage
        a rdf:Property ;
        rdfs:subPropertyOf nuao:firstEvent ;
        rdfs:comment "The start time of the first usage" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "first usage" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:lastUsage
        a rdf:Property ;
        rdfs:subPropertyOf nuao:lastEvent ;
        rdfs:comment "The start time of the last usage" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "last usage" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:usageCount
        a rdf:Property ;
        rdfs:subPropertyOf nuao:eventCount ;
        rdfs:comment "The total number of usages" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "usage count" ;
        rdfs:range xsd:nonNegativeInteger ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:totalUsageDuration
        a rdf:Property ;
        rdfs:subPropertyOf nuao:totalEventDuration ;
        rdfs:comment "The total duration of all usages" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "usage count" ;
        rdfs:range xsd:duration ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .



    nuao:ModificationEvent
        a rdfs:Class ;
        rdfs:comment "An event that lead to changes of the resource that are meaningful to the user" ;
        rdfs:label "desktop event" ;
        rdfs:subClassOf nuao:DesktopEvent .

    nuao:firstModification
        a rdf:Property ;
        rdfs:comment "The start time of the first modification" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "first modification event" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:lastModification
        a rdf:Property ;
        rdfs:comment "The start time of the last modification" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "last modification" ;
        rdfs:range xsd:dateTime ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:modificationCount
        a rdf:Property ;
        rdfs:comment "The total number of modifications" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "modification count" ;
        rdfs:range xsd:nonNegativeInteger ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:totalModificationDuration
        a rdf:Property ;
        rdfs:comment "The total duration of all modifications" ;
        rdfs:domain rdfs:Resource ;
        rdfs:label "modification count" ;
        rdfs:range xsd:duration ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:FocusEvent
        a rdfs:Class ;
        rdfs:comment "An event which refers to the timespan in which a resource was in the focus of the user." ;
        rdfs:label "focus event" ;
        rdfs:subClassOf nuao:DesktopEvent .

   nuao:totalFocusDuration
        a rdf:Property ;
        rdfs:comment "The total amount of time a resource was in focus during a UsageEvent. This property should be used to 'compress' several FocusEvent instances into the essential information." ;
        rdfs:domain rdfs:UsageEvent ;
        rdfs:label "total focus duration" ;
        rdfs:range xsd:duration ;
        nrl:maxCardinality "1"^^xsd:nonNegativeInteger .

    nuao:initiatingAgent
        a rdf:Property ;
        rdfs:comment "Relates an event to the agent initiating the event." ;
        rdfs:domain nuao:Event ;
        rdfs:label "initiating agent" ;
        rdfs:range nao:Agent ;
        rdfs:subPropertyOf nuao:involves ;
        nrl:cardinality "1"^^xsd:nonNegativeInteger .

    nuao:targettedResource
       a rdf:Property ;
       rdfs:comment "Relates an event to the resource that was targetted in the event." ;
       rdfs:domain nuao:Event ;
       rdfs:label "targetted resource" ;
       rdfs:range nie:InformationElement ;
       rdfs:subPropertyOf nuao:involves ;
       nrl:minCardinality "1"^^xsd:nonNegativeInteger .
}

<http://www.semanticdesktop.org/ontologies/2010/01/25/nuao/metadata>
{
    nuao:
          a       nrl:DocumentGraph , nrl:KnowledgeBase ;
          nao:hasDefaultNamespace "http://www.semanticdesktop.org/ontologies/2010/01/25/nuao#" ;
          nao:hasDefaultNamespaceAbbreviation "nuao" ;
          nao:lastModified "2011-12-12T06:51:36" ;
          nao:serializationLanguage "TriG" ;
          nao:status "Testing" ;
          nrl:updatable "0" ;
          nao:version "0.11.0" ;
          nao:prefLabel "Nepomuk User Action Ontology" ;
          nao:description "The Nepomuk User Action Ontology provides basic classes and properties for desktop events." .

    <http://www.semanticdesktop.org/ontologies/2010/01/25/nuao/metadata>
          a       nrl:GraphMetadata , nrl:DocumentGraph ;
          nao:serializationLanguage "TriG" ;
          nrl:coreGraphMetadataFor nuao: .
}
