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

Store - Call to the simplest method getResources(namedGraph, clazz) gets a whole graph first #254

Open
jadelkhoury opened this issue Feb 16, 2022 · 5 comments
Assignees
Labels
Milestone

Comments

@jadelkhoury
Copy link
Contributor

getResources(final URI namedGraph, final Class clazz) calls modelFromQueryFlat(namedGraph), which ultimatly calls the following SPARQL query. This query simply gets the whole graph, only to filter the classes in code.
DESCRIBE ?s WHERE { GRAPH <http://...> { ?s ?p ?o } }

Replace the call to use same methods as all other getResources() methods?

@jadelkhoury jadelkhoury self-assigned this Feb 16, 2022
@jadelkhoury
Copy link
Contributor Author

@berezovskyi ! I can do the fix, but want to hear your thoughts first (Since you wrote this stuff originally).

@berezovskyi
Copy link
Member

I think that method was to get all resources specifically without doing any paging. Sadly, I wrote it before we added querying to the Store, so that part is missing. But I don't think that paging makes sense here.

@berezovskyi
Copy link
Member

The reason the whole graph is fetched is because we may want to get all instances of a klass and its subclasses. We can of course try to traverse the class hierarchy first and get the union of all rdf type annotations to scope the rdf type of the subjects in the query.

@berezovskyi
Copy link
Member

berezovskyi commented Feb 17, 2022

And as Eike mentioned on the forum, the patch from Koneksys to JMH now may have changed the semantics, potentially returning resource instances that are not related to the klass at all, which we should certainly investigate.

@berezovskyi
Copy link
Member

To add, the JMH change may require us to add a method like

Collection<IExtendedResource> unmarshallModel(Model m)

And maybe revert the semantics on the old methods, never returning instances of any class that is not assignable to a klass.

@berezovskyi berezovskyi added this to the 5.1 milestone May 9, 2022
@berezovskyi berezovskyi modified the milestones: 5.1, 5.x May 19, 2022
@berezovskyi berezovskyi modified the milestones: 5.x, 7.x Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants