Json structure for UML digrams to be imported in crowd
{"classes":[ {"name":"Person","attrs":[{"name":"dni","datatype":"String"}, {"name":"firstname","datatype":"String"}, {"name":"surname","datatype":"String"}, {"name":"birthdate","datatype":"Date"}], "methods":[], "position":{"x":20,"y":20}}, {"name":"Student","attrs":[{"name":"id","datatype":"String"}, {"name":"enrolldate","datatype":"Date"}], "methods":[], "position":{"x":491,"y":107}}, {"name":"Class1","attrs":[], "methods":[], "position":{"x":1025,"y":104}}], "links":[ {"name":"r1","classes":["Student"], "multiplicity":null, "roles":[null,null], "type":"generalization", "parent":"Person", "constraint":[]}, {"name":"R1","classes":["Student","Class1"], "multiplicity":["2..4","1..*"], "roles":["e","c"], "type":"association"}] }
array(2) { ["classes"]=> array(3) { [0]=> array(4) {["name"]=>string(6) "Person" ["attrs"]=> array(4) { [0]=> array(2) { ["name"]=> string(3) "dni" ["datatype"]=> string(6) "String" } [1]=> array(2) { ["name"]=> string(9) "firstname" ["datatype"]=> string(6) "String" } [2]=> array(2) { ["name"]=> string(7) "surname" ["datatype"]=> string(6) "String" } [3]=> array(2) { ["name"]=> string(9) "birthdate" ["datatype"]=> string(4) "Date" } } ["methods"]=> array(0) { } ["position"]=> array(2) { ["x"]=> int(20) ["y"]=> int(20) } } [1]=> array(4) { ["name"]=> string(7) "Student" ["attrs"]=> array(2) { [0]=> array(2) { ["name"]=> string(2) "id" ["datatype"]=> string(6) "String" } [1]=> array(2) { ["name"]=> string(10) "enrolldate" ["datatype"]=> string(4) "Date" } } ["methods"]=> array(0) { } ["position"]=> array(2) { ["x"]=> int(491) ["y"]=> int(107) } } [2]=> array(4) { ["name"]=> string(6) "Class1" ["attrs"]=> array(0) { } ["methods"]=> array(0) { } ["position"]=> array(2) { ["x"]=> int(1025) ["y"]=> int(104) } } } ["links"]=> array(2) { [0]=> array(7) { ["name"]=> string(2) "r1" ["classes"]=> array(1) { [0]=> string(7) "Student" } ["multiplicity"]=> NULL ["roles"]=> array(2) { [0]=> NULL [1]=> NULL } ["type"]=> string(14) "generalization" ["parent"]=> string(6) "Person" ["constraint"]=> array(0) { } } [1]=> array(5) { ["name"]=> string(2) "R1" ["classes"]=> array(2) { [0]=> string(7) "Student" [1]=> string(6) "Class1" } ["multiplicity"]=> array(2) { [0]=> string(4) "2..4" [1]=> string(4) "1..*" } ["roles"]=> array(2) { [0]=> string(1) "e" [1]=> string(1) "c" } ["type"]=> string(11) "association" } } }
same_b_assoc |
( |
|
$assoc1, |
|
|
|
$assoc2 |
|
) |
| |
Compare associations by domains and ranges and name from JSON generated in crowd if assoc is binary =>
{"name":"http://crowd.fi.uncoma.edu.ar#r2", "classes":["http://crowd.fi.uncoma.edu.ar#Class1","http://crowd.fi.uncoma.edu.ar#Class2"], "multiplicity":["0..*","0..*"],"roles":["http://crowd.fi.uncoma.edu.ar#class1","http://crowd.fi.uncoma.edu.ar#class2"], "type":"association"}
$array_assoc = ["name" => http://crowd.fi.uncoma.edu.ar#r2, "classes" => ["http://crowd.fi.uncoma.edu.ar#Class1","http://crowd.fi.uncoma.edu.ar#Class2"], "multiplicity" => ["0..*","0..*"], "roles" => ["http://crowd.fi.uncoma.edu.ar#class1","http://crowd.fi.uncoma.edu.ar#class2"], "type" => "association"];
if assoc has an associated class =>
{"name":"http://crowd.fi.uncoma.edu.ar#r1", "classes":["http://crowd.fi.uncoma.edu.ar#Class1","http://crowd.fi.uncoma.edu.ar#Class2"], "multiplicity":["0..*","0..*"],"roles":["http://crowd.fi.uncoma.edu.ar#class1","http://crowd.fi.uncoma.edu.ar#class2"], "associated_class":{"name":"http://crowd.fi.uncoma.edu.ar#r1", "attrs":[], "methods":[]}, "type":"association with class"};
$array_assoc = ["name" => http://crowd.fi.uncoma.edu.ar#r2, "classes" => ["http://crowd.fi.uncoma.edu.ar#Class1","http://crowd.fi.uncoma.edu.ar#Class2"], "multiplicity" => ["0..*","0..*"], "roles" => ["http://crowd.fi.uncoma.edu.ar#class1","http://crowd.fi.uncoma.edu.ar#class2"], "associated_class" => ["name" => $classname, "attrs" => [], "methods" => []], "type" => "association with class"];
same_subsumption |
( |
|
$sub1, |
|
|
|
$sub2 |
|
) |
| |
Compare subsumptions by parent and childs according to the standard JSON generated in crowd
{"name":"http://crowd.fi.uncoma.edu.ar#s1","parent":"http://crowd.fi.uncoma.edu.ar#Class1", "classes":["http://crowd.fi.uncoma.edu.ar#Class2"], "multiplicity":null, "roles":null, "type":"generalization", "constraint":[]}
$array_sub = ["name" => $ontologyIRI."#s1", "classes" => $classes, "multiplicity" => NULL, "roles" => [NULL,NULL], "type" => "generalization", "parent" => $parent, "constraint" => $constraints];