Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes over the project #50

Open
juanmglzs opened this issue Mar 27, 2023 · 4 comments
Open

Changes over the project #50

juanmglzs opened this issue Mar 27, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@juanmglzs
Copy link
Contributor

1. How to handle user's session

@FdezAriasSara And I were talking and we think that we probably need to implement some kind of "Session Handler" to be able to manage the SOLID POD access. It will store the session fetches from the user.
Also, I thought that we could use the User.js class to store the webID so if we add this new handler, we can move it there so that it makes more sense, since it's like a session attribute...

2. How to manage data insertions

Another problem that I'm having is how to decide how we are going to manage SOLID POD access. I know that we have decided that once the user logs in, everything will be loaded from the pod into the web app, but;

  • Do we allow the user to modify fields from an existing Location?
  • Do we allow the user to delete an existing Location/Review?
  • Do we allow the user to change the privacy level of a Location or Review?

2.1. Deciding whether the data insertion into the pod is complete or partial

I have thought about these two options but feel free to add any thoughts or any other alternative.
Now that we are starting, the data that we will handle will be small, so removing everything and re-writing it before closing the session will not take a lot of time. But if the amount of data gets bigger... we could end up having performance issues.
Maybe we can use some kind of ChangesController to manage these situations. So we know when we need to create a new location, modify some values or just delete it. (The same thing for the Reviews).

Now what it's doing is:

  • Asking POD for the DataSet of Locations in RDF (RDF-Location)
  • Convert them into a Location from our domain Model (DM_Location)
  • (the user interacts with these objects through the web app and when s/he log out)
  • Remove everything inside the DataSet
  • Convert user's DM-Locations into RDF-Locations
  • Add them to the DataSet in the user's SOLID POD

2.2. Deciding when the data insertion is made

Another way could be to save all the changes when they are made. So the user will log in and we get everything that we need from its pod, but every time s/he creates, updates, deletes a Location/Review the method saveInToThePOD is called and the changes are saved. I don't know if this will improve or worsen the user's experience...

@juanmglzs juanmglzs added the question Further information is requested label Mar 27, 2023
@Manuhcuartas
Copy link
Contributor

In terms of how to manage data insertions, I think we should allow the user to perform deletre/update operations as long as these operations refer to data inserted by this user if that is what you mean.

Regarding point 2.2. I would try to prioritize performance over everything, so we could try different approaches and see which one gives us a better one, although it is just my opinion.

@FdezAriasSara
Copy link
Contributor

FdezAriasSara commented Mar 28, 2023

In terms of how to manage data insertions, I think we should allow the user to perform deletre/update operations as long as these operations refer to data inserted by this user if that is what you mean.

Regarding point 2.2. I would try to prioritize performance over everything, so we could try different approaches and see which one gives us a better one, although it is just my opinion.

I think the same . I would like users to be able to change data (or delete it ) as long as it's theirs.

Performance wise,i guess ( im not sure at all ) that the best we can do for the user experience is to actually perform changes in the pod when the user exits the app. Maybe using the session handler itself? But I think we really have to think this trough .
How are we going to represent those changes?
Do we store the updated copy of the file in some way and then replace the existing one in the pod???
Do we make a log of operations and then create a request from it?? (for example:
logfileexample.txt

update:resourceName thingIRI:IRI  fieldUpdated:newValue

delete:resourceName

addLocation:resourceName ....

and so on 

then we have a method that parses this into actual inrupt api requestS?

)

We could also make some sort of "update pod " button? So the user can choose to actually send the request at that moment if for some reason its his /her desire?

Regarding point 1 i totally agree as i told you in the meeting. I think using a user object would be a nice a idea.

For the moment those are my ideas so far, thanks for your contributions

@juanmglzs
Copy link
Contributor Author

To control the changes in the objects i think that the fastest and easiest way (at least for me) will be to have a class with two list (update and remove) and each of them with contain the location id in the list needed.

For example, if we change a parameter in the location (id=1) the list "update" will contain 1. If we delete that location, the list "remove" will contain 1 and it will be removed from "update".

I know that we should study what data structure can be used to improve performance. And also id that is the best way; when updating since we don't know the field that has been changed, it will update all of them even if some of them still the same.

If you guys find any other way, let me know. 😀

@FdezAriasSara
Copy link
Contributor

FdezAriasSara commented Mar 29, 2023

To control the changes in the objects i think that the fastest and easiest way (at least for me) will be to have a class with two list (update and remove) and each of them with contain the location id in the list needed.

For example, if we change a parameter in the location (id=1) the list "update" will contain 1. If we delete that location, the list "remove" will contain 1 and it will be removed from "update".

I know that we should study what data structure can be used to improve performance. And also id that is the best way; when updating since we don't know the field that has been changed, it will update all of them even if some of them still the same.

If you guys find any other way, let me know. 😀

thats actually way smarter than what i proposed !

Regarding the data structure , maybe a dictionary/map could be better?
the key is the operation and the value the id , so we an filter using operations for example (pseudocode )

mapOfLocations={"delete":"podID1","update":"podID2"....}

deletedLocations=changesDict.filter(element=>element.key=="Delete")

deletedLocations.map( (element)=>deleteSolidDataset(lomapFolderUrl+"/"+element.getValue();)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants