cds-astro / cds-votable-rust Goto Github PK
View Code? Open in Web Editor NEWLibrary to read/write VOTables in Rust and to convert them in JSON, YAML, TOML and back to XML.
License: Apache License 2.0
Library to read/write VOTables in Rust and to convert them in JSON, YAML, TOML and back to XML.
License: Apache License 2.0
On this votable there is a field content_length with a 'long' datatype. The parsing fails with the error invalid digit
because some rows do have missing values. May be we should make it 0 by default
I encounter this error when parsing the votable given by: https://alasky.cds.unistra.fr/cgi/JSONProxy?url=https%3A%2F%2Falasky.unistra.fr%2Fcgi%2Fsimbad-flat%2Fsimbad-cs.py%3Ftarget%3D13%252058%252035.242%252B37%252026%252012.95%26SR%3D1%26format%3Dvotable%26SRUNIT%3Ddeg%26SORTBY%3Dnbref
The error message is the following: Error parsing votable: UnexpectedStartTag([68, 69, 70, 73, 78, 73, 84, 73, 79, 78, 83], "VOTABLE")
The start tag named DEFINITIONS seems to be the reason why the parsing is failing.
Maybe we could have an optional boolean parameter 'relaxed' when calling the parsing and in which we could discard those types of problems: (this one and maybe the one for PARAMS tags where not specifying a value keyword is invalid. In the relaxed mode it could pass by setting the value to "" when not specified)
1.1/1.2 VOTables are not supported and trying to parse them result in panicking
This is unfortunate as these versions seem to be still quite used, e.g. simbad cone search service returns 1.2 votables
panicked at 'called `Result::unwrap()` on an `Err` value: Custom("Unrecognized version. Actual: '1.2'. Expected: '1.3' or '1.4'")
It should be great to:
The votable returned by the cdsxmatch service is not parsed correctly: http://cdsxmatch.u-strasbg.fr/QueryCat/QueryCat?catName=SIMBAD&mode=cone&pos=M1&r=50arcmin&format=votable&limit=3000
It has the following error message:
caught Error parsing votable: Custom("Unexpected INFO event. Expected: End. Actual: CData(BytesCData { content: Borrowed("0xA(${otype}=\"Star\" || ${otype}=\"\**\") && (${B}!=0 || ${V}!=0 || ${R}!=0 || ${J}!=0 || ${K}!=0) {0xA draw pm(${pmra},${pmdec})0xA draw circle(-$[phot.mag],3,15)0xA}0xA(${otype}=\"Star\" ||${otype}=\"\**\") && ${B}=\"\" && ${V}=\"\" && ${R}=\"\" && ${J}=\"\" && ${K}=\"\" {0xA draw pm(${pmra},${pmdec})0xA draw circle(3)0xA}0xA${otype}=\"Radio\" || ${otype}=\"Maser\" || ${otype}=\"HI\" { draw triangle }0xA${otype}=\"UV\" {draw cross;draw plus}0xA${otype}=\"IR\" || ${otype}=\"Red*\" {draw rhomb}0xA${otype}=\"Neb\" || ${otype}=\"PN*\" || ${otype}=\"SNR*\" {draw square}0xA${otype}=\"HII\" { draw dot }${otype}=\"X\" { draw cross }0xA${otype}!=\"Unknown\" { draw ${otype} }0xA{ draw dot }") }).")
p
Maybe it is the INFO content starting with a '<!' that triggers the error:
<VOTABLE version="1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.1 http://www.ivoa.net/xml/VOTable/v1.1"
xmlns="http://www.ivoa.net/xml/VOTable/v1.1">
<DESCRIPTION>
Generated by the Java software cds.catfile.v1.
Please report any problem to: [email protected]
</DESCRIPTION>
<DEFINITIONS>
<COOSYS ID="COOSYS" system="ICRS" equinox="2000.0" epoch="2000.0"/>
</DEFINITIONS>
<RESOURCE name="CDSCatfFile query service, CDS">
<INFO ID="SimbadHFilter" name="AladinFilter" value="All objects">
<![CDATA[
(${otype}="Star" || ${otype}="*\**") && (${B}!=0 || ${V}!=0 || ${R}!=0 || ${J}!=0 || ${K}!=0) {
draw pm(${pmra},${pmdec})
draw circle(-$[phot.mag*],3,15)
}
(${otype}="Star" ||${otype}="*\**") && ${B}="" && ${V}="" && ${R}="" && ${J}="" && ${K}="" {
draw pm(${pmra},${pmdec})
draw circle(3)
}
${otype}="Radio*" || ${otype}="Maser" || ${otype}="HI" { draw triangle }
${otype}="UV" {draw cross;draw plus}
${otype}="IR" || ${otype}="Red*" {draw rhomb}
${otype}="Neb" || ${otype}="PN*" || ${otype}="SNR*" {draw square}
${otype}="HII" { draw dot }${otype}="X" { draw cross }
${otype}!="Unknown" { draw ${otype} }
{ draw dot }]]>
</INFO>
I do have an obscore votable: https://vo.astron.nl/tap/sync?REQUEST=doQuery&LANG=ADQL&MAXREC=20000000&QUERY=SELECT+TOP+9999+*+FROM+ivoa.obscore+WHERE+CONTAINS%28POINT%28%27ICRS%27%2C+s_ra%2C+s_dec%29%2C+CIRCLE%28%27ICRS%27%2C+214.92068%2C+56.81529%2C+3.03%29%29+%3D+1+
that calls a portion of code not yet implemented.
https://github.com/cds-astro/cds-votable-rust/blob/main/src/values.rs#L390
@fxpineau, @thibaultDumortier - Do you think there is a lot of work to do to support the parsing of this votable ?
Hi,
Would it be possible to have a simple example of reading a votable from either a file or string? How do I get the data, parameters, etc?
My limited API understanding here
let mut vot = VOTableWrapper::<InMemTableDataRows>::from_ivoa_xml_str(&response)
.unwrap()
.votable
.get_first_table()
.unwrap();
But it seems that all values have disappeared or are hiding somewhere. Exporting the content to json or yaml does not show the table data either.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.