ontology/components/Time/example-3-extension.ttl
author stian@soiland.no
Fri, 14 Oct 2011 00:16:40 +0100
changeset 740 285b39f7ea5f
parent 739 1c2044969aef
child 809 baf0b4965963
permissions -rw-r--r--
merge
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov-o/> .
@prefix time: <http://www.w3.org/2006/time#> .

# Example of extending prov:Time using OWL Time ontology
# http://www.w3.org/TR/owl-time/


# Lazy straight forward version - no declared subclasses
:pe0 a :ProcessExecution ;
    prov:startedAt [
        # a prov:Time, time:Instant ;
        time:inXSDDateTime "2011-12-24T14:24:05Z" 
    ] ;
    prov:endedAt [
        time:inXSDDateTime "2011-12-25T01:41:54Z" 
    ] .


# Integrate time: and prov:

:TimedProcess a owl:Class ;
    rdfs:subClassOf prov:ProcessExecution ;
    rdfs:subClassOf time:Interval .

:Time a owl:Class ;
    rdfs:subClassOf prov:Time .    
    rdfs:subClassOf time:Instant .

:started a owl:ObjectProperty ;
    rdfs:subPropertyOf time:hasBeginning ;
    rdfs:subPropertyOf prov:startedAt ;
    rdfs:domain :TimedProcess ;
    rdfs:range :Time .

:ended a owl:ObjectProperty ;
    rdfs:subPropertyOf time:hasEnd ;
    rdfs:subPropertyOf prov:endedAt ;
    rdfs:domain :TimedProcess ;
    rdfs:range :Time .


# The simple case
:pe1 a :TimedProcess ;
    :started [
        time:inXSDDateTime "2011-12-24T14:24:05Z" 
    ] ;
    :ended [
        time:inXSDDateTime "2011-12-25T01:41:54Z" 
    ] .


:e1 a prov:Entity ;
    prov:wasGeneratedBy :pe1 ;
    prov:wasGeneratedAt [
        a time:Instant ;
        time:inDateTime [
            # We only bothered recorded the clock when :e1 was generated
            time:hour 21 ;
            time:minute 45 ;
        ]
    ]
    

# Using the OWL Time Ontology to specify relations between intervals
# (ie. our process executions) even if we have just partial 
# time information

:pe2 a :TimedProcess ;
    # starts immediately after :pe1
    time:intervalMetBy :pe1 .
    # lasts until :pe3 finishes
    time:intervalFinishes :pe3 .

:pe3 a :TimedProcess ;
    # Started some time after :pe1 finished
    time:intervalAfter :pe1 ;
    :ended [
        time:inXSDDateTime "2011-12-31T23:59:54Z" 
    ] .