-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add support for parsing more RDF formats using rdf-parse #84
Conversation
return this.turtleToQuads(input.representation, input.identifier.path); | ||
} | ||
|
||
private turtleToQuads(representation: Representation, baseIRI: string): Representation { |
There was a problem hiding this comment.
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.
...representation.metadata.contentType ? | ||
{ contentType: representation.metadata.contentType } : | ||
{ path: baseIRI }, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
data = errorStream; | ||
setImmediate((): boolean => data.emit('error', | ||
new UnsupportedHttpError('Could not find a valid content type or known file extension.'))); |
There was a problem hiding this comment.
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).
1220f13
to
76d2f69
Compare
Should we drop Generic from the name? |
Yea would probably be better. |
Done :) |
76d2f69
to
8b64c2e
Compare
You forgot to edit the class name 😅 |
Heh, for some reason my webstorm didn't apply all changes... |
8b64c2e
to
8fbe9ee
Compare
A simple addition that allows us to automatically parse all major RDF formats: https://github.com/rubensworks/rdf-parse.js#rdf-parse