WICOM
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
UMLcrowd Class Reference
Inheritance diagram for UMLcrowd:
UML Strategy

Public Member Functions

 __construct ()
 
 change_min_maxTo_false ()
 
 decode_classes ($extractor, $builder)
 
 decode_subsumptions ($extractor, $builder)
 
 cardinalities_lookup ($extractor, $domain, $range, $eqclasses, $op)
 
 decode_relationships ($extractor, $builder)
 
 decode_attributes ($extractor, $builder)
 
 decode_equivalences ($extractor, $builder)
 
 decode_disjointness ($extractor, $builder)
 
 decode_rolehierarchy ($extractor, $builder)
 
 r_cardinalities_lookupOWLLINK ($domain, $eqc_to_domain, $op)
 
 l_cardinalities_lookupOWLLINK ($range, $eqc_to_range, $op)
 
 compare_cardinalities ($json_o, $json_new, $jsonbuilder)
 
 merge_answer ($json_o, $json_new)
 
- Public Member Functions inherited from UML
 translate ($json_str, $builder)
 
 decode ($owllink_str, $jsonbuilder)
 
 merge_answer ($json_o, $json_new)
 
- Public Member Functions inherited from Strategy
 __construct ()
 
 translate ($json, $build)
 
 decode ($owl, $jsonbuild)
 
 translate_queries ($json, $builder)
 
 analize_answer ($reasoner_query, $reasoner_answer, $owl2)
 
 get_answer ()
 
 compare_subsumptions ($json_o, $json_new, $jsonbuilder)
 
 merge_answer ($json_o, $json_new)
 

Data Fields

const MAX_CARDINALITY = 9
 

Protected Member Functions

 translate_multiplicity ($mult, $role, $classes, $from=true)
 
 translate_association_without_class ($link, $builder)
 
 translate_association_with_class ($link, $builder)
 
 translate_generalization ($link, $builder)
 
 translate_attributes ($json, $builder)
 
 translate_links ($json, $builder)
 
 is_crowd_class ($class)
 
 is_crowd_classMin ($extractor, $class, $op)
 
 is_crowd_classMax ($extractor, $class, $op)
 
 strictsub ($subs, $without_thing, $extractor)
 
 get_crowd_cardinalities ($min_arr, $max_arr)
 
- Protected Member Functions inherited from UML
 translate_attributes ($json, $builder)
 
 translate_links ($json, $builder)
 

Protected Attributes

 $with_min_max = true
 
- Protected Attributes inherited from Strategy
 $qapack = null
 

Detailed Description

This module implements the graphical-oriented UML encoding for crowd. Read paper "" for more details about formalisation.

See also
Translator class for description about the JSON format.

Constructor & Destructor Documentation

__construct ( )

Member Function Documentation

cardinalities_lookup (   $extractor,
  $domain,
  $range,
  $eqclasses,
  $op 
)

Returns cardinalities looking for min and max classes according to the specific crowd strategy

Parameters
$domainA String containing the class domain of the object property $op
$rangeA String containing the class range of object property $op
$eqclassesAn Array containing the equivalent classes of min and max for the object property $op
$opA String containing an object property
Returns
$cardinality An Array with left and right cardinalities for the object property $op
change_min_maxTo_false ( )
compare_cardinalities (   $json_o,
  $json_new,
  $jsonbuilder 
)

Comparing cardinalities and looking for new ones after reasoning and extracting new OWL 2

Parameters
$json_o{JSON} JSON representing original diagram
$json_new{JSON} JSON representing new diagram extracted from a resulting OWL by means of SPARQL-DL
$jsonbuider{Object} Object to work with JSON diagram primitives
Returns
An array of associations with implicit cardinalities (if any). Otherwise, it returns an empty array.
decode_attributes (   $extractor,
  $builder 
)

Decoding data properties and building JSON UML attributes primitives

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis an UMLJSONBuilder
decode_classes (   $extractor,
  $builder 
)

Decoding classes and building JSON UML primitives

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis a UMLJSONBuilder
decode_disjointness (   $extractor,
  $builder 
)

Decoding disjoint axioms and building JSON primitives to append to UML JSON as non-graphicable.

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis an UMLJSONBuilder
Note
UML does not include any graphical primitive for OWL 2 disjoint axioms
decode_equivalences (   $extractor,
  $builder 
)

Decoding equivalence axioms and building JSON primitives to append to UML JSON as non-graphicable.

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis an UMLJSONBuilder
Note
UML does not include any graphical primitive for OWL 2 equivalence axioms
decode_relationships (   $extractor,
  $builder 
)

Decoding roles and building JSON UML association primitives

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis an UMLJSONBuilder
decode_rolehierarchy (   $extractor,
  $builder 
)

Decoding role hierarchies and building JSON primitives to append to UML JSON as non-graphicable.

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis an UMLJSONBuilder
Note
UML does not include any graphical primitive for OWL 2 subobjectproperty axioms
decode_subsumptions (   $extractor,
  $builder 
)

Decoding subsumptions and building JSON UML primitives. This strategy does not build subsumptions with bottom.

Parameters
extractoris a set of axioms extracted from an OWL 2 document using SPARQL-DL
builderis a UMLJSONBuilder
get_crowd_cardinalities (   $min_arr,
  $max_arr 
)
protected

Following functions process the RACER outputs in order to get explicit and implicit cardinalities by using crowd strategy where min and max classes are asserted before feeding the reasoner. A set of min (max) classes become equivalent to their parents when cardinality is fulfilled. So the the greater one for min and the minor for max are chosen from cardinality array.

See also
This class should be refactored if max cardinality is changed to greater than 9
Parameters
$min_arr{Array} An array of min equivalent classes
$max_arr{Array} An array of max equivalent classes
is_crowd_class (   $class)
protected

This function identifies classes generated for the crowd strategy. For instance: "http://crowd.fi.uncoma.edu.ar/Class_R_max" and "http://crowd.fi.uncoma.edu.ar/Class_R_min"

is_crowd_classMax (   $extractor,
  $class,
  $op 
)
protected

This function identifies classes generated for the crowd strategy. For instance: "http://crowd.fi.uncoma.edu.ar/Class_http://crowd.fi.uncoma.edu.ar/R_max"

Note
variable $matches in preg_match returns an array of subpatterns. For each crowd min and max class, the subpatterns are:
  • array[0]: full matching string "http://crowd.fi.uncoma.edu.ar/Class_http://crowd.fi.uncoma.edu.ar/R_max_N"
  • array[1]: first subpattern "http://crowd.fi.uncoma.edu.ar/Class"
  • array[5]: last subpattern "R"
is_crowd_classMin (   $extractor,
  $class,
  $op 
)
protected

This function identifies classes generated for the crowd strategy. For instance: "http://crowd.fi.uncoma.edu.ar/Class_http://crowd.fi.uncoma.edu.ar/R_min_N"

Note
variable $matches in preg_match returns an array of subpatterns. For each crowd min and max class, the subpatterns are:
  • array[0]: full matching string "http://crowd.fi.uncoma.edu.ar/Class_http://crowd.fi.uncoma.edu.ar/R_min_N"
  • array[1]: first subpattern "http://crowd.fi.uncoma.edu.ar/Class"
  • array[5]: last subpattern "R"
l_cardinalities_lookupOWLLINK (   $range,
  $eqc_to_range,
  $op 
)

This function returns the left cardinality for $op and $range class

Parameters
$range{String} Range class for $op
$eqc_to_range{Array} Equivalent classes to range (min and max ones)
$op{String} Binary association name (Object Property)
Returns
An array of cardinalities [M,N]
merge_answer (   $json_o,
  $json_new 
)

Merge answer puts together results from SPARQL-DL and Racer/Konclude to get a resulting diagram It calls its parent to get implicit subsumptions and here processes associations for implicit cardinalities.

Parameters
$json_o{JSON} JSON representing original diagram
$json_new{JSON} JSON representing new diagram extracted from a resulting OWL by means of SPARQL-DL
Returns
An answer
See also
Answer
r_cardinalities_lookupOWLLINK (   $domain,
  $eqc_to_domain,
  $op 
)

This function returns the right cardinality for $op and $domain class

Parameters
$domain{String} Domain class for $op
$eqc_to_domain{Array} Equivalent classes to domain (min and max ones)
$op{String} Binary association name (Object Property)
Returns
An array of cardinalities [M,N]
strictsub (   $subs,
  $without_thing,
  $extractor 
)
protected
translate_association_with_class (   $link,
  $builder 
)
protected

Translate associations without class together with cardinalities.

Parameters
linkA JSON object representing one association link with class.
translate_association_without_class (   $link,
  $builder 
)
protected

Translate associations without class together with cardinalities 0..*, 1..*, 0..1, 1..1 and M..N > 1 for both directions.

Parameters
linkA JSON object representing one association link without class.
Todo:
refactor this functions for reusing cardinalities parser

Algorithm to generate min and max classes:

from i = 1 to Max Class_R_min_i

from i = Min to Max_Cardinality Class_R_max_i

These min and max classes must be enumerated in order to avoid inconsistencies.

translate_attributes (   $json,
  $builder 
)
protected

Translate attributes from a JSON string using the given builder.

Parameters
jsonA JSON object, the result from a decoded JSON String.
Returns
false if no "attribute" part has been provided.
translate_generalization (   $link,
  $builder 
)
protected

Translate a generalization link into DL using the Builder.

Parameters
linkA generaization link in a JSON string.
translate_links (   $json,
  $builder 
)
protected

Translate only the links from a JSON string with links using the given builder.

Parameters
jsonA JSON object, the result from a decoded JSON String.
Returns
false if no "links" part has been provided.
translate_multiplicity (   $mult,
  $role,
  $classes,
  $from = true 
)
protected

Depending on $mult translate it into DL.

Parameters
$fromTrue if we have to represent the right cardinality.
Returns
A DL list part that represent the multiplicity restriction.

Field Documentation

$with_min_max = true
protected
const MAX_CARDINALITY = 9

The documentation for this class was generated from the following file: