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

refactor(gravsearch): Simplify filtering of incoming links #1632

Open
benjamingeer opened this issue Mar 19, 2020 · 0 comments
Open

refactor(gravsearch): Simplify filtering of incoming links #1632

benjamingeer opened this issue Mar 19, 2020 · 0 comments
Assignees

Comments

@benjamingeer
Copy link

In #1626 (comment), we found that we rely on MainQueryResultProcessor.getRequestedValuesFromResultsWithFullGraphPattern to prevent extra incoming links in a query like this:

PREFIX incunabula: <http://0.0.0.0:3333/ontology/0803/incunabula/simple/v2#>
PREFIX knora-api: <http://api.knora.org/ontology/knora-api/simple/v2#>

CONSTRUCT {
    ?region knora-api:isMainResource true .
    ?region knora-api:isRegionOf ?page .
    ?page knora-api:isPartOf ?book .
    ?book incunabula:title ?title .
} WHERE {
    ?region a knora-api:Region .
    ?region knora-api:isRegionOf ?page .
    ?page a incunabula:page .
    ?page knora-api:isPartOf ?book .
    ?book a incunabula:book .
    ?book incunabula:title ?title .
    FILTER(?title = "Zeitglöcklein des Lebens und Leidens Christi")
}

Here we get four regions on different pages in the same book. Without MainQueryResultProcessor.getRequestedValuesFromResultsWithFullGraphPattern, all the links from all pages to the book show up as incoming links each time the book appears as a dependent resource in the response to the API request. This is because ConstructResponseUtilV2.splitMainResourcesAndValueRdfData doesn't consider the response tree structure when it starts constructing link values for incoming links. It would be better to handle this logic in ConstructResponseUtilV2.splitMainResourcesAndValueRdfData; then we could get rid of MainQueryResultProcessor.

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

No branches or pull requests

2 participants