Added discussion text about PROV-Dictionary
authorTom De Nies <tom.denies@ugent.be>
Thu, 13 Dec 2012 16:50:26 +0100
changeset 5343 e5d99c5e1aae
parent 5342 548abad59717
child 5344 b9621ab806e5
Added discussion text about PROV-Dictionary
dictionary/PROV-Dictionary_discussion.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dictionary/PROV-Dictionary_discussion.txt	Thu Dec 13 16:50:26 2012 +0100
@@ -0,0 +1,188 @@
+3 discussion topics:
+
+1. New notation
+2. The "complete" attribute?
+3. proposed constraints
+=================================
+
+
+
+=================================
+1. New notation
+=================================
+
+OLD NOTATION:
+
+entity(d, [prov:type='prov:Dictionary'])
+entity(e1)
+entity(e2)
+entity(e3)
+memberOf(d, {("k1", e1), ("k2", e2), ("k3", e3)})
+
+-> d contains {("k1", e1), ("k2", e2), ("k3", e3)}
+
+entity(d1, [prov:type='prov:Dictionary'])
+entity(e4)
+entity(e5)
+derivedByInsertionFrom(d1, d, {("k4", e4), ("k5",e5)})   
+
+-> d1 contains {("k1", e1), ("k2", e2), ("k3", e3), ("k4", e4), ("k5",e5)}
+
+
+CURRENT COLLECTION NOTATION:
+
+entity(c1, [prov:type='prov:Collection'])
+entity(e1)
+entity(e2)
+entity(e3)
+hadMember(c, e1)
+hadMember(c, e2)
+hadMember(c, e3)
+
+-> Proposed: make Dictionary more consistent with this notation
+
+entity(d, [prov:type='prov:Dictionary'])
+entity(e1)
+entity(e2)
+entity(e3)
+hadMember(d, ("k1", e1))
+hadMember(d, ("k2", e2))
+hadMember(d, ("k3", e3))
+
+-> d contains {("k1", e1), ("k2", e2), ("k3", e3)}
+
+entity(d1, [prov:type='prov:Dictionary'])
+entity(e4)
+entity(e5)
+derivedByInsertionFrom(d1, d, {("k4", e4), ("k5",e5)})   
+
+-> d1 contains {("k1", e1), ("k2", e2), ("k3", e3), ("k4", e4), ("k5",e5)}
+
+
+
+=================================
+2. The "Complete" attribute
+=================================
+
+OLD NOTATION:
+
+entity(d, [prov:type='prov:Dictionary')
+entity(e1)
+entity(e2)
+entity(e3)
+memberOf(d, {("k1", e1), ("k2", e2), ("k3", e3)}, true)
+
+-> d is the set {("k1", e1), ("k2", e2), ("k3", e3)} (and nothing more!)
+
+entity(d1, [prov:type='prov:Dictionary'])
+entity(e4)
+entity(e5)
+derivedByInsertionFrom(d1, d, {("k4", e4), ("k5",e5)})   
+
+-> d1 is the set {("k1", e1), ("k2", e2), ("k3", e3), ("k4", e4), ("k5",e5)}  (or is it? yes it is, but you have to find the memberOf statement to verify this,
+and this wouldn't work with the new notation)
+
+
+-> To us, this is unclear, lot's of discussion, scrapping from DM, etc.
+-> Proposed: change this up a bit: 2 alternatives:
+
+ALTERNATIVE 1:
+
+entity(d, [prov:type='prov:Dictionary', prov:complete='true'])
+entity(e1)
+entity(e2)
+entity(e3)
+hadMember(d, ("k1", e1))
+hadMember(d, ("k2", e2))
+hadMember(d, ("k3", e3))
+
+-> d is the set {("k1", e1), ("k2", e2), ("k3", e3)}  (and nothing more!)
+
+entity(d1, [prov:type='prov:Dictionary', prov:complete='true'])
+entity(e4)
+entity(e5)
+derivedByInsertionFrom(d1, d, {("k4", e4), ("k5",e5)})   
+
+-> d1 is the set {("k1", e1), ("k2", e2), ("k3", e3), ("k4", e4), ("k5",e5)} (yes, it is, because it says it's prov:complete!)
+
+Advantages:
++ directly available knowledge for the user
++ this allows us to drop the class EmptyDictionary! (because a prov:complete Dictionary without hadMember statements is empty)
+Disadvantage:
+- introduce new attribute
+- extra constraints for complete dictionaries
+
+ALTERNATIVE 2:
+
+entity(d, [prov:type='prov:EmptyDictionary'])
+
+-> d is an empty set
+
+entity(d1, [prov:type='prov:Dictionary'])
+entity(e1)
+entity(e2)
+entity(e3)
+derivedByInsertionFrom(d1, d, {("k1", e1), ("k2",e2), ("k3",e3)})   
+
+-> d1 is the set {("k1", e1), ("k2", e2), ("k3", e3), ("k4", e4), ("k5",e5)} 
+(yes, it is, because it was derived from an empty collection)
+
+Advantages:
++ shorter/more elegant notation
++ no new attributes
++ consistency with EmptyCollection/Collection
++ easier to form constraints
+Disadvantage:
+- user has to derive completeness himself
+
+
+
+=================================
+3. Proposed Constraints
+=================================
+
+------
+Typing
+------
+cfr. PROV-CONSTRAINTS 
+
+------------------
+Insertion/removal:
+------------------
+
+IF hadMember(d1, ("k1",e1)) AND derivedByInsertionFrom(d2, d1, ("k2", e2)) THEN hadMember(d2, ("k1", e1)) holds
+
+IF derivedByInsertionFrom(d2, d1, ("k2", e2)) THEN hadMember(d2, ("k2", e2)) holds
+
+IF derivedByRemovalFrom(d2, d1, ("k1", e1)) THEN hadMember(d1, ("k1",e1)) holds
+
+IF derivedByRemovalFrom(d2, d1, ("k1", e1)) THEN hadMember(d2, ("k1",e1)) THEN INVALID
+
+---------------------------------------------------------------------------------------------------
+A dictionary must not be derived through multiple insertion or removal relations.
+---------------------------------------------------------------------------------------------------
+
+IF derivedByRemovalFrom(d2, d1, ("k1", e1)) AND derivedByInsertionFrom(d2, d1, ("k2", e2)) THEN INVALID
+
+IF derivedByInsertionFrom(d2, d1, ("k1", e1)) AND derivedByInsertionFrom(d2, d1, ("k2", e2)) THEN INVALID
+
+IF derivedByRemovalFrom(d2, d1, ("k1", e1)) AND derivedByRemovalFrom(d2, d1, ("k2", e2)) THEN INVALID
+
+----------
+Derivation
+----------
+IF derivedByRemovalFrom(d2, d1, ("k1", e1)) THEN wasDerivedFrom(d2, d1) holds
+
+IF derivedByInsertionFrom(d2, d1, ("k1", e1)) THEN wasDerivedFrom(d2, d1) holds
+
+-------------------------------------
+Depending if alternative 2 is chosen:
+-------------------------------------
+
+IF hasMember(d,e) and 'prov:EmptyDictionary' \in typeOf(d) THEN INVALID.
+
+Insertions do not break completeness:
+IF 'prov:EmptyDictionary' \in typeOf(d1) AND derivedByInsertionFrom(d2, d1, {("k1", e1)}) AND derivedByRemovalFrom(d3, d2, {("k1", e1)}) THEN 'prov:EmptyDictionary' \in typeOf(d3) 
+
+Is this last constraint enough to guarantee completeness? Todo, formalize this:
+IF derivedByInsertionFrom(d2, d1, {("k1", e1)}) AND derivedByRemovalFrom(d3, d2, {("k1", e1)}) THEN d3 only contains all members of d1