examples/eg-33-a-simpler-hasProvenanceIn/rdf/eg-33-a-simpler-hasProvenanceIn.trig
author Paul Groth <p.t.groth@vu.nl>
Fri, 07 Jun 2013 20:21:19 +0200
changeset 6412 600c6fd1fdb4
permissions -rw-r--r--
minor updates to address dong's comments
     1 @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
     2 @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
     3 @prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
     4 @prefix owl:     <http://www.w3.org/2002/07/owl#> .
     5 @prefix dcterms: <http://purl.org/dc/terms/> .
     6 @prefix sd:      <http://www.w3.org/ns/sparql-service-description#> .
     7 @prefix dcat:    <http://www.w3.org/ns/dcat#> .
     8 @prefix void:    <http://rdfs.org/ns/void#> .
     9 @prefix foaf:    <http://xmlns.com/foaf/0.1/> .
    10 @prefix prov:    <http://www.w3.org/ns/prov#> .
    11 @prefix perf:    <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/performance#> .
    12 @prefix tool:    <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/tool#> .
    13 @prefix :        <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/eg-33-a-simpler-hasProvenanceIn.ttl#> .
    14 
    15 <> prov:wasDerivedFrom <http://www.w3.org/mid/EMEW3|ccfb9b3e27833e142419040f7fa6bbdbo4UMsE08L.Moreau|ecs.soton.ac.uk|4FC7E880.6070303@ecs.soton.ac.uk> .
    16 
    17 # 
    18 # All,
    19 # 
    20 # To try and converge towards a solution, I am
    21 # circulating an example using a ternary hasProvenanceIn.
    22 # I would like to understand if and how we can make it work with
    23 # a simpler relation.
    24 # 
    25 # 
    26 # Two bundles ex:run1 and ex:run2 describe bob's role as a controller
    27 # of two activities.  Same bob, two different bundles.
    28 # 
    29 #    bundle ex:run1
    30 #     activity(ex:a1, 2011-11-16T16:00:00,2011-11-16T17:0:00)  //duration: 1hour
    31 #     wasAssociatedWith(ex:a1,ex:Bob,[prov:role="controller"])
    32 #    endBundle
    33 
    34 :run1 {
    35    :run1 a prov:Bundle .
    36 
    37    :a1
    38       a prov:Activity;
    39       prov:startedAtTime "2011-11-16T16:00:00"^^xsd:dateTime;
    40       prov:endedAtTime   "2011-11-16T17:00:00"^^xsd:dateTime; 
    41       rdfs:comment "duration: 1 hour";
    42 
    43       prov:qualifiedAssociation [
    44          a prov:Association;
    45          prov:agent   :bob;
    46          prov:hadRole :controller;
    47       ];
    48    .
    49 }
    50 
    51 # 
    52 #    bundle ex:run2
    53 #     activity(ex:a2, 2011-11-17T10:00:00,2011-11-17T17:0:00)  //duration: 7hours
    54 #     wasAssociatedWith(ex:a2,ex:Bob,[prov:role="controller"])
    55 #    endBundle
    56 # 
    57 
    58 :run2 {
    59    :run2 a prov:Bundle .
    60 
    61    :a2
    62       a prov:Activity;
    63       prov:startedAtTime "2011-11-17T10:00:00"^^xsd:dateTime;
    64       prov:endedAtTime   "2011-11-17T17:00:00"^^xsd:dateTime; 
    65       rdfs:comment "duration: 7 hours; the next day.";
    66 
    67       prov:qualifiedAssociation [
    68          a prov:Association;
    69          prov:agent   :bob;
    70          prov:hadRole :controller;
    71       ];
    72    .
    73 }
    74 
    75 # 
    76 # A performance analysis tool rates the performance of agents (this could be used
    77 # to dispatch further work to performant agents, or congratulate them, etc).
    78 # 
    79 # 
    80 #    bundle tool:analysis01
    81 # 
    82 #      agent(tool:Bob1, [perf:rating="good"])
    83 #      hasProvenanceIn(tool:Bob1, ex:run1, ex:Bob)  // Bob performance in ex:run1 is good
    84 # 
    85 #      agent(tool:Bob2, [perf:rating="bad"])
    86 #      hasProvenanceIn(tool:Bob2, ex:run2, ex:Bob)  // Bob performance in ex:run2 is bad
    87 # 
    88 #    endBundle
    89 # 
    90 # The performance analysis tool has to rate two involvements of ex:Bob in two separate activities.
    91 # Two specialized version of ex:Bob are defined: tool:bob1 and tool:bob2, with rating good and
    92 # bad respectively.
    93 # 
    94 # tool:Bob1 is linked to ex:Bob in run1, and tool:Bob2 is linked to ex:Bob in run2, with the following
    95 # 
    96 #      hasProvenanceIn(tool:Bob1, ex:run1, ex:Bob)
    97 #      hasProvenanceIn(tool:Bob2, ex:run2, ex:Bob)
    98 # 
    99 # Nothing is expressed about ex:Bob in bundle tool:analysis01 (except that this is an alias
   100 # for tool:Bob1 and tool:Bob2).
   101 
   102 tool:analysis01 {
   103    tool:analysis01 
   104       a prov:Bundle;
   105       prov:wasDerivedFrom :run1, :run2;
   106       prov:wasAttributedTo tool:me;
   107    .
   108 
   109    tool:bob_1 
   110       a prov:Agent;
   111       prov:alternateOf :bob;
   112       prov:isTopicIn   :run1;
   113       perf:rating perf:good;
   114    .
   115 
   116    tool:bob_2 
   117       a prov:Agent;
   118       prov:alternateOf :bob;
   119       prov:isTopicIn   :run2;
   120       perf:rating perf:bad;
   121    .
   122 }
   123 
   124 # TL: The next two bundles are an alternative way to represent the above bundle.
   125 # TL: They avoid creating two specializations of Bob, and depend on the scoping of the bundle to
   126 # TL: maintain the distinction between Good Bob and Bad Bob.
   127 # TL: (though, this distinction can be lost and is NOT recommended as a replacement 
   128 # TL:  for the above "2-specializations" modeling, which will not lose the distinction when merging graphs.)
   129 
   130 tool:analysis01-ALT-1 {
   131    tool:analysis01-ALT-1  
   132       a prov:Bundle;
   133       prov:wasDerivedFrom :run1;   # no longer derived from :run2
   134       prov:wasAttributedTo tool:me;
   135    .
   136 
   137    :bob       # Mentioning :bob directly instead of tool:me's own alternate.
   138       a prov:Agent;
   139       prov:hasProvenanceIn :run1; # We still want to lead others to :run1
   140       perf:rating perf:good;
   141    .
   142 }
   143 
   144 tool:analysis01-ALT-2 {
   145    tool:analysis01-ALT-2  
   146       a prov:Bundle;
   147       prov:wasDerivedFrom :run2;
   148       prov:wasAttributedTo tool:me;
   149    .
   150 
   151    :bob
   152       a prov:Agent;
   153       prov:hasProvenanceIn :run2;
   154       perf:rating perf:good;
   155    .
   156 }
   157 
   158 # 
   159 # It is suggested that the ternary relation could be replaced by
   160 # isTopicIn(tool:Bob1, ex:run1)
   161 # and
   162 # specialization(tool:Bob1, ex:Bob).
   163 # 
   164 # I don't understand the point of
   165 #  isTopicIn(tool:Bob1, ex:run1)
   166 # since tool:Bob1 is not a topic in ex:run1.
   167 # 
   168 
   169 
   170 # TL: Yes it is.
   171 
   172 
   173 # Also, we now seem to have made ex:Bob a topic of tool:analysis01, because
   174 # the following expression.
   175 # specialization(tool:Bob1, ex:Bob).
   176 # 
   177 
   178 
   179 # TL: absolutely.
   180 
   181 
   182 
   183 # From tool:analysis01, where do I find provenance about ex:Bob?
   184 
   185 
   186 # TL: in what you just stated: specialization(tool:Bob1, ex:Bob)
   187 
   188 
   189 
   190 # It look like this has become a dead end in this graph.
   191 # 
   192 # Do I need to introduce:
   193 #  isTopicIn(ex:Bob, ex:run1)
   194 #  isTopicIn(ex:Bob, ex:run2)?
   195 # 
   196 
   197 
   198 # TL: No.
   199 
   200 
   201 # 
   202 # So now we would  have:
   203 # isTopicIn(tool:Bob1, ex:run1)
   204 # specialization(tool:Bob1, ex:Bob)
   205 # isTopicIn(tool:Bob2, ex:run2)
   206 # specialization(tool:Bob2, ex:Bob)
   207 # isTopicIn(ex:Bob, ex:run1)
   208 # isTopicIn(ex:Bob, ex:run2)
   209 # 
   210 # Which means that:
   211 # 
   212 # specialization(tool:Bob1, ex:Bob)
   213 # isTopicIn(ex:Bob, ex:run2)
   214 # 
   215 # ... would lead us to believe that good rating is due to slow performance.
   216 # 
   217 # Can the proposer of the separate binary relations explain how this example can work?
   218 # 
   219 # Thanks,
   220 # Luc
   221 # 
   222 #