Validating capabilities document

Patrick Dowler patrick.dowler at nrc-cnrc.gc.ca
Fri Mar 8 09:52:49 PST 2013


Hi Mark,

There is a parser in OpenCADC that puts together all the necessary 
schema files to parse a tap capabilities document. The code for that is:

http://code.google.com/p/opencadc/source/browse/trunk/projects/cadcTAP/src/ca/nrc/cadc/vosi/TAPRegExtParser.java

You would have to navigate a bit inside there (and in the cadcVOSI 
module) to find the names of all the files since they are declared as 
constants.

Our approach is to include our own copy of the xsd files in the the jar 
files and then find them as resources. We also enabled the xerces 
grammar cache so the xsd didn't have to be read and parsed for every 
document as that is also pretty expensive. That happens incide the 
XmlUtil class (part of cadcUtil module). For any module that has a copy 
of an external xsd I just have a test that downloads and compares my 
copy to the canonical one so I can detect any divergence, but I think 
this is the only sensible way to actually use the xsd files.

To use that code you would need cadcUtil, cadcVOSI, and cadcTAP so you 
probably don't want to do that, but it would be instructive. The class 
above is what I use to validate my own capabilities doc during testing.

Pat

On 03/08/2013 02:25 AM, Mark Taylor wrote:
> Hi GWS,
>
> I want (for the purposes of TAP service validation) to validate a
> TAP Capabilities document, for instance
>
>     http://dc.g-vo.org/tap/capabilities
>
> against the appropriate schema.  But I don't know how to get a
> suitable XSD document.  I tried looking at
>
>     http://www.ivoa.net/xml/VOSICapabilities/v1.0
>
> since it's the target namespace and in most cases for IVOA schemas
> the XSD can be found there.  However that's a 404.
>
> I also tried cut'n'pasting the schema from Appendix A of the VOSI
> standard, but it doesn't work very well, for reasons I haven't tried
> very hard to understand.
>
>     Validating http://dc.g-vo.org/tap/capabilities against file:/data/andromeda1/starjava/source/ttools/build/classes/uk/ac/starlink/ttools/taplint/VOSICapabilities-v1.0.xsd
>     cvc-elt.4.2: Cannot resolve 'tr:TableAccess' to a type definition for element 'capability'.
>     cvc-elt.4.2: Cannot resolve 'vs:ParamHTTP' to a type definition for element 'interface'.
>     cvc-type.2: The type definition cannot be abstract for element interface.
>     cvc-complex-type.2.4.a: Invalid content was found starting with element 'dataModel'. One of '{"":interface}' is expected.
>     cvc-elt.4.2: Cannot resolve 'vs:ParamHTTP' to a type definition for element 'interface'.
>     cvc-type.2: The type definition cannot be abstract for element interface.
>     cvc-elt.4.2: Cannot resolve 'vs:ParamHTTP' to a type definition for element 'interface'.
>     cvc-type.2: The type definition cannot be abstract for element interface.
>     cvc-elt.4.2: Cannot resolve 'vs:ParamHTTP' to a type definition for element 'interface'.
>     cvc-type.2: The type definition cannot be abstract for element interface.
>
> any ideas?
>
> thanks
>
> Mark
>
> --
> Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
> m.b.taylor at bris.ac.uk +44-117-9288776  http://www.star.bris.ac.uk/~mbt/
> .
>

-- 

Patrick Dowler
Canadian Astronomy Data Centre
National Research Council Canada
5071 West Saanich Road
Victoria, BC V9A 2L9

250-363-0044 (office) 250-363-0045 (fax)


More information about the grid mailing list