Git Product home page Git Product logo

pds4validate's People

Contributors

rbeyer avatar

Watchers

 avatar

pds4validate's Issues

FYI for existing validation methods (not an issue)

I ran across this repo looking at hiproc. In general, I do simply recommend using the PDS Engineering supported validate routine. Not only does it check validation based using PDS4 schemas, but also has support for Schematron v2 rules (rare to find outside of commercial applications like Oxygen). Lastly, it has some extra validation for PDS4 and actually can look into the data files for simple testing (image or tables). Now that check can be turned off to speed things up.

Anyway, I have an old email (circa 2017) from Even R. when he first implemented PDS4 in GDAL which shows a trick method in GDAL to provide simple validation (not full Schematron v2 though). But he also located a free method to help with Schematron v2 as listed in the second section below. I have never tested that method and it seems like using several schema files would be problematic as the bash script is currently written. Anyway, if you are running JAVA for saxonb-xslt, you might as well run the PDS4 validate app.

[Trent] We don't plan for GDAL to have any sort of schema validation method, but what application do you use?


[Even] You can validate any XML document that references its schemas, like a PDS4 .xml label, using (or perhaps abusing !) the new GMLAS driver

For example:

ogrinfo GMLAS:PDS4_label_test.xml -oo VALIDATE=YES >/dev/null

windoze:

ogrinfo GMLAS:PDS4_label_test.xml -oo VALIDATE=YES > NUL

The first run will take some time, downloading schemas and caching them in ~/.gdal/gmlas_xsd_cache. If the above command doesn't output anything, then the document validates. Underneath this is the Xerces-C validator which is used.


[Even] Note that Schematron validation is not done. As far as I could find, for open source software, there are only Java based solutions that can deal with Schematron v2.

On Ubuntu 16+,

sudo apt-get install libsaxonb-java

#!/bin/sh
set -e
saxonb-xslt -s:$1 -xsl:iso_dsdl_include.xsl -o:stage1.sch
saxonb-xslt -s:stage1.sch -xsl:iso_abstract_expand.xsl -o:stage2.sch
saxonb-xslt -s:stage2.sch -xsl:iso_svrl_for_xslt2.xsl -o:test.xsl
saxonb-xslt -s:$2 -xsl:test.xsl -o:report.svrlt
cat report.svrlt 
  • then run

validate.sh your.sch PDS4_label_test.xml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.