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

merge sparql endpoints #127

Merged
merged 15 commits into from
Jun 22, 2023
Merged

Conversation

recalcitrantsupplant
Copy link
Collaborator

@recalcitrantsupplant recalcitrantsupplant commented Jun 15, 2023

update sparql functions
update tests
add otherAnnotationProps to annotations
remove startup graph posting

update sparql functions
update tests
add otherAnnotationProps to annotations
remove startup graph posting
…ts in SPARQL queries, so exclude from the query if there are no terms.
Remove sequence path for sh:color
Upudate env template
@recalcitrantsupplant
Copy link
Collaborator Author

Could I please get a fairly comprehensive review of this as the changes are significant and breaking. In particular testing with the frontend. I have tested visually with the FE.

@recalcitrantsupplant recalcitrantsupplant marked this pull request as ready for review June 16, 2023 02:17
@recalcitrantsupplant
Copy link
Collaborator Author

I've just noticed /object is not working - will fix later today. This shouldn't block others reviewing the changes.

Remove relative properties functionality - path/sequence path functionality has been extended to listing queries
…/narrower is a bit blunt. It includes a lot of unintended annotations as it applies at the profile level. The only other option would be to interpret a combination of sequence and inverse path as concepts are skos:inScheme the focus node (inverse path), and the additional properties we want on them (broader, narrower) are two steps away from the focus node. This is trivial in SPARQL but probably requires more careful design in SHACL.
@recalcitrantsupplant
Copy link
Collaborator Author

Resolves #115 .
Resolves #115 .
Resolves #124 NB addition of /tbox-cache endpoint which shows the tbox cache; also fix of /purge-tbox-cache endpoint. Persistence/reading of cache on shutdown/startup removed.

Copy link
Member

@nicholascar nicholascar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was great fun to review: I was worried about the shear number of files but I got through them quickly since it's mostly code removal and simplification! Also, I'm thrilled to see your really neat functions and bonus documentation @recalcitrantsupplant! Great PR.

Copy link
Collaborator

@edmondchuc edmondchuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phew, finished! Looks good, just left some minor comments in there. I'll run it with prez-ui and test it tomorrow. Should be good to go shortly after that.

demo/docker-compose.yml Outdated Show resolved Hide resolved
prez/config.py Outdated Show resolved Hide resolved
prez/config.py Outdated Show resolved Hide resolved
prez/routers/search.py Outdated Show resolved Hide resolved
prez/sparql/methods.py Outdated Show resolved Hide resolved
@edmondchuc
Copy link
Collaborator

@edmondchuc
Copy link
Collaborator

This line needs to be removed.

"GenericPrez",

prez/sparql/methods.py Outdated Show resolved Hide resolved
@edmondchuc
Copy link
Collaborator

I think the last thing is to remove prez_type=GenericPrez on line 70 and GenericPrez on line 80 in

prez_type="GenericPrez",
prof_and_mt_info=prof_and_mt_info,
)
profile_query = generate_item_construct(profiles_item, prof_and_mt_info.profile)
profile_graph = profiles_graph_cache.query(profile_query).graph
return await return_from_graph(
profile_graph,
prof_and_mt_info.mediatype,
prof_and_mt_info.profile,
prof_and_mt_info.profile_headers,
"GenericPrez",
.

@edmondchuc
Copy link
Collaborator

Once you've made that change in the last comment, I'll do one last test and distill the changes into dot points here so we can paste it into the release notes.

@recalcitrantsupplant
Copy link
Collaborator Author

Thanks - removed now

@edmondchuc
Copy link
Collaborator

edmondchuc commented Jun 22, 2023

Fixes

Changes

  • Prez is now read-only for a given SPARQL endpoint
    • Prez no longer loads vocabularies to the SPARQL store on startup and instead loads it into an in-memory graph object
  • Simplified docker-compose local setup
  • Prez no longer persists the in-memory graph cache to disk. Each Prez restart now starts in a deterministic state with a clean cache
  • No longer uses base URL in HTTP client and as a result, no longer adds a trailing / to the URL of the requests made using the HTTP client
  • For search, invalid search_methods values now returns a HTTP status code of 400
  • SPARQL proxy endpoint filters out the Host header and sets it to the base URL of the target SPARQL endpoint

Added

  • Extends annotation functionality to SPARQL queries. SPARQL queries sent to prez's SPARQL endpoint with +anot in their mediatypes (e.g. text/anot+turtle) will include annotations in the results. Currently only applied to CONSTRUCT queries. Annotations are not included/counted towards LIMIT clauses.
  • HTTP endpoint to clear in-memory graph cache
  • HTTP endpoint to view in-memory graph cache
  • Documentation for Prez annotation properties
  • Documentation for common Prez environment variables

Breaking

  • SPARQL endpoints for each subsystems have been consolidated into one
  • SPARQL Update and SPARQL HTTP Store support dropped
  • Environment variables for SPARQL related config removed and simplified
    • SPARQL_ENDPOINT
    • SPARQL_USERNAME
    • SPARQL_PASSWORD

@recalcitrantsupplant do you agree with this list?

@edmondchuc
Copy link
Collaborator

One last thing, can you fix the formatting for the documentation section on annotation properties please? See https://github.com/RDFLib/prez/blob/798be47cdf185cc10d2078db1de40f7fb2e1831f/README-Dev.md#annotation-properties.

@recalcitrantsupplant
Copy link
Collaborator Author

Cheers, I've edited your comment to include info on "annotated SPARQL queries" under Added, and fixed the markdown table.

Copy link
Collaborator

@edmondchuc edmondchuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good now. Thanks @recalcitrantsupplant for addressing my comments.

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 this pull request may close these issues.

3 participants