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

Ability to programmatically POST a HTML/JSON file for linting? #48

Open
pdehaan opened this issue Sep 9, 2019 · 3 comments
Open

Ability to programmatically POST a HTML/JSON file for linting? #48

pdehaan opened this issue Sep 9, 2019 · 3 comments

Comments

@pdehaan
Copy link

pdehaan commented Sep 9, 2019

Re: "Programatic Access to the Linter" (http://linter.structured-data.org/about/),

The docs say:

To do this, construct an HTTP GET request using the Accept: application/json HTTP header with a url query parameter referencing the page to be processed.
curl -H 'Accept: application/json' http://linter.structured-data.org/?url=http://linter.structured-data.org/

Is there a way to do a POST request with an HTML string to be processed? I have a bunch of .jsonld files locally that I need to try linting, but they aren't online. Having the ability to POST a request would let me wrap the .jsonld files in a <script>...</script> tag and validate them easily using Node.

@gkellogg
Copy link
Member

gkellogg commented Sep 9, 2019

I think you can do POST as well.

A better way would be to install the "linkeddata" ruby gem and use the "rdf" command line interface, such as "rdf lint http://example.org/example.jsonld", or a local file. The linter is implemented on top of the RDF Reasoner, which is exposed through the CLI.

@pdehaan
Copy link
Author

pdehaan commented Sep 9, 2019

Yeah, the problem was that I was trying to use this via Node.js, so having to install Ruby would be non-trivial in this case.

But I'll play around w/ POST and see if I can figure out how to send the payload. Thanks!

@gkellogg
Copy link
Member

I would caution against overusing the service, as it’s hosted on a free Heroku dyno, and could become overwhelmed. You could consider self-hosting a copy of the service for more intense usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants