gdbassett / moirai

1 stars 1 forks source link

CPT Validation Tested #33

Closed gdbassett closed 11 years ago

gdbassett commented 11 years ago

A CPT validation client is written.

All CPT Validation/update functions are tested.

gdbassett commented 11 years ago

Adds 5 nodes and links 2

event1 = { "dces_version":"0.2", "an":{ "A":{"label":"A Required Attribute","class":"attribute","start":"2013-03-14T16:57Z","cpt":{"nodeid":"A","index":[True,False],"0":[1,0]},"comment":"This attribute is required"}, "B":{"label":"An Event Happens","class":"event","start":"2013-03-14T16:57Z","cpt":{"nodeid":"B","index":[True,False],"0":[1,0]},"comment":"An event happens. This should have parents, but we're not going to bother"}, "C":{"label":"resulting condition","class":"condition","start":"2013-03-14T16:57Z","cpt":{"nodeid":"C","index":["A","B",True,False],"0":[0,0,0,1],"1":[0,0,0,1],"2":[0,0,0,1],"3":[0,0,1,0]}, "comment":"Because of the Attribute and Event, this condition happens."}, "D":{"label":"A previously unrequired attribute","class":"attribute","start":"2013-03-14T16:57Z","cpt":{"nodeid":"D","index":[True,False],"0":[1,0]},"comment":"This attribute isnt in C's CPT"}, "E":{"label":"A previously unrequired Event","class":"event","start":"2013-03-14T16:57Z","cpt":{"nodeid":"E","index":[True,False],"0":[1,0]},"comment":"An event isn't in E's CPT but will be linked by an edge. This should have parents, but we're not going to bother"} }, "ae":{ "1":{"source":"A","target":"C","directed":True, "relationship":"influences","start":"2013-03-14T16:57Z", "comment":"Connects attribute to condition"}, "2":{"source":"B","target":"C","directed":True, "relationship":"leads to","start":"2013-03-14T16:57Z","comment":"connects event to condition"} } }

Adds two previously undefined edges

requires D, E, and C in idMap

event2 = { "dces_version":"0.2", "ae":{ "1":{"source":idMap["D"],"target":idMap["C"],"directed":True, "relationship":"influences","start":"2013-03-14T16:57Z", "comment":"Connects attribute to condition"}, "2":{"source":idMap["E"],"target":idMap["C],"directed":True, "relationship":"leads to","start":"2013-03-14T16:57Z","comment":"connects event to condition"} } }

Deletes the first two edges. Requires A, B, & C in idMap

event3 = {"dces_version":"0.2","de":{"1":{"source":int(idMap["A"]),"target":int(idMap["C"])},"2":{"source":int(idMap["B"]),"target":int(idMap["C"])}}}

gdbassett commented 11 years ago

Adds 5 nodes and links 2

event1 = {"dces_version":"0.2","an":{"A":{"label":"A Required Attribute","class":"attribute","start":"2013-03-14T16:57Z","cpt":{"nodeid":"A","index":[true,false],"0":[1,0]},"comment":"This attribute is required"},"B":{"label":"An Event Happens","class":"event","start":"2013-03-14T16:57Z","cpt":{"nodeid":"B","index":[true,false],"0":[1,0]},"comment":"An event happens. This should have parents, but we're not going to bother"},"C":{"label":"resulting condition","class":"condition","start":"2013-03-14T16:57Z","cpt":{"nodeid":"C","index":["A","B",true,false],"0":[0,0,0,1],"1":[0,0,0,1],"2":[0,0,0,1],"3":[0,0,1,0]}, "comment":"Because of the Attribute and Event, this condition happens."},"D":{"label":"A previously unrequired attribute","class":"attribute","start":"2013-03-14T16:57Z","cpt":{"nodeid":"D","index":[true,false],"0":[1,0]},"comment":"This attribute isnt in C's CPT"},"E":{"label":"A previously unrequired Event","class":"event","start":"2013-03-14T16:57Z","cpt":{"nodeid":"E","index":[true,false],"0":[1,0]},"comment":"An event isn't in E's CPT but will be linked by an edge. This should have parents, but we're not going to bother"}},"ae":{"1":{"source":"A","target":"C","directed":true, "relationship":"influences","start":"2013-03-14T16:57Z", "comment":"Connects attribute to condition"},"2":{"source":"B","target":"C","directed":true, "relationship":"leads to","start":"2013-03-14T16:57Z","comment":"connects event to condition"}}}

Adds two previously undefined edges

requires D, E, and C in idMap

event2 = {"dces_version":"0.2","ae":{"1":{"source":idMap["D"],"target":idMap["C"],"directed":true, "relationship":"influences","start":"2013-03-14T16:57Z", "comment":"Connects attribute to condition"},"2":{"source":idMap["E"],"target":idMap["C"],"directed":true, "relationship":"leads to","start":"2013-03-14T16:57Z","comment":"connects event to condition"}}}

Deletes the first two edges. Requires A, B, & C in idMap

event3 = {"dces_version":"0.2","de":{"1":{"source":int(idMap["A"]),"target":int(idMap["C"])},"2":{"source":int(idMap["B"]),"target":int(idMap["C"])}}}

gdbassett commented 11 years ago

fixCPTs and updateCPTs functions tested. validateCPT function left to be validated.

gdbassett commented 11 years ago

Finished with commit 378fa150956a771363cfa55db3c28041dfecd9b9