skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
34 stars 25 forks source link

Webpack Error Schema Construction Fix #176

Closed dchoi127 closed 2 years ago

dchoi127 commented 2 years ago
Screen Shot 2022-03-29 at 9 03 36 AM

When running "npm run build" this error would occur, terminating the schema construction. After a bit of tampering, I managed to find a solution by changing a line in the src/common.js file.

To recreate the issue, download the helminths.ttl file here: https://github.com/dchoi127/skohub-vocabs/blob/master/data/helminths.ttl

To resolve the issue, look here: https://github.com/dchoi127/skohub-vocabs/commit/0edaede947bc9c962374e056ec2e7114bb584811

With my limited understanding of this issue, I believe this has to do with the localized array not existing for "helminths". This becomes clear when viewing the webpage after running "npm run develop". All the pages appear to work except [lod.nal.usda.gov/nalt-helminths.en.html] which triggers an unhandled runtime error. I believe it's due to the fact that "helminths" is treated as a concept although the localized array does not exist. The changes I implemented adds an additional null check to ensure localized cannot be null. With these changes, the webpage now builds with no errors. Are there any foreseeable problems with the changes to src/common.js?

acka47 commented 2 years ago

Hi @dchoi127, thanks for your report. The problem is that SkoHub currently expects the name fo a ConceptScheme to be provided with dct:title not skos:prefLabel. Copying the file into my test repo and adjusting this (https://github.com/acka47/hcrt/commit/7103825c66997df2dd38f3584a9e1aa647b85bfc) made the build run, see https://skohub.io/acka47/hcrt/heads/master/lod.nal.usda.gov/nalt-helminths.en.html.

(We still have an issue open to enable an easy check whether a vocab is "SkoHub-ready", see #91 .)

tombaker commented 2 years ago

Hi @acka47 I provided the ConceptScheme with a dcterms:title alongside the existing rdfs:label (not skos:prefLabel) and it built correctly.

Is there a list of criteria (if only bullet points) in the code or documentation for "SkoHub-ready" concept schemes?

acka47 commented 2 years ago

Is there a list of criteria (if only bullet points) in the code or documentation for "SkoHub-ready" concept schemes?

Unfortunately, not. It's currently best to take orientation from examples. I collected some for the SkoHub booth at SWIB21: https://pad.gwdg.de/s/skohub-booth-at-swib21#Example-Vocabs

I know, we have to work on the documentation and I will try to address this in the course of this year. (A related issue is #174 .)

acka47 commented 2 years ago

@dchoi127 Please close the issue if your problem is resolved.

dchoi127 commented 2 years ago

Problem was resolved. Thank you!