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

Efficient Queries #38

Closed
twalmsley opened this issue Jul 29, 2022 · 1 comment · Fixed by #42
Closed

Efficient Queries #38

twalmsley opened this issue Jul 29, 2022 · 1 comment · Fixed by #42
Assignees

Comments

@twalmsley
Copy link
Collaborator

twalmsley commented Jul 29, 2022

MagmaCore (MC) will store some complex data models and there is a need to do complex queries to traverse the model and return results. There is no exported way of doing this at present, so clients of MC need to make repeated requests for objects and traverse links manually before fetching the next object[s] in the chain which is very inefficient.

One option is to expose a SPARQL query service and let clients run arbitrary queries, then parse the results themselves, but this solution puts a lot of the burden on clients and multiple clients may end up implementing different solutions to the same problem.

Another solution is to provide some canned queries based on client requirements. These are some of the queries that I need for my application which are fairly general and could be implemented as canned queries in MC:

  1. Find objects of a certain rdf:type and member_of_kind and the sign values conforming to a pattern that represent those objects at a pointInTime. Use Cases:
    • List users and their usernames,
    • list roles and their role names,
    • list books and their titles, etc..
  2. Find the individuals represented by a given sign value at a pointInTime. Use Cases:
    • Find user by username,
    • find book by ISBN, etc..
  3. Find the individuals, their signs values and their roles in associations that are member_of_kind of a particular kind_of_association at a pointInTime. Use Cases:
    • List books and their authors,
    • list users and their roles,
    • list blog posts and their authors.
  4. Find the objects associated to a particular individual, their signs values and their roles in associations that are member_of_kind of a particular kind_of_association at a pointInTime. Use Cases:
    • List commenters on a specific blog post,
    • list friends of a specific person,
    • list departments in a specific organisation.
  5. Find the parts of a given individual and their parts up to n levels deep along with the sign values that represent them. Use Cases:
    • Find a tree of objects such as a taxonomy
    • Find the department structure of an organisation.

There are probably many more, but these would be a very useful starting point and would hopefully be useful to other clients.

@twalmsley twalmsley self-assigned this Jul 29, 2022
@twalmsley
Copy link
Collaborator Author

This issue will also update the "find participant details" and the "find by sign" services to use SPARQL so that they will be more efficient.

@twalmsley twalmsley linked a pull request Aug 12, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant