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

Use type inference for type index traversal #49

Open
rubensworks opened this issue Mar 15, 2022 · 2 comments
Open

Use type inference for type index traversal #49

rubensworks opened this issue Mar 15, 2022 · 2 comments

Comments

@rubensworks
Copy link
Member

rubensworks commented Mar 15, 2022

Issue type:

  • ➕ Feature request

Description:

The following query makes use of the Solid type index to detect that is should follow (and prioritize) a link to the bookmarks file:

https://comunica.github.io/comunica-feature-link-traversal-web-clients/builds/solid-default/#transientDatasources=https%3A%2F%2Frubensworks.solidcommunity.net%2Fprofile%2Fcard&query=PREFIX%20bookm%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F01%2Fbookmark%23%3E%0ASELECT%20*%20WHERE%20%7B%0A%20%20%3Fbookmark%20a%20bookm%3ABookmark%3B%0A%20%20%20%20bookm%3AhasTopic%20%3Ftopic.%0A%7D

Currently, our actor implementation depends on the presence of the ?bookmark a bookm:Bookmark pattern before it is able to detect that the type index entry for the class bookm:Bookmark should be used.

Since the query also contains the pattern ?bookmark bookm:hasTopic ?topic, it should be possible to implicitly infer this ?bookmark a bookm:Bookmark triple, since the bookm:hasTopic predicate implies that the subject is of type bookm:Bookmark.

So concretely, it should be possible to execute

PREFIX bookm: <http://www.w3.org/2002/01/bookmark#>
SELECT * WHERE {
  ?bookmark bookm:hasTopic ?topic.
}

and get the same results as we currently do with

PREFIX bookm: <http://www.w3.org/2002/01/bookmark#>
SELECT * WHERE {
  ?bookmark a bookm:Bookmark;
    bookm:hasTopic ?topic.
}

Additionally, rdfs:subClassOf should also be considered, both via predicates, and via explicit types in the query.
For example, if bookm:Bookmark rdfs:subClassOf ex:Thing, and we have a type index entry for ex:Thing, then the usage of the bookm:hasTopic predicate should also result in the ex:Thing type index entry to be considered.

@github-actions
Copy link

Thanks for the suggestion!

@rubensworks rubensworks changed the title Use type inference for type index pruning Use type inference for type index traversal Mar 15, 2022
@rubensworks
Copy link
Member Author

This has been implemented in https://github.com/comunica/comunica-feature-link-traversal/tree/master/packages/actor-extract-links-solid-type-index, but has not been evaluated yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant