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

feat: SPARQL resource shape lookup #139

Merged
merged 10 commits into from
Aug 16, 2024
Merged

Conversation

tpluscode
Copy link
Contributor

@tpluscode tpluscode commented Aug 7, 2024

Copy link

changeset-bot bot commented Aug 7, 2024

🦋 Changeset detected

Latest commit: 5495078

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kopflos-cms/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

?subject ?property ?object .
}

VALUES ?resource { sh:this }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was surprised to find that this VALUES only work inside the query and not outside. Thus, the sh:this is replaced with the request URL

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, the query looks non-trivial, and I'm a bit concerned about its speed with large APIs. What about getting rid of VALUES and placing sh:this directly in all the needed places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it's doing replacement, might also do it that way.

Let's address this when it becomes a problem.

@@ -0,0 +1,95 @@
import type * as Oxigraph from 'oxigraph'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This modules exports im-memory oxigraph wrapped to match the interface of sparql-http-client

describe('lib/resourceShape', () => {
let options: KopflosConfig

beforeEach(createStore(import.meta.url, { format: 'trig' }))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Loads RDF from resourceShape.test.ts.trig and sets mocha graph and store properties to the mocha context.

The contents of the store/graph will be taken from a graph constructed from the test describe/context titles

Copy link

codecov bot commented Aug 10, 2024

Codecov Report

Attention: Patch coverage is 96.22642% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.52%. Comparing base (9516258) to head (5495078).
Report is 11 commits behind head on core-handler.

Files Patch % Lines
packages/core/lib/env/SparqlClientFactory.ts 92.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           core-handler     #139       +/-   ##
=================================================
+ Coverage              0   88.52%   +88.52%     
=================================================
  Files                 0       11       +11     
  Lines                 0      392      +392     
  Branches              0       26       +26     
=================================================
+ Hits                  0      347      +347     
- Misses                0       45       +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tpluscode tpluscode merged commit 9c4e101 into core-handler Aug 16, 2024
12 checks passed
@tpluscode tpluscode deleted the sparql-resource-lookup branch August 16, 2024 12:30
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.

2 participants