Git Product home page Git Product logo

assignment's Introduction

Demo Project

This is a demo project, which shows some of the data model interactions we do in the PDS project.

The project objective is to generate a tabular report in CSV format from our data standard specification.

Please fork the project to you own bitbucket, github, or other git hosting account, and give us access to the repository holding your solution - or alternatively send send us a zip-file with the solution.

Data Standard

We have a data standard, which describes the context for our products.

The data standard has a list of categories, which disjointly categorize the products. The categories are linked together in a hierarchy, where a category points to it's parent. E.g., for a Clothing category, we could have sub-categories T-Shirts and Jeans so the resulting category hierarchy would be Clothing/T-Shirts/Jeans. There is always a single root, where the parent is not set.

The data standard also has a set of attributes, which describe the data on the products. The attribute has a type, which specifies the type of the value. E.g., an attribute could be a Description of type string and a Price of type decimal. The attributes are linked into the categories using attribute links. Attributes available for a given category are determined by including all attributes linked to any category in the corresponding category hierarchy, all the way to the root category. E.g., attributes defined in the Clothing category are also available for products in the T-Shirts and Jeans categories.

Some attributes also link in other attributes, which means that this attribute is a composite definition. An attribute in a composite definition can also be a composite.

The data standard also defines a set of attribute groups, which is an ability to scope the attributes by their purpose. One attribute can be linked in to multiple attribute groups. E.g., you could have a group with all assets, and other groups also including some assets. It is a tool which helps us filter the attributes.

Some data standards have more than 10,000 categories and 10,000 attributes. The number of available attributes in a category can exceed 500.

There is a trivial test data standard in the datastandard.json test resource. The object model for the data standard is defined in the model package.

Deliveries

The assignment is to implement the report method in the Reportservice service. The method takes a data standard object and a category id as argument, and should return a list of list of strings. The outer list is a list of tabular rows, and the inner lists are a list of cells in a row. The controller endpoint makes a naive conversion of this to CSV.

There is a test setup, which can be used to exercise the service call.

The deliveries are split into 3 levels. You do not have to support all levels at the same time, it is just a way of splitting the assignment in parts, to set goals during the development. The added content from the previous level is in bold.

Notice, that the method should return the content of the tables shown below. The above mentioned endpoint converts it to csv.

Level 1

Produce a report like this on the test data standard:

+---------------+-----------------+-----------------------------+-----------+
| Category Name | Attribute Name  | Description                 | Type      |
+---------------+-----------------+-----------------------------+-----------+
| Root          | String Value    |                             | string    |
+---------------+-----------------+-----------------------------+-----------+
| Leaf          | Composite Value | Composite Value Description | composite |
+---------------+-----------------+-----------------------------+-----------+

The fields are:

  • Category Name: the name of the category, the attribute is linked in to.
  • Attribute Name: the name of the attribute.
  • Description: the description of the attribute.
  • Type: the type id of the attribute.

Level 2

Produce a report like this on the test data standard:

+---------------+-----------------+-----------------------------+-------------+---------+
| Category Name | Attribute Name  | Description                 | Type        | Groups  |
+---------------+-----------------+-----------------------------+-------------+---------+
| Root          | String Value*   |                             | string      | All     |
+---------------+-----------------+-----------------------------+-------------+---------+
| Leaf          | Composite Value | Composite Value Description | composite[] | All     |
|               |                 |                             |             | Complex |
+---------------+-----------------+-----------------------------+-------------+---------+

The fields are:

  • Category Name: the name of the category, the attribute is linked in to.
  • Attribute Name: the name of the attribute, with an asterisk (*) appended, if the link to the attribute has the optional field set to false.
  • Description: the description of the attribute.
  • Type: the type id of the attribute, with brackets ([]) appended, if the multiValue field is set to true.
  • Groups: the names of the attribute groups listed in the groudIds field, separated by new lines.

Level 3

Produce a report like this on the test data standard:

+---------------+-----------------+-----------------------------+--------------------------+---------+
| Category Name | Attribute Name  | Description                 | Type                     | Groups  |
+---------------+-----------------+-----------------------------+--------------------------+---------+
| Root          | String Value*   |                             | string                   | All     |
+---------------+-----------------+-----------------------------+--------------------------+---------+
| Leaf          | Composite Value | Composite Value Description | composite{               | All     |
|               |                 |                             |   Nested Value*: integer | Complex |
|               |                 |                             | }[]                      |         |
+---------------+-----------------+-----------------------------+--------------------------+---------+

The fields are:

  • Category Name: the name of the category, the attribute is linked in to.
  • Attribute Name: the name of the attribute, with an asterisk (*) appended, if the link to the attribute has the optional field set to false.
  • Description: the description of the attribute.
  • Type: the type id of the attribute, with brackets ([]) appended, if the the multiValue field is set to true. If the attributeLinks field is set, then the links are _recursively expanded in braces ({}) as: two spaces, attribute name with optional marker, colon (:), and expanded type, separated by new lines..
  • Groups: the name of the attribute groups listed in the groudIds field, separated by new lines.

Real Data

If the application is started, it can be tested on real data as

curl -s -u key:secret http://localhost:8080/report/acme/T_SHIRTS

The expected content of this call is exported to the t-shirts.csv file, and imported into the corresponding T-Shirts.xslx file.

assignment's People

Contributors

akshaygautam144 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.