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

Add support for parsing more RDF formats using rdf-parse #84

Merged

Conversation

rubensworks
Copy link
Contributor

A simple addition that allows us to automatically parse all major RDF formats: https://github.com/rubensworks/rdf-parse.js#rdf-parse

return this.turtleToQuads(input.representation, input.identifier.path);
}

private turtleToQuads(representation: Representation, baseIRI: string): Representation {
Copy link
Member

Choose a reason for hiding this comment

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

Probably should also rename the function then.

Comment on lines 31 to 33
...representation.metadata.contentType ?
{ contentType: representation.metadata.contentType } :
{ path: baseIRI },
Copy link
Member

Choose a reason for hiding this comment

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

checkRequest in the canHandle call above is going to error if there is no contentType so you can assume it exists. The Solid spec currently says to reject PUT/POST/PATCH without content-type as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh ok, that makes our lives easier here :)

Comment on lines 39 to 41
data = errorStream;
setImmediate((): boolean => data.emit('error',
new UnsupportedHttpError('Could not find a valid content type or known file extension.')));
Copy link
Member

Choose a reason for hiding this comment

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

If this catch can only occur when there is no content-type I would also drop this part then (since it means there is an internal server problem if we get to this point).

@RubenVerborgh
Copy link
Member

Should we drop Generic from the name?

@joachimvh
Copy link
Member

Should we drop Generic from the name?

Yea would probably be better.

@rubensworks
Copy link
Contributor Author

Should we drop Generic from the name?

Done :)

@joachimvh
Copy link
Member

Done :)

You forgot to edit the class name 😅

@rubensworks
Copy link
Contributor Author

Heh, for some reason my webstorm didn't apply all changes...
Should be better now.

@joachimvh joachimvh merged commit e88e680 into CommunitySolidServer:master Aug 31, 2020
@rubensworks rubensworks deleted the feature/rdf-parse branch August 31, 2020 10:05
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.

None yet

3 participants