icaruseu / mom-ca

Monasterium.net (http://www.monasterium.net/mom) - repository and collaborative archive
https://github.com/icaruseu/mom-ca/wiki
GNU General Public License v3.0
17 stars 11 forks source link

add validation of SKOS files to SKOS-Editor #1139

Open NTsch opened 1 year ago

NTsch commented 1 year ago

This adds a service to the SKOS-Editor app which uses schema files to assure before publication that the SKOS-file which is being edited is valid and has all the necessary elements to be correctly displayed in the index view. This is done using the already existing data:validate function. When the user clicks on the "Publish" button in the editor, the service either returns the error message from the validation report, or publishes as usual if there are no problems.

This closes #1117.

StephanMa commented 1 year ago

I am currently not sure why you need the xml.xsd... and why "xml"? Isn't RDF and SKOS not XML?

NTsch commented 1 year ago

I am currently not sure why you need the xml.xsd... and why "xml"?

That's imported so that the xml:lang attribute which appears in the skos.xsd doesn't cause an error. There may be a better solution for this?

StephanMa commented 1 year ago

declare the namespace upfront should fix the error

NTsch commented 1 year ago

declare the namespace upfront should fix the error

I've tried both adding xmlns:xml="http://www.w3.org/XML/1998/namespace" in the root (xs:schema) and replacing <xs:attribute ref="xml:lang"/> with <xs:attribute name="lang" xmlns:xml="http://www.w3.org/XML/1998/namespace"/>, but in both cases I still get an error.

GVogeler commented 1 year ago

As far as I know, dchema definitions need to include all parts, i.e. if the schema imports attributes from the XML namespace the simple namespace reference is insufficient.

StephanMa commented 1 year ago

I See... I really really dislike this approach... but it seems to be the only way to deal with this

StephanMa commented 1 year ago

@NTsch Can you provide me with a short introduction how to test this?

StephanMa commented 11 months ago

@NTsch push

NTsch commented 10 months ago

@NTsch Can you provide me with a short introduction how to test this?

Make a copy of a glossary (-> /mom/index/IllUrkGlossar -> "Create personal copy"), then open it in the editor (MyArchive -> Saved Vocabularies -> Open Vocabulary in SKOS-Editor). There you can create Concepts and properties like prefLabel. If you try to publish when there's a Concept that doesn't have a prefLabel, you should get an error, otherwise it should publish normally.