Giter Club home page Giter Club logo

cds-votable-rust's People

Contributors

fxpineau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mriduls

cds-votable-rust's Issues

Unexpected starting tag DEFINITIONS when parsing a VOTABLE

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)

Relax the parsing for 1.1/1.2 versioned VOTables

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:

  • not panicking but prefer return an error
  • provide a relaxed version boolean parameter that could still try to parse the votable even if it is <1.3

Unexpected INFO event. Expected: End. Actual: CData(BytesCData...

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>

Reading sub elements by ref not implemented

Documentation: simple reading example

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.

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.