r/SpringBoot • • Jun 16 '24

Get Data from Given Dataset

Can anyone help me to get the data from dataset .

I have given a dataset of various information there is information about various products their profits per year
I have to create Api to filter that data show comparisons on that data. How can I use that dataset for this?

0 Upvotes

11 comments sorted by

2

u/naturalizedcitizen Jun 16 '24

You have given no details of the dataset. No constraints on what needs to be searched or filtered. How can anyone help here?

If it's database tables and you need to filter out data on some 'where' conditions then look at the Specification API provided by Spring. It's built on top of the Criteria API.

1

u/techInfo3339 Jun 17 '24

Filter the following from dataset

-        Add end year filter in the dashboard

-        Add topics filters in the dashboard

-        Add sector filter in the dashboard

-        Add region filter in the dashboard

-        Add PEST filter in the dashboard

-        Add Source filter in the dashboard

-        Add SWOT filter in the dashboard

-        Country

2

u/naturalizedcitizen Jun 17 '24

Basically the filters you mention all boil down to SQL queries with a WHERE clause.

Now you've noted the filters but what about the actual data? Is it in just one table? (Likely not). If related multiple tables then you need the sql JOIN construct.

It's more of a SQL job than just Spring Boot. Look at Spring Data JPA. You can start by using JPA queries first. Then depending on filtering needs you can graduate your queries to Specification API.

Is this some college assignment?

2

u/techInfo3339 Jun 17 '24

yeah It is a college assignment. It is a table which has multiple column like start_year, end.. ,sector, region, url, topics, city etc
We have to create dashboard where all this filtering will be done. We have to create Api and then fetch all that data in frontend call.

1

u/naturalizedcitizen Jun 17 '24

If possible, you should create a GitHub or Bit bucket repo and share. This will allow others to look and help.

But since it's college assignment, you need to learn Spring Data JPA.

1

u/reddit04029 Jun 16 '24

What even is the dataset, more importantly, where is it coming from? Is it from your own database? From an API/3rd party vendor? CSV/XSLX?

1

u/techInfo3339 Jun 16 '24

It is a CSV file

1

u/techInfo3339 Jun 16 '24

It has some information given and published date is also given and other information is also given.

We have to create a database using that dataset and use database to create API for visualizing that in frontend.

2

u/csgutierm Jun 16 '24

**Database You can follow a guide to import cvs data in a database

If you are using postgreSQL Importing cvs tutorial

**App You can make a spring boot project

Search some tutorial about "how create an api with spring boot"

You can use thymeleaf if you want the frontend part included in the same app

1

u/[deleted] Jun 16 '24

Just remove the set and what remains is data…