-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to share routes? #34
Comments
I'll also tell you how Inrupt answers some of these questions: Notification ShapeThe notifications according to Inrupt have this form: @prefix terms: <http://purl.org/dc/terms#>.
@prefix as: <https://www.w3.org/ns/activitystreams#>.
@prefix schema: <http://schema.org/>.
@prefix solid: <https://www.w3.org/ns/solid/terms#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix : <https://pruebachristian.solid.community/inbox/1583248045023.ttl>.
<URI of notification> a as:<Notification type>;
schema:license <license of notification>;
terms:title "title of notification";
as:summary "URI de la notificación";
as:actor <WebID of the user who wants to share the resource>;
as:target <WebID of the user with whom you want to share the route>;
as:object <URI of resource>;
solid:read "notification read or not"^^xsd:boolean;
as:published "sending date"^^xsd:dateTime.
( Our group is using Offer as a type of notification InboxFrom what we've seen, the Inrupt application creates an inbox inside the game folder (which the sample application uses to manage the game information) and sends the notifications there, although it is also able to use the general inbox of the POD. Our group proposes to have a dedicated inbox for viade. Where do we store the URIs of the routes you share with us?Apparently, Inrupt saves the game shares in a Turtle file and links the resources there using scheme:hasPart. We think we should do the same but instead of using scheme:hasPart use another property. |
We have done a different aproach with the route sharing funcionality. The user B doesn t have to accept the shared route, he can get the uris of shared routes from a file in user A pod instead writting it in the B user's pod. |
Hmm looks interesting, and how would the user know all the routes his friends have shared with him? |
If the user A wants to know all the routes shared by his friends, A checks in their pods a file stored in viade/routes/shared/{userAwebId}.json (or .ttl if you are using turtle), which contains a list of the uris shared with him. |
In my group we have a folder inside viade called inbox, so we agree with that proposal. We don't accept the routes, our notifications are only to inform the user that something has been shared. I think that it is better that the content is shared directly, without having to accept anything. |
#34 (comment) (Sergio) #34 (comment) (Sara) |
I highly recommend discussing first the folder structure for the application in issue #4 in order not to mix up things |
I think we should also take into account that the approach of using the inbox/notifications to share routes is only valid for groups using the Inrupt generator... It will be difficult to accomplish that approach for the groups that don´t use that template. I like the solution proposed by @uo265363 . |
@christianpe98 There is no security problem, the user B can read only the file with his webId, the folder itself can not be readed without read permission, so A can't see the files inside. I dont see this as big workload neither, it s just one more file fetch for each friend. @Raulpemol I think we should first discuss here if sharing routes needs an auxiliar folder for working properly without having security issues. |
We talked about this and decided on either make copies of shared routes, so they are independent of the creator, or writing the URIs, so they stay as a reference. I think writing URIs is ok and it seems everyone is taking this approach. About where to store them, we decided on storing on a user's pod the routes shared with them, having a specific folder with global writing permissions. This has also been proposed here. About notifications, as @themrcesi stated, it can be difficult to deal with them for groups not using the template. We think directly writing the URIs of routes is the correct approach. Also, note than when a route is shared, its permissions have to be changed for the receptor of the route to be able to read it. |
@InigoGutierrez If an user A shares a route with a user B, the uris are stored in the B's pod?There is problem with that. If A shares a masive number of routes with B(maybe trying to atack him), The pod size of B could get to it's limit, so if another user try to share something with B he wouldn't be able to get those routes. |
@themrcesi @InigoGutierrez To implement the approach of sharing resources through notifications it is not necessary to use the Inrupt generator, you only need to use the hook useNotification() which is in the solid-react-components library (which I imagine many of you already use). @uo265363 Okay, I think I got it.However, I'm still not convinced at all, if I have 100 friends and I want to see the routes that they have shared with me I have to make 100 requests to the server to read, if it exists, the viade/routes/shared/{userAwebId}.json. file of each friend. Wouldn't that take a long time? And wouldn't it be the responsibility of storing the URIs of the routes that each friend shares with user B in the wrong place? Because for example, if user A is no longer accessible you would lose the information that he has shared routes with you. |
@christianpe98 I think I did not understand correctly what you are proposing then. Can you explain it in more detail? |
I will reformulate what has been exposed in #4 about this topic, and what some people here considered a good approach. I will also comment some of our architectural decisions. We have identified some ways of solving this issue, I will be commenting some of them. Route Folder PermissionsThis is what we are doing now in our app. Managing the permissions of the viade/routes directory and the files inside we can cover this functionality. Assume that wants to share a Route with Sara. Let's see what can be done. Luis will give Sarah reading permissions to the viade/routes directory and then give reading permissions to the route file. By means of the solid-file-client module Sara can list all the webIds in the folder. You may not have access to all the routes, so it will necesary to check over which of those webIds the current user, in this case Sara has read permissions, and only show those to the final user. Advantages and DisadvantagesIt is clear that this is a pretty simple approach, both for programmers and for the pod owner, since there would not be a large amount of artificial app files. We have a disadvantage though, continuing with the example Sara would be able to list Luis viade/route folder, being able to read the names of the files inside. Tradeoff decisionSince the names of the files does not really provide a piece of information, being just a webID, we believe this is not a security problem. Consider that in real life you may have URLs but the server can deny you the access to it, it would be exactly the same approach. A file in Sara's POD per friendIn this example when Luis wants to share a Route with Sara he will go to a specific folder in Sara's POD, let's call it viade/shares, and there he would have to update a file related to himself, where he must list all of his route Sara has access to. Tradeoff decisionSara would have to give writing permissions in that folder to everyone, since SOLID friends system is not reciprocal, and so she doesn't know who may share a route with her. We believe this is a really bad approach. (You may even fill that folder with non relevant files) A file in Luis' PODIn this approach Luis will have a file per friend in a folder, let's call it viade/shares. This file will have some easy identifier of Luis friend in this case Sara, something such as the webID. Let's explain how this would work. Again Luis wants to share a route with Sara. Luis must give Sara reading permission for the route file, he should add her to the corresponding file in viade/shares, if such a file doesn't exist, he would have to create it, following a convention, in this case, Sara's webId.jsonld (just an example). He must also provide reading permissions for the viade/shares folder and for the file that points to all the routes shared with Sara. Sara will have to check first if she can list the folder (that condition is met is at least Luis have shared one route with her). Then she checks the corresponding file, and get the webIds of Luis's routes. Tradeoff decisionThis approach is pretty much the same as the first one. In the end we need to allow the friend to read the route file. What this solution provides is that you doesn't give the webId of your routes, but in the end you are now giving the webId of the sharing files. It's the same issue in other place, and complicating a lot the design. VariantThere exists another way to follow this idea, but you will have a file and inside the links of all your friends, we believe that is an awful approach but we must say that we considered it too. ConclusionWe concluded considering that the best approach was the first one, even though at the beginning we were a bit concern about that. Consider real applications, for instance social networks. Here you may see which are other people friends, count them an so on, seeing this we considered that being able to know the amount of routes of a person, may be even useful in some cases, for instance statistical research. Hope this proves useful to you guys. |
I just want to point that there is a little mistake with the "A file in Luis' POD" version. The 1st aproach's issue does not happen here. The viade/share doesn't have read permisions, so you can't list the webIds inside, you can only get the file by using its uri directly, and that file is always named with the user id, so you can always get to it without need to list the folder before. But anyway, I see a fair tradeoff between the aproachs and we don t have any problems with using the first one to ensure interoperability. |
That's true, thanks. |
@luispc1998 there're another approach, the Inrupt's approach.I'm going to try to explain it as best I can, although my English isn't especially good XD. The Inrupt approach is very similar to A file in Sara's POD per friend approach that @luispc1998 explains,the difference is that it solves the problems that Luis indicated. Before I explain, I'll clear up a few things:
So ,following the examples of Luis:
Advantages
Disadvantages
|
Due lo the lack of participation in this issue which we consider crucial for the interoperability. We have done a form: https://forms.office.com/Pages/ResponsePage.aspx?id=o3TqBcWSMUyXipJcPHmc0BAg91QvzdpOkrb4dXEp4URUNTJHRDlETlpSV0hJNjhRREtOVjM1U0lCVS4u |
I have one question about the idea of Use pod permissions. In this idea, is notifications useful? I mean, the notification is only to tell that X person has share you a route, right? |
And another question, in this idea "Use inbox folder", do we have to decide a specification for the file, and use the same format like Turtle or JSON-LD? |
For your first question that's right, the notification will just inform the user, since that information will be available for him even if he doesn't read the notification.. For the second one, I guess so, but nothing was said about that yet. We would like to comment it more and see which is the most fitting approach. |
You may check the results in the following link: https://forms.office.com/Pages/AnalysisPage.aspx?id=o3TqBcWSMUyXipJcPHmc0BAg91QvzdpOkrb4dXEp4URUNTJHRDlETlpSV0hJNjhRREtOVjM1U0lCVS4u&AnalyzerToken=CDvAMpKexCTlKHR4SfyhmYzBpRJSCIR3 My group didn't vote, so it would be a 5-5, however since we believe that there is no time to discuss it more, we will be trying the inbox folder approach, so that would be a 4-6. It was commented in this post the following by @christianpe98:
However there is no specification in this repository about such a file, should we have uploaded a simple approach to this issue in our pull request #21 . |
In fact it doesn't really matter which format is used in the rest of the application in order to use one or another here. If we use the jsonld as proposed for this fact, it doesn't affect the rest of the application. So in order to discuss which format to use for this file, please let's just think about this particular case and do not mention the format that each of us use to store routes. |
InteroperabilityIf we want the notification and route sharing system to become interoperable, i think we will have to decide: My opinion:1- We should create an inbox inside viade so that if the user uses more applications the notifications don't get mixed up. NameIn my group we are using: shared_with_me FormatThe file should have an extension that is an RDF serialization, Turtle or JSON-LD . I think that users that use Turtle for routes should continue to use Turtle for this file and those of JSON-LD that continue with JSON-LD, this way the only interoperability problem that exists would be fixed by parsing. WhereI think the file should be inside viade at the same level as the routes,media,comment folders. Vocabularyidk, We'll have to investigate schema's vocabularies This is all my opinion. Maybe some of you probably have better ideas. |
We agree with an Inbox folder inside Viade, where these notifications would be stored. We don't think that having a unique file for all the URIs is a good idea. It is more common that a user will have more routes shared than friends, so having a file per friend would be the best solution in our opinion. If you want to retrieve all the routes that a friend has shared with you, you would have to parse a huge file in your case. |
I agree with @Raulpemol that it could be more useful if we use a file per friend. |
Yeah, that's what I believe would most appropriate. Just to make the point as clear as possible, instead of a file per friend, it would be a file per person that shared a route with you, as some friends may never share any route with you. Once, the first route is shared, the file is created. |
@Raulpemol Having a common format for the file/s looks right. x: file reading time One file with all the URIs(A)
Total time: x + x*(NºUris) One file per person that shared a route with you(B)
Total time: y+ x*(Nºfiles) + x*(Nºtotal Uris) ComparisonTo simplify, we'll eliminate the constants: The complexity of approach B is higher than that of approach A Correct me if I'm wrong about anything, that I'm a little out of practice XD. |
Why arbitrarily eliminate those first constants? The idea you are trying to convey, correct me if I'm wrong, is that: A depends on NºURIs While on B more files are read, the complexity of both approaches is the same, O(n). Therefore, i would rather not discuss on choosing one or the other based on efficiency, since you know what they say: premature optimization is the root of all evil. |
@InigoGutierrez That's right, my mistake. |
My teammates and I were discussing both approaches and we came to the conclusion that they have little to no differences the only important one we identified is that the approach of having several files is more robust to failures (e.g corruption of files or accidental deletions). |
I dont understand the point because i thought that the idea was: i receive a notification, and i accept, i copy the webid of the route that is in the notification in the file of the person that has shared me his rout, so i don't know why the other person has to have permission |
Yeah you are right Inés, I also believe that's a better approach. |
I just realized that the name of the file in the 'shared' folder has to be common. One idea would be that the name is the webId of the friend, since nobody is supposed to be able to read it (only the owner) and it doesn't matter... but I don't know what you think |
I think it could be better to use the whole domain name of the POD, such as "username.solid.community", because more than one person may have the exact same name. |
Won't there be just one file in the shared folder containing the URIs of routes shared with the user? Regarding the name, we are calling it |
I thought it had been agreed that it was better to have one file per friend, leaving aside the complexity although it was defended that it was the same. |
If it's only one file, sharedRoutes would be a good name |
Yes, our group also believed that that approach was the one agreed. |
Leaving the complexity aside, the one file approach wasn't supported by any other advantages. |
I think it should be discussed soon, because there are groups like mine that don't use JSON-LD on the routes, and parsing the json-ld will delay us a little more... |
Yes, there shall be a final decision soon. However, don't worry about parsing jsonlds, as the JavaScript JSON object does all the work for you and you just need to get the value from the desired field. It should be very straight forward. |
I think that if the @InigoGutierrez group started to do it with one file for all the friends, we can continue with that idea since they have started to implement it. The idea of a folder inside 'viade' called 'shared' and inside a file 'sharedRoutes.jsonld' seems to be good. The only thing I have doubts about is the specification, I don't know how it would be an example of several shared routes. |
I don't know if I have understood it right, but we have also started implementing it using a file per friend, and I am sure that many other groups have also started doing it following who knows which approach. I am sorry but don't follow that reasoning. |
Well, this should be discussed among those of you who have started, because, for example, my group was waiting for a joint decision, so we don't care |
Our group prefers 1 file per friend. And what's the point on having a single file in a shared folder? |
Yes, I just thought of it and it doesn't make sense if it's just a file that's inside the folder 'shared' and that the folder exists. 1. File per friend: File per friend, inside a folder 'viade/routes/shared/{webIdOfFriend}.jsonld' |
We took this approach trying to conform to the specification currently presented in the open pull request, but reviewing it I think I misunderstood it. It is confusing and should be changed: it first talks of having several files, not specifying what for (I suppose that the intended explanation is having a file per friend who shared a route) and then showing an example of a file with routes of different owners, which conveys the idea of having all the routes of every sharer in the same file. We should agree on this soon, and we acknowledge that some groups have already implemented it in one way, some in another. I sincerely find it much easier to have just one file (probably not inside its own folder since this wouldn't make much sense) since that file will not be shared with anyone and adding and reading would not have to deal with parsing several files or having to choose the correct file to add a route to, when in the end all will have the same behaviour. |
I don't have much idea about jsonld, so I can't say if it's easier to do queries if there is one file with everything or if there are several files. |
In the active pull request you can find since a couple of days the format proposed for the file that I believe you are talking about. Please note that if the current "several files" approach is followed, the owner of the route is obtained by the name of the file, so the json will just be a list of uris. |
Yes i saw the format proposed but i thought that ShareAction would be better than Offer, but it was only an idea |
And do you have a proposal for your idea? @Raulpemol @InigoGutierrez I think that your proposal is good but type Offer is not a good one because we are not offering, so i think it would be better what i said, ShareAction.. I don't put it in the proposal because i want to know your opinion about that because it's your proposal. I know we have to agree but if we don't decide it early, my group will start with one of those propose because it's getting late. |
Of course I have, I've already told you that it is in the pull request and I have also explained how it is supposed to work. Or what do you mean? |
I'm sorry i didn't see it because i was looking in the comments. You mean this, right? [https://github.com/Arquisoft/viadeSpec/blob/POD_Data_Management_Proposal/main/jsonldProposal/sharedRoutesExample.json] |
Exactly, that one. |
Okey, i saw it was proposed 7 days ago so i'm gonna try to follow yours specification. |
Perhaps this issue really should not be in this specification but I think it is an important point so that we are all as interoperable as possible. Our group proposes the approach followed by Inrupt (sharing routes through the use of notifications).
Explanation of the Inrupt approach:
A user A shares a resource with a user B, so user A gives permissions to user B about the resource he is going to share and user B must save in his POD the URI of the resource to be able to access it. How can user A inform user B about the URI of the resource if user A doesn't have write permissions about the POD of user B? To solve this Inrupt uses notifications.
User A sends a notification to the inbox folder of user B's POD with the share route information. When user B login the application will show him the notifications and if he accepts (this is really not necessary) the application with the login of user B will save the URI of the path in the POD of B.
We will have to decide:
1- Should we all follow Inrupt's approach and share routes by using notifications?
2- If we do it as Inrupt, what form should the notifications have and in which inbox will we save them?
3- When a user accepts the shared route notification, where will we store the URIs of the routes that they share with us?
I hope you have explained it to me fairly well. @labra is there any error in what I explain?
The text was updated successfully, but these errors were encountered: