Skip to content

Closes #654. Support JSON-LD on SPARQL endpoints and RDF API routes #655

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

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

RickMoynihan
Copy link
Member

Note: The JSON-LD will not be prettified JSON-LD, it will necessarily be expanded JSON-LD.

Note: The JSON-LD will not be prettified JSON-LD, it will necessarily
be expanded JSON-LD.
Copy link
Contributor

@lkitching lkitching left a comment

Choose a reason for hiding this comment

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

The code changes look good to me, although I've added a question about some of the test organisation.
I ran this version locally in the drafter REPL and performed the following actions against the API:

  1. Created a new draftset
  2. Added data in trig format
  3. Fetched all the data in json-ld format
  4. Fetched all data within a single graph in json-ld format
  5. Submitted a CONSTRUCT query requesting json-ld to the draftset SPARQL endpoint
  6. Published the draftset
  7. Submitted a CONSTRUCT query requesting json-ld to the live SPARQL endpoint

All of these stages resulted in the expected results.

;; NOTE: query may return statements from system graphs which should be ignored
(is (set/subset? expected-triples response-triples))))

(testing "application/ld+json"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these two tests be replaced with a loop over the available content types? They appear to be otherwise identical and we could extend it to cover all supported formats.

@lkitching
Copy link
Contributor

I've created issue #656 to discuss refactoring the tests to cover all supported content types.

@RickMoynihan
Copy link
Member Author

Ahh yes I did consider refactoring it to do something like that too. I decided not to do it here, but also because the test errors you get when you're looping over variations make debugging a bit more awkward. Still I think it would be worth doing #656.

Will merge, thanks 🙇

@RickMoynihan RickMoynihan merged commit f322b90 into master Mar 2, 2023
@scottlowe scottlowe deleted the json-ld2 branch April 21, 2023 20:41
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