Do you store your data as RDF? If yes, the structure of your knowledge graph may matter equally or more than your document structure.
You may need to be somewhat familiar with linked data and knowledge graphs first…
Solid doesn’t have any query API standardized. No SPARQL, nor Linked data fragments endpoints that you could count on. So while you can probably make or extend Solid Pods with such functionality, in general you can’t rely on its existence.
Closest we have to this are type indexes. Special documents in which we keep info about what kind of data can be found in what locations. (You or your app has to keep it manually updated and in sync, which is a bit troublesome.) For example you would say in that document, my data about medicines are in here and here and here. That may be a viable starting point for your search.
To answer such question you would need to have a list of your countries somewhere, and find Vietnam among them. (it will have its own uri). Perhaps in the same document or in some linked document you could have relations
(Vietnam uri) -- isCountryOfMedicine --> (medicine uri). If you fetch each medicine’s uri, you could locate all its warnings like
(medicine uri) -- hasWarning --> (warning uri),
(warning uri) -- hasDescription --> "description", and filter all fetched descriptions for the string you want, and thus answer the question.
I think this way of querying is called to follow your nose. It’s much slower than having a single database with indexes like with SQL.
If each user doesn’t have much data, you may fetch everything from medicine folders first, and query in client.
There are people who made much more in-depth thinking about these questions than me, for example @RubenVerborgh, @rubensworks and others. The website of Ruben Verborgh has interesting reading. There was article and talk about generalized querying over distributed linked data on that website and on Solid World, but i can’t locate it right now. Maybe somebody else can provide links?
With this approach, most of the querying work will be done by the client - your app + libraries like Comunica or LDO or rdflib. Not on the solid pod, which is pretty dummy in this regard.
If you have big data and these approaches are not satisfying, you could consider building a separate service for indexing. You could keep track of your medicine relationships there, or of fulltext of your warnings… and they would help you locate documents with more details on Solid Pods. but i’m not sure. Maybe somebody else can enlighten us more about this…
You may also use multiple approaches together.
In any case, you can start with well-structured knowledge graph with linked data.
it would be lovely to have some standardized querying api in solid pods (i root for LDF), but we don’t, and it is what it is for now…