Warning:
This wiki has been archived and is now read-only.

Bundle contextualization

From Provenance WG Wiki
Jump to: navigation, search
Simon: "contextualization is between entity and bundle"

I see contextualization as an operation on an existing Entity. That operation is parameterized with a reference to a Bundle. The output of that operation is a new Entity that is a specialization the operand, and the "extra attribute" that was "further fixed" is a reference to the bundle. So, we have "Entity x", we apply contextualization to it, and we get a new "Entity x, as described in Bundle c".

So, I don't see it so much as Simon's "between an entity and a bundle", as I do it being "operation on an Entity, producing a (new) Entity, and bringing a Bundle into the picture".

Example 1

Walking through a contextualization example (each code snippet is cumulative):

Step 1

We have ex:Bob mentioned in ex:run1:

ex:run1 {
  ex:Bob a prov:Entity; foo:bar "yes" .
}

Step 2

and we have another bundle where we'd like to "reference" that ex:Bob in _as per_ ex:run1. This is useful both for extension of description (for the asserter), AND useful for a consumer to "see what else" there is about ex:Bob.

tool:analysis01 {
  ex:Bob a prov:Entity.
  # I want to tell my consumers that I saw stuff, and am further describing, ex:Bob _as in_ ex:run1. 
  # But just saying ex:Bob doesn't get me to ex:run1, it just gets me to ex:Bob "anywhere".
}

Step 3

So, first "contextualize" ex:Bob _as_in_ ex:run1:

tool:analysis01 {

  ex:Bob a prov:Entity. # This is redundant, it was an Entity over in ex:run1, too. 
                        # This statement is about ex:Bob regardless of which Bundle he's talked about.

  tool:Bob_as_in_run1 
      a prov:Entity, prov:ContextualizedEntity;
      prov:contextualized ex:Bob;  # This is how ex:run1 referred to it
      prov:inContext      ex:run1; # This is the bundle that the ex:Bob that I want to talk about is being described.
  . # There. I now have a way to talk about ex:Bob _as_in_ the bundle ex:run1.

  # We just "contextualized" ex:Bob, now we can talk about him.
  # Contexualized       subclass of [ onProperty prov:inContext,      minCardinality 1 ],  
  #                                 [ onProperty prov:contextualized, exactly        1 ] is silently assumed, to stay within RL.

  # An inference that should fall from the above ContextualizedEntity above is:
  tool:Bob_as_in_run1 prov:specializationOf ex:Bob . 

  # ^^ this can be produced by RDFS: 
  #            prov:contextualized rdfs:subPropertyOf prov:specializationOf

  # Further, we'd want:
  # prov:contextualized  rdfs:domain prov:ContextualizedEntity . # This was removed when we made ContextualizedDerivation, etc: rdfs:range prov:Entity .
  # prov:inContext       rdfs:domain prov:ContextualizedEntity . # No range defined, but is often prov:Bundle.

  #
  #   ?contextualization 
  #             prov:contextualized ?uri; 
  #             prov:inContext      ?bundle  => ?uri dcterms:isReferencedBy ?bundle . # This could probably go both ways...
  #

  # We can describe the contextualized ex:Bob, 
  # which is our specializationOf ex:Bob that is special-er b/c it is in the "in ex:run1" Bundle.

  tool:Bob_as_in_run1
       tool:awesomeness "BAD PERFORMER";
  .

  # Make prov:contextualized Functional? (Luc's Example 2)
}

http://dvcs.w3.org/hg/prov/raw-file/default/model/prov-dm.html#term-contextualization

Example 2

bundle b1
   entity(general1)
   activity(a1)
   used(a1,general1)
endBundle
:b1 {
   :general1 a prov:Entity .
   :a1
      a prov:Activity;
      prov:used :general1;
   .
}
bundle b2
   entity(specific1)
   activity(a2)
   used(a2,specific1)
   specializationOf(specific1,general1)
endBundle
:b2 {
   :specific1 
      a prov:Entity;
      prov:specializationOf :general1;
   .
   :a2 
      a prov:Activity;
      prov:used :specific1;
   .
}

BAD

bundle b3
   entity(e)
   contextualizationOf(e, general1,  bundle1) // e presents the facet of general1 in bundle1
   contextualizationOf(e, specific1, bundle2) // e also presents the facet of specific1 in bundle2
endBundle
:b3 {
   :e 
      a prov:Entity;

      prov:contextualized :general1; # This pair gets confused with the next pair...
      prov:inContext      :bundle1;

      prov:contextualized :specific1;
      prov:inContext      :bundle2;
   .
}

How you do it

bundle b3
   entity(e)
   contextualizationOf(e1, general1,  bundle1) // e presents the facet of general1 in bundle1
   contextualizationOf(e2, specific1, bundle2) // e also presents the facet of specific1 in bundle2
   specializationOf(e,e1)
   specializationOf(e,e1)
endBundle
:b3 {
   :e1
      a prov:Entity;

      prov:contextualized :general1;
      prov:inContext      :bundle1;
   .
   :e2
      a prov:Entity;

      prov:contextualized :specific1;
      prov:inContext      :bundle2;
   .
   :e
      prov:specializationOf :e1, :e2;
   .
}