Assignment title: Information


From UML to XML and JSON Scenario The following class diagram represents part of the data model of a service for supporting placements of students with companies, including students' and companies' addresses and the contact details of their supervisors. In order to support students in finding a placement we would like provide students with information on suitable companies. For this purpose, we ask the service for a list of all students, in which each student is related to all companies based in their city of residence. This information will be sent by the service in a single text file. Since the overall numbers of both students and companies may be large, we would like to minimise redundancy and keep file size as small as possible. You are requested to design XML and JSON data formats to support such a download. Assignment XML Data Format: Derive and test a DTD following these steps. 1. Reduce the class diagram to those classes and attributes, associations and cardinalities required by the scenario. Justify for every element of the class diagram your decision to keep or drop it, always referring to the requirements of the scenario. [basic, 15 marks] 2. Create an XML-specific class diagram and justify the chosen document structure using the requirements from the scenario. [basic, 15 marks] 3. Derive the DTD and justify the style of mapping for the attributes you have chosen. Is the mapping from the class diagram in 2 to the DTD data preserving? Please justify your answer, and if the mapping is not data preserving, provide a valid object diagram or XML instance as a counterexample. [basic/advanced, 20 marks] As an alternative to the use of XML, design and validate a JSON data. 4. From the object diagram above create a JSON representation with the relevant data content as required by the scenario. What is the structure of this mapping? Does it avoid redundancy or lead to small files? [advanced, 15 marks] 5. Validate your JSON at http://som-research.uoc.edu/tools/jsonDiscoverer/#/simple using the online tool to create a class diagram. Copy the generated class diagram into your submission document and compare it to the given class diagram above, justifying any differences based on the requirements from the scenario. [advanced, 15 marks] 6. Following the examples and instructions at http://json-schema.org/examples.html create a JSON schema such that the JSON you produced in 4 becomes a valid instance. Submit the JSON schema as part of your CW document and validate the conformance of your JSON to this scheme at http://jsonschemalint.com/draft4/.1 Copy a screenshot of the validation report as confirmation. [challenge, 20 marks] Note: The solution to 4-6 is an independent alternative to 1-3. While both start from the same requirements in the scenario, the target languages are different, and your design decisions can be different, too. Submission and Mark Distributions The assignment contains a mix of basic, advanced and challenging questions. Jointly the basic elements allow a pass mark (> 50%) while basic + advanced components are worth 80%. The challenge question requires self study based on the online resource provided 1 Depending on the browser used you may have to reload the page after editing.