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
parent 3144 fcc67c5702ee
permissions -rw-r--r--
minor updates to address dong's comments
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix sd:      <http://www.w3.org/ns/sparql-service-description#> .
@prefix dcat:    <http://www.w3.org/ns/dcat#> .
@prefix void:    <http://rdfs.org/ns/void#> .
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
@prefix prov:    <http://www.w3.org/ns/prov#> .
@prefix perf:    <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/performance#> .
@prefix tool:    <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/tool#> .
@prefix :        <http://dvcs.w3.org/hg/prov/raw-file/tip/examples/eg-33-a-simpler-hasProvenanceIn/rdf/eg-33-a-simpler-hasProvenanceIn.ttl#> .

<> prov:wasDerivedFrom <http://www.w3.org/mid/EMEW3|ccfb9b3e27833e142419040f7fa6bbdbo4UMsE08L.Moreau|ecs.soton.ac.uk|4FC7E880.6070303@ecs.soton.ac.uk> .

# 
# All,
# 
# To try and converge towards a solution, I am
# circulating an example using a ternary hasProvenanceIn.
# I would like to understand if and how we can make it work with
# a simpler relation.
# 
# 
# Two bundles ex:run1 and ex:run2 describe bob's role as a controller
# of two activities.  Same bob, two different bundles.
# 
#    bundle ex:run1
#     activity(ex:a1, 2011-11-16T16:00:00,2011-11-16T17:0:00)  //duration: 1hour
#     wasAssociatedWith(ex:a1,ex:Bob,[prov:role="controller"])
#    endBundle

:run1 {
   :run1 a prov:Bundle .

   :a1
      a prov:Activity;
      prov:startedAtTime "2011-11-16T16:00:00"^^xsd:dateTime;
      prov:endedAtTime   "2011-11-16T17:00:00"^^xsd:dateTime; 
      rdfs:comment "duration: 1 hour";

      prov:qualifiedAssociation [
         a prov:Association;
         prov:agent   :bob;
         prov:hadRole :controller;
      ];
   .
}

# 
#    bundle ex:run2
#     activity(ex:a2, 2011-11-17T10:00:00,2011-11-17T17:0:00)  //duration: 7hours
#     wasAssociatedWith(ex:a2,ex:Bob,[prov:role="controller"])
#    endBundle
# 

:run2 {
   :run2 a prov:Bundle .

   :a2
      a prov:Activity;
      prov:startedAtTime "2011-11-17T10:00:00"^^xsd:dateTime;
      prov:endedAtTime   "2011-11-17T17:00:00"^^xsd:dateTime; 
      rdfs:comment "duration: 7 hours; the next day.";

      prov:qualifiedAssociation [
         a prov:Association;
         prov:agent   :bob;
         prov:hadRole :controller;
      ];
   .
}

# 
# A performance analysis tool rates the performance of agents (this could be used
# to dispatch further work to performant agents, or congratulate them, etc).
# 
# 
#    bundle tool:analysis01
# 
#      agent(tool:Bob1, [perf:rating="good"])
#      hasProvenanceIn(tool:Bob1, ex:run1, ex:Bob)  // Bob performance in ex:run1 is good
# 
#      agent(tool:Bob2, [perf:rating="bad"])
#      hasProvenanceIn(tool:Bob2, ex:run2, ex:Bob)  // Bob performance in ex:run2 is bad
# 
#    endBundle
# 
# The performance analysis tool has to rate two involvements of ex:Bob in two separate activities.
# Two specialized version of ex:Bob are defined: tool:bob1 and tool:bob2, with rating good and
# bad respectively.
# 
# tool:Bob1 is linked to ex:Bob in run1, and tool:Bob2 is linked to ex:Bob in run2, with the following
# 
#      hasProvenanceIn(tool:Bob1, ex:run1, ex:Bob)
#      hasProvenanceIn(tool:Bob2, ex:run2, ex:Bob)
# 
# Nothing is expressed about ex:Bob in bundle tool:analysis01 (except that this is an alias
# for tool:Bob1 and tool:Bob2).

tool:analysis01 {
   tool:analysis01 
      a prov:Bundle;
      prov:wasDerivedFrom :run1, :run2;
      prov:wasAttributedTo tool:me;
   .

   tool:bob_1 
      a prov:Agent;
      prov:alternateOf :bob;
      prov:isTopicIn   :run1;
      perf:rating perf:good;
   .

   tool:bob_2 
      a prov:Agent;
      prov:alternateOf :bob;
      prov:isTopicIn   :run2;
      perf:rating perf:bad;
   .
}

# TL: The next two bundles are an alternative way to represent the above bundle.
# TL: They avoid creating two specializations of Bob, and depend on the scoping of the bundle to
# TL: maintain the distinction between Good Bob and Bad Bob.
# TL: (though, this distinction can be lost and is NOT recommended as a replacement 
# TL:  for the above "2-specializations" modeling, which will not lose the distinction when merging graphs.)

tool:analysis01-ALT-1 {
   tool:analysis01-ALT-1  
      a prov:Bundle;
      prov:wasDerivedFrom :run1;   # no longer derived from :run2
      prov:wasAttributedTo tool:me;
   .

   :bob       # Mentioning :bob directly instead of tool:me's own alternate.
      a prov:Agent;
      prov:hasProvenanceIn :run1; # We still want to lead others to :run1
      perf:rating perf:good;
   .
}

tool:analysis01-ALT-2 {
   tool:analysis01-ALT-2  
      a prov:Bundle;
      prov:wasDerivedFrom :run2;
      prov:wasAttributedTo tool:me;
   .

   :bob
      a prov:Agent;
      prov:hasProvenanceIn :run2;
      perf:rating perf:good;
   .
}

# 
# It is suggested that the ternary relation could be replaced by
# isTopicIn(tool:Bob1, ex:run1)
# and
# specialization(tool:Bob1, ex:Bob).
# 
# I don't understand the point of
#  isTopicIn(tool:Bob1, ex:run1)
# since tool:Bob1 is not a topic in ex:run1.
# 


# TL: Yes it is.


# Also, we now seem to have made ex:Bob a topic of tool:analysis01, because
# the following expression.
# specialization(tool:Bob1, ex:Bob).
# 


# TL: absolutely.



# From tool:analysis01, where do I find provenance about ex:Bob?


# TL: in what you just stated: specialization(tool:Bob1, ex:Bob)



# It look like this has become a dead end in this graph.
# 
# Do I need to introduce:
#  isTopicIn(ex:Bob, ex:run1)
#  isTopicIn(ex:Bob, ex:run2)?
# 


# TL: No.


# 
# So now we would  have:
# isTopicIn(tool:Bob1, ex:run1)
# specialization(tool:Bob1, ex:Bob)
# isTopicIn(tool:Bob2, ex:run2)
# specialization(tool:Bob2, ex:Bob)
# isTopicIn(ex:Bob, ex:run1)
# isTopicIn(ex:Bob, ex:run2)
# 
# Which means that:
# 
# specialization(tool:Bob1, ex:Bob)
# isTopicIn(ex:Bob, ex:run2)
# 
# ... would lead us to believe that good rating is due to slow performance.
# 
# Can the proposer of the separate binary relations explain how this example can work?
# 
# Thanks,
# Luc
# 
#