2015-05-27T12:36:00
500
Validator for IVOA Identifiers
A validator for IVOA identifiers, checking
conformity to version 2 of the specification.
The service returns results in a tabular format, where an identifier is
valid if no row with msg_type="ERROR" is present.
As per DALI, the format of the table returned can be controlled
through the RESPONSEFORMAT parameter; for machine consumption, the
most useful values for that parameter are probably json and votable.
The code used here is available at
http://svn.ari.uni-heidelberg.de/svn/gavo/hdinputs/ivoidval
virtual-observatories
Markus Demleitner
ivoid val
IVOA identifers without query or fragment ("Registry reference")
must resolve to
Registry records. For instance,
:genparam:`uri(ivo://org.gavo.dc/ivoidval/q/val)` is the (valid) ivoid of
this service.
A Registry reference like :genparam:`uri(ivo://example.org/does/not/exist)`
is invalid because it does not resolve to a record in the VO
Registry.
:genparam:`uri(ivo://example.org/%64oes/not/exist)`
is not an IVOID as percent-encoding is not allowed in either
authority or the resource key.
Publisher dataset identifiers have a query part, but the
Registry reference still has to resolve:
:genparam:`uri(ivo://org.gavo.dc/~?feros/data/f89411.vot)`
New-style standardIds use fragments to refer to standard keys within
vstd:Standard records, as in
:genparam:`uri(ivo://org.gavo.dc/std/glots#tables-1.0)`
With Identifiers 2 PubDIDs, one can reference things within
suitable datasets; in the case of
:genparam:`uri(ivo://org.gavo.dc/~?feros/data/f89411.vot#spectral)`,
the PubDID references a VOTable (which you can inspect at
http://dc.zah.uni-heidelberg.de/getproduct/feros/data/f89411.vot), and
the fragment is an ID within that file.
A set of access URLs derived from a
publisher DID
pubDID resolver
Global PubDID resolver
This service implements the Identifiers 2.0
suggestion for how to resolve an IVOA publisher dataset identifier;
that is, it tries to resolve the registry part to Datalink,
SSAP, or Obscore capabilities and tries those to find access URLs.
If that fails, it repeats this procedure for services that the
base resource declares as served-by.
The code used here is available at
http://svn.ari.uni-heidelberg.de/svn/gavo/hdinputs/ivoidval.
See also Examples_
.. _Examples: http://dc.g-vo.org/ivoidval/q/didresolve/examples
The preferred way to resolve PubDIDs is in a Datalink_ service.
If the datalink document returned contains one or more rows with
``#this`` semantics, the corresponding access URLs are returned,
as for
:genparam:`pub_did(ivo://org.gavo.dc/~?flashheros/data/taut/f0691.mt)`,
.. _Datalink: http://ivoa.net/documents/DataLink
As with
:genparam:`pub_did(ivo://org.gavo.dc/tap?mlqso/data/slits/BRI0952_data.fits)`,
PubDIDs with a registry part pointing to a TAP service will be
looked for in that TAP service's ``ivoa.obscore`` table (we don't
bother checking if it exists, so this service does not distinguish
between a service without obscore and a service with an obscore table
that just doesn't have the PubDID in question.
:genparam:`pub_did(ivo://org.gavo.dc/feros/q/ssa?f04031.bdf)`,
is an example for a PubDIDs that has an SSAP service in its registry
part. For those, the resolver tries passing in the id through
SSAP's PUBDID parameter; if the service isn't broken, that should
yield at least one access URL. Note that in the example, two different
files are returned, which are representations of the same data set
in two formats.
To enable pure data collections or architectures with central, say,
datalink services, the resolution process looks at services that
the service referenced in the pubDID's registry part declares itself
to be ``served-by``. By default, this only happens if the other
means of obtaining a result have failed. You can, however, pass
:genparam:`force_related(True)` to go through relationship even
in the presence of results.
This is necessary for
:genparam:`pub_did(ivo://org.gavo.dc/apo/res/apo/frames?apo/cd/9506/L2237_950602_r_01.fits)`,
as it has an (auxiliary) TAP capabilty itself. When forced
to go through the related services, the resolver will hit the
TAP service a second time, as the TAP service's main record
is in a served-by relationship (as you can see in its
`resource record`_
.. _resource record: http://dc.zah.uni-heidelberg.de/rr/q/pmh/pubreg.xml?verb=GetRecord&metadataPrefix=ivo_vor&identifier=ivo%3A%2F%2Forg.gavo.dc%2Fapo%2Fres%2Fapo%2Fframes
ivo://org.gavo.dc/tap?mlqso/data/slits/BRI0952_data.fitsval/api
import json
msgs = set(tuple(r) for r in json.loads(self.data)["data"])
self.assertTrue(
('INFO', 'Validating as a Registry reference', None)
in msgs, "info missing")
self.assertTrue(
('WARNING', 'Sub-delimiter found in resource key; this ivoid must'
' only be used with specialised clients', None) in msgs,
"sub-delimiter warning missing")
self.assertTrue(
('ERROR', 'Registry reference missing in registry', '8.4') in msgs,
"registry reference error message missing")
self.assertTrue((u'INFO', u'ivo-id is invalid', None) in msgs,
"invalidity diagnosis missing")
val/formValidating as an authority ID")
self.assertHasStrings("