CurryInfo: ertools-3.0.0 / Database.ERD.FromXML.convert

definition:
convert :: XmlExp -> ERD
convert xml = 
  let contentxml  = getContent 
                      (head 
                        (findElements 
                           [xml] 
                           ["XMI","XMI.content","UML:Model",
                            "UML:Namespace.ownedElement"]))
      logicalView = getContent 
                      (head 
                        (findElements 
                          (getUMLModel contentxml "Logical View") 
                          ["UML:Namespace.ownedElement"]))
      erm         = getUMLModel contentxml "Entity Relationship Model"
      exml        = findElements erm ["UML:Namespace.ownedElement",
                                      "UML:Entity"]
      rxml        = findElements erm ["UML:Namespace.ownedElement",
                                      "UML:Association"]
      idlist      = (iddata logicalView) ++ (identities exml)
      name        = fromJust 
                      (lookup "name" 
                              (getAttrs 
                                 (head (findElements 
                                          erm 
                                          ["XMI.extension","diagrams",
                                           "diagram"]))))
      es          = map (convertE idlist) exml
      rs          = map (convertR idlist) rxml
  in
  if uniqueNames es rs
  then ERD name es rs
  else error "names (entity, relationship, role) in er-diagramm not unique"
demand:
no demanded arguments
deterministic:
deterministic operation
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_) |-> {ERD}}
name:
convert
precedence:
no precedence defined
result-values:
{ERD}
signature:
XML.XmlExp -> Database.ERD.ERD
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term