codemeta / codemeta-generator

This repository contains a (client-side) web application to generate Codemeta documents (aka. codemeta.json).
https://codemeta.github.io/codemeta-generator/
GNU Affero General Public License v3.0
8 stars 5 forks source link

Generate expanded jsonld document version from form to use for validation #29

Open hjonin opened 5 months ago

hjonin commented 5 months ago
          Ah, indeed. Eventually we should make the main code generate the expanded value directly, but let's keep this for a future PR.

_Originally posted by @progval in https://github.com/codemeta/codemeta-generator/pull/27#discussion_r1521318968_

Now that we are using jsonld.jd to generate the codemeta document, we could also generated the jsonld expanded version of the document directly from the form fields and then work with the expanded document.

progval commented 5 months ago

(for future readers:) we only mean this for the internal representation; the output should remain the compacted form

hjonin commented 5 months ago

On it

hjonin commented 5 months ago

work with the expanded document

means update https://github.com/hjonin/codemeta-generator/blob/3c76b4b876df2de62e6f88eaeedc1bdfa0437a03/js/validation/index.js#L16

function validateDocument(doc) {

to take the expanded version for input.

(cf. https://github.com/codemeta/codemeta-generator/pull/34#issuecomment-2037567071)