-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor TripleStoreService to be compatible with NextGraph #1263
Comments
I removed this part:
@nikoPLP is going to handle this transformation between DID and HTTPS URIs in the NextGraph API, this way the SPARQL query will always return the HTTPS URIs, and not the DID URIs. This will probably be an option to the SPARQL query API. When we store data, it will detect DIDs in the URIs, and store only the DID part. For this to work, it will be important to provide the related HTTPS URI when we create a new document. It will be saved in the "metadata" of the NextGraph document, using the This |
I'm not sure if I fully understand yet. So every URI that looks something like
So this is in order to restore the prefix
What does NextGraph need to fetch a remote webId for? |
exactly ! and this will be transparent to ActivityPods. with the APIs I give you, you can use the https://... version everywhere and you will also get in return (in SELECT/CONSTRUCT) everything with https:// . The mapping and prefix removing/adding will be done in nextgraph.
Here Seb wanted to say "to find the namedGraph" as documents and namedGraph are the same concept in nextgraph. But in any case the namedGraph will always be the exact same URI than the subject of all the triples of the RDF resource. Except if you add some "foreign" triples in the document, that have for subject some other URI, like by example if you want to establish facts about another resource, within your document (something that semapps cannot do for now but that Solid allows). In this case, if you want to know the namedGraph of such triples, you will have to look at the graph part of the quad, that is always returned to you, and that will be the document URI.
The And then, we understood that if containers and resources are all with But this brings some other problems, and we should probably open a special issue just for that, as the solution is not trivial.
The webId is a bit special because it should be easy to read by the end-user, as far as I understood from Seb. So... in order to solve this, Seb said, maybe nextgraph can fetch the webid from a remote server in https GET, and there will be a triple there that will say what is the did: of the document, and then nextgraph will be happy. but in fact, nextgraph won't be happy with this solution, because we have to respect the separation of concerns. nextgraph is just the quad store. it is aware that the activitypods is a bit special and has a special API (called headless) and it helps a bit with the ng:e to map to https urls. but it cannot start to interact with plain old https servers. this is the responsability of activitypods, that is doing all the bridging with the https world. In any case, it is not very efficient to have to fetch a remote resource every time you want to process and understand a URL that arrived and that you need to store. What should be done instead is that the URL itself contains all the information needed in order to process it. This is why the idea of using the format So we have to address the question of what exactly is a WebID. To add a bit more of complexity (why not!), I just realized this morning, that for the case of the User identification, in nextgraph, and in general i believe with DID, we have 2 identifiers for the User. one is the DID that uniquely identifies the User, the other is the DID that represents the document where we can store some information about such user. And I would argue, looking at your architecture, that there is a third DID, which is another document that holds some private information about the user, while the public document has some "system" information like the inbox etc..
So... we would have 3 DIDs.
We can probably reduce this to 2 only, if I implement the option to put triples in the But that doesn't solve the main problem. The problem is only for webId coming from other servers, because otherwise, on the local server, we know very well the mapping between DID and webId. I proposed that a webid URI could be of the form Those triples should also contain a link to the private user profile URI, because it is not the same one as the webid. I dont know if you already do that with the separation of public and private profile. remains the question of the "presentability" of such webId with a long unique identifier in it.
For ActivityPub agents, I don't know exactly how they use the WebId in order to display a nice username slug. I don't know neither how the Solid-OIDC is converting from the URL to a username. But I guess that was is done from now (take the first part of the URL path as the username) can be easily extended into : take the first part of the path and ignore the did part. I guess ActivityPods users, and also Solid users or ActivityPub users, do not carry with them their full https:// webId and only use their username slug in order to connect. So the underlying format of the webId URL, is hidden from them anyway. Finally, there are some ways that were researched in order bind a WebId to a DID, and an actor to a DID, in both the Solid community and the AP community. it isn't exactly what we want i guess, because it isn't expressed inside one URI. But it would be interesting and good to provide compatibility with that, so the DID of nextgraph can play well of other DIDs and with the whole ecosystem of Solid and AP. here are some links: Anyway, we cannot solve this question right now. But we will work on it later when we starting implementing all the integration with nextgraph. |
And we would definitely have to have a look at : |
Thanks for your thorough answer! Since we will be talking about it again later, I'll keep my comment short and will ask my open questions later. I'm very happy to keep in discussion about this :)
Right now, and this is a general convention in ActivityPub, users are usually preferrably identified with a handle like Also, I wonder if a 30X redirect from the basic webId to the webId with a |
I would be glad to read your longer version and open questions ! Another question I have: When you receive an Activity in APods, coming from an actor that is not on your server, do you fetch the resource describing the actor (that contains the inbox URL etc)? do you store it locally? |
why remove 'X-SemappsUser' . How fuseky will check WACL without user? |
Hello Simon, Bref, ce sont de gros changements, qui vont etre implémentés vers la fin de l'année, si tout va bien avec nos demandes de subventions. Apparement tu n'étais pas au courant. EnglishWe will seriously refactor SemApps and ActivityPods in order to prepare for integration with NextGraph and Fuseki 5. |
Bonne nouvelle @simonLouvet je pense avoir trouvé un moyen de faire le mapping entre WACL et les capabilités de NextGraph ! Donc pour le meme prix tu auras les requetes SPARQL protégées par ACL si tu utilises le backend NextGraph. I think I have found a way to map the WAC permissions to NextGraph capabilities! So it will be easy to maintain the WACs in the middleware and pass some capabilities in the SPARQL requests in order to enforce permissions in NextGraph quad-store! |
That's great to hear @nikoPLP !!! Regarding the DID-HTTPS mapping, I understand that no HTTP fetch should be done by NextGraph API, but I'm thinking this could be done by async functions that are passed to NextGraph API on start. Something like:
This way it would be the responsibility of ActivityPods to do the conversion, and eventually to fetch a remote resource to find its DID. It would be much easier than if we have to do it on the SPARQL query or the SPARQL results. Apart from WebID, we will also have a similar problems with the Pods root containers (eg. https://mypod.store/sro/data) If this transformation worked well, then we could even consider allowing LDP containers with custom paths (because I think if we don't allow this, it's going to be difficult to be really compatible with Solid apps). |
For the paths, we will see, I agree it would be cool to have them. But we have to work on it. About the problem of the https fetches, I still need to understand better the cases. I want to take again the example of an activity that arrives on your server, from another server (a mastodon instance by example) and it is the first time you receive an activity from such actor.
What do you do for now in APods, when you have to deal with "unknown" or "foreign" actors/webids ? I guess you fetch their URL first (dereference, follow your nose) and you store locally the triples about this webid (the public profile). Am I right? This way, you know all the "system" info about this actor (inbox, outbox, etc...). How can it be then, that a webid or actor appears somewhere in a resource/activity, without the server having known about it before? Please explain the cases when this happens, and how you deal with them for now in APods. |
No, anyone can send you a direct message through ActivityPub. It can also be a first request to follow you.
There is an infinite number of cases when we can see an unknown WebID or activity.
No we don't store the WebID locally. Why would we need to do that ? We store contact profiles because it makes it easier to list (and filter them) but this is only for performance reasons, we could also do without this. When we want to post an activity to someone, we fetch the WebID and find the inbox. We used to have some (Redis) caching for that, we will probably add it back in the future, but it's not a real performance issue at the moment.
I think you are reducing too much the usage of ActivityPub. There is really no way that we can know about all WebIDs or activities before hand. That's why we need some way to be able to find the DID of remote resources. My suggestion was one way to do it. Romain suggested to have some kind of "mapping servers" (like IPFS). I think both solutions could work and would allow a real bridge between NextGraph and the Fediverse. |
Thanks for the answers. I just asked questions in order to understand the use cases, not to "reduce" anything. About the solution to this issue, as we have said before, nextgraph needs to have all the information about the webid and the DID in the same URI. There were several solutions that popped up recently, but few are really addressing the issue. We cannot "scan" all the activities and replace the webid URIs in them, with a DID or append a DID to it, because we cannot know what is a webid and what is not. WebIds can come from anywhere, and can have any format. Also, they can appear anywhere in the triples. There is no way to detect them. What we are trying to deal with, in a specific edge case when :
The only way I see to deal with that case, is to have the DID be a part of all webIds that are coming from a server with NextGraph backend. Which form exactly should this URI containing both a "classical" webId and a DID, have, I don't really care. But both information has to be included in the same URI. I don't see yet why having a DID appended at the end of a webId is a problem for the normal functioning of both ActivityPods or any other ActivityPub server. I don't know all the internals and specs of ActivityPods nor ActivityPub in general. So I am just asking where would there be any problem with appending the DID at the end of the WebId. Let's consider this option please, and analyze together if it is doable or not. If it brings more problems to you, we will think again. But so far I didn't understand what exactly prevents us from appending a DID at the end of the WebId URI. BTW, adding the DID to the URI is exactly what this spec from ActivityPub is doing : So in any case, we can always default to that format. But I am not sure that using such scheme (ap://) would be good for all the Solid side of the problem. For the SOlid side, we can always add a
|
I'm not 100% sure if I understand the topic at discussion here. My second questions: @nikoPLP When you store a triple like |
Hello @Laurin-W thanks for joining us again on this topic! It is a bit complex, but I hope we will all be able to describe the problem accurately and find a solution that fits everybody. About the second question: That's for one part. Now the other problem that we haven't solved yet, is about WebId/Actor URLs. I find this solution simple. Please let me know what you see as problems that could prevent us from using this solution. About the readability of the WebId, I asked several times where this could be a problem. And the answer was: we use webfinger for all GUI related usernames, so the WebId does not appear in GUIs. So i don't know where the problem persists. Again, I don't know all the details of your protocols and use cases, so if I make a mistake or miss-understand something, please just explain me. And then when I was researching what others are doing regarding DID and Solid and AP, I found several specs, and we could also try to implement that later on. But that's just optional. it would provide some compatibility with other DID mechanism maybe... it isn't clear what would be the immediate benefit. We will have to see who is using DID in the Solid and AP world, and if we want to have some cross compatibility with that or not. |
The current TripleStoreService interacts directly with the Fuseki API. We will keep this service, but we will create another one which will interact with the NextGraph API and take into account its particularities (such as sessions handling, and URIs transformation)
https://git.nextgraph.org/NextGraph/nextgraph-rs/src/branch/master/ng-sdk-js/app-node/index.js
latestAccessTime
of each sessiondataset
will need to be the UUID provided by NextGraph so, for the AuthAccountService, we will need to store somewhere this UUID.The text was updated successfully, but these errors were encountered: