ontology/components/Time/example-3-extension.ttl
author stian@soiland.no
Fri, 14 Oct 2011 00:16:40 +0100
changeset 740 285b39f7ea5f
child 809 baf0b4965963
permissions -rw-r--r--
merge
     1 @prefix owl:  <http://www.w3.org/2002/07/owl#> .
     2 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
     3 @prefix prov: <http://www.w3.org/ns/prov-o/> .
     4 @prefix time: <http://www.w3.org/2006/time#> .
     5 
     6 # Example of extending prov:Time using OWL Time ontology
     7 # http://www.w3.org/TR/owl-time/
     8 
     9 
    10 # Lazy straight forward version - no declared subclasses
    11 :pe0 a :ProcessExecution ;
    12     prov:startedAt [
    13         # a prov:Time, time:Instant ;
    14         time:inXSDDateTime "2011-12-24T14:24:05Z" 
    15     ] ;
    16     prov:endedAt [
    17         time:inXSDDateTime "2011-12-25T01:41:54Z" 
    18     ] .
    19 
    20 
    21 # Integrate time: and prov:
    22 
    23 :TimedProcess a owl:Class ;
    24     rdfs:subClassOf prov:ProcessExecution ;
    25     rdfs:subClassOf time:Interval .
    26 
    27 :Time a owl:Class ;
    28     rdfs:subClassOf prov:Time .    
    29     rdfs:subClassOf time:Instant .
    30 
    31 :started a owl:ObjectProperty ;
    32     rdfs:subPropertyOf time:hasBeginning ;
    33     rdfs:subPropertyOf prov:startedAt ;
    34     rdfs:domain :TimedProcess ;
    35     rdfs:range :Time .
    36 
    37 :ended a owl:ObjectProperty ;
    38     rdfs:subPropertyOf time:hasEnd ;
    39     rdfs:subPropertyOf prov:endedAt ;
    40     rdfs:domain :TimedProcess ;
    41     rdfs:range :Time .
    42 
    43 
    44 # The simple case
    45 :pe1 a :TimedProcess ;
    46     :started [
    47         time:inXSDDateTime "2011-12-24T14:24:05Z" 
    48     ] ;
    49     :ended [
    50         time:inXSDDateTime "2011-12-25T01:41:54Z" 
    51     ] .
    52 
    53 
    54 :e1 a prov:Entity ;
    55     prov:wasGeneratedBy :pe1 ;
    56     prov:wasGeneratedAt [
    57         a time:Instant ;
    58         time:inDateTime [
    59             # We only bothered recorded the clock when :e1 was generated
    60             time:hour 21 ;
    61             time:minute 45 ;
    62         ]
    63     ]
    64     
    65 
    66 # Using the OWL Time Ontology to specify relations between intervals
    67 # (ie. our process executions) even if we have just partial 
    68 # time information
    69 
    70 :pe2 a :TimedProcess ;
    71     # starts immediately after :pe1
    72     time:intervalMetBy :pe1 .
    73     # lasts until :pe3 finishes
    74     time:intervalFinishes :pe3 .
    75 
    76 :pe3 a :TimedProcess ;
    77     # Started some time after :pe1 finished
    78     time:intervalAfter :pe1 ;
    79     :ended [
    80         time:inXSDDateTime "2011-12-31T23:59:54Z" 
    81     ] .
    82 
    83