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

definition: Info
 
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: Info
 no demanded arguments
deterministic: Info
 deterministic operation
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> {ERD}}
name: Info
 convert
precedence: Info
 no precedence defined
result-values: Info
 {ERD}
signature: Info
 XML.XmlExp -> Database.ERD.ERD
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term