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

Laurent Michel laurent.michel at astro.unistra.fr
Mon Sep 6 13:12:21 EDT 2021


Hi Tom,

I’m a novice with the Astropy dev cycle, your help would be very appreciated.
I’ll first write an  ’new feature’ issue telling what I’m expecting.
After this we will be able to put our hands-on.

Laurent
—
Translate with https: //www.deepl.com/translator
-- 
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

> On 3 Sep 2021, at 23:05, Tom Donaldson <perrymasonary at gmail.com> wrote:
> 
> 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
> 
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20210906/e338b667/attachment.html>


More information about the AstroPy mailing list