[AstroPy] accessing raw astropy.io.votable.tree.Resource content

Tom Donaldson perrymasonary at gmail.com
Fri Sep 3 17:05:30 EDT 2021


Hi Laurent,

Having just returned from vacation, I can take a look at this next week.  However as I recall, I think it will require some changes to astropy.io.votable to save some of the content that it's not actively using.  That should be very doable and something we can work on together to make sure it does what we need.

Thanks,
Tom


On 8/31/21, 4:22 AM, "AstroPy on behalf of Laurent Michel" <astropy-bounces+perrymasonary=gmail.com at python.org on behalf of laurent.michel at astro.unistra.fr> wrote:

    Hello,

    In the frame the VO data modeling efforts, I'm exercising the annotation of VOTable resources with data model meta-data.
    These annotations are XML pieces matching their own schema.
    For doing this without touching the VOTable schema, the annotations are enclosed in a Resource of type "meta".
    The VOTable structure looks like this:

       <VOTable>
         <RESOURCE type=result>
           <RESOURCE type=meta>
             <==== My DM stuff ====>
           <RESOURCE type=result>
             <TABLE>

    This approach has been validated by using standard XML parsers and validators and I'm now investigating a possible connection 
    with Astropy.
    For this, I need to be able to get the content of such a resource by using the  astropy.io.votable API.
    My problem is that I do not know how to get that stuff as an XML DOM or even as a string either.

    I would like to do something like:

             votable = parse(votable_path)
             for resource in votable.resources:
                 if resource.type == "results":
                     for sub_resource in resource.resources:
                         if sub_resource.type == "meta":
                             print("here is my DM stuff")
                         >>> annotation_content = sub_resource.content()

    Does anyone know a way to get the raw content of a resource?

    Laurent
    -- 
    jesuischarlie/Tunis/Paris/Bruxelles/Berlin

    Laurent Michel
    SSC XMM-Newton
    Tél : +33 (0)3 68 85 24 37
    Fax : +33 (0)3 )3 68 85 24 32
    Université de Strasbourg <http://www.unistra.fr>
    Observatoire Astronomique
    11 Rue de l'Université
    F - 67200 Strasbourg
    _______________________________________________
    AstroPy mailing list
    AstroPy at python.org
    https://mail.python.org/mailman/listinfo/astropy




More information about the AstroPy mailing list