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

WIP: Fetching triples from a JSON-LD document #430

Closed
wants to merge 2 commits into from

Conversation

angelo-v
Copy link
Contributor

I added a failing test for a problem I observed fetching data from JSON-LD documents. The PR does not include a fix yet. Reviews, if the test actually uncovers a bug that needs fixing are welcome. The same is true for ideas how to fix.

beforeEach(() => {
const docContents = `
{
"@id": ${uri},

Choose a reason for hiding this comment

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

There's a small typo here:

Suggested change
"@id": ${uri},
"@id": "${uri}",

I haven't run the test, but if it passes now, then maybe the issue you were facing was #408?
Note also that another bug caused jsonld errors to be suppressed: #435

I've added some annotations to the relevant commit 16daad7#r41313390

Choose a reason for hiding this comment

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

Or is there a separate issue related to fetching, like in #343?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Fixed the syntax. But test is still failing for the same reason. I think the issue is in the fetching / response handling.

There is just no default handler for JSON-LD?

const defaultHandlers = {
  RDFXMLHandler, XHTMLHandler, XMLHandler, HTMLHandler, TextHandler, N3Handler
}

@angelo-v angelo-v marked this pull request as draft August 24, 2020 15:41
@michielbdejong
Copy link
Collaborator

This also makes NSS fail the content negotiation tests I'm adding in solid-contrib/solid-crud-tests@9d4928b

@michielbdejong
Copy link
Collaborator

I'll see what I can do to try to fix this bug.

@michielbdejong
Copy link
Collaborator

Indeed it cannot find a JSON-LD handler, these are my debug statements from handlerForContentType:

handle response application/ld+json
checking pattern /application\/rdf\+xml/ null
checking pattern /application\/xhtml/ null
checking pattern /(text|application)\/(.*)xml/ null
checking pattern /text\/html/ null
checking pattern /text\/plain/ null
checking pattern /(application|text)\/(x-)?(rdf\+)?(n3|turtle)/ null
no handler

@michielbdejong
Copy link
Collaborator

Continued in #439

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