science-periodicals / ontology

:mortar_board: sci.pe (science periodicals) extension of schema:ScholarlyArticle to describe the production process, content, distribution and preservation of scholarly articles (and similar artifacts).
http://ns.sci.pe
Apache License 2.0
4 stars 0 forks source link

Rename to article.json #6

Closed darobin closed 9 years ago

darobin commented 9 years ago

Would it be a problem to rename article.jsonld to article.json?

The reason I ask is because if we used the latter, index.js could just require('./article.json') and export the return value directly instead of needing fs, path, and JSON. This doesn't seem like much, but in turn it requires brfs and a bunch of other things. This leads the browserified version to be 65K — roughly ten times the size of its useful payload.

Conversely, if the browserified version is not needed, we could drop it.

transcranial commented 9 years ago

If I'm reading this right, should be fine? http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld

darobin commented 9 years ago

No, that's unrelated. It offers a way of interpreting JSON-LD as JSON using a specific HTTP header.

What defines whether it is fine or not is largely whether it is expected to be served over the web with the correct media type, that sort of consideration.

sballesteros commented 9 years ago

just saw that +1 with me did not realize that brfs was adding so much overhead

darobin commented 9 years ago

We've just gone from an overhead of 56.5K to one of 0.6K (unminified); I reckon that's a win :)

Note: I just thought that if we need this served over the Web with the right media type, we could add it to @scienceai/resource and force the correct type in code there.