OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [tosca-comment] nested_property_name in get_property and get_attribute


Yes, I agree about the need for an "any" type. Unfurl (https://unfurl.run) already supports that and if yourÂproperty type definition includes an optional "schema" attributeÂwith a json scheme it will validate its contents using that schema.Â

Cheers,
Adam

á

On Fri, Feb 5, 2021 at 1:08 PM Tal Liron <tliron@redhat.com> wrote:
I agree that we can do better. We've discussed aspects of this from two approaches:

1) The json and xml types (which I think we've since removed?) are textual types that have some kind of schematics. But the whole approach is awkward, as it involves embedded text in TOSCA, which would of course not be directly "nestable" with something like get_property. And text-embedding is a whole can of worms: encoding issues, formatting, and many different ways to specify and retrieve schemas. I don't think this is the right way to go.

2) We've raised the question a few times as to whether TOSCA needs an "any" built-in type. The idea is that "any" would be anything that can be expressed in YAML. In my own work I tend to call this kind of data ARD: Agnostic Raw Data. There are a few gotchas to be aware of, but I'm confident it's possible to specify it clearly for TOSCA, and it should be easy to implement by any processor (the processor is already parsing YAML), and also easy to translate into a string for transfer (the gotchas have to do with round-trips). When properly specified, it would then be possible to have a well-defined get_property that could nest into dicts and arrays (grammar that should still be improved by something like XPath).

In short, something I would definitely want us to tackle for 2.0.

On Wed, Feb 3, 2021 at 3:53 AM <paul.m.jordan@bt.com> wrote:

It is a simple matter to define TOSCA datatype definitions which reference an existing external schema definition. This is useful as it leverages prior work such as that in schema.org and TMForum APIs.

But I have found it difficult to write topology templates which use such datatypes because it is not clear if or how to use nested_property_name in get_property and get_attribute functions to access the values of leaf nodes in an imported structure. For example if I imported person from schema.org, get_property who could I get the value of email?

Â

I would like to see an example of its use and wonder whether nested_property_name actually needs to support JSONpath syntax.

Â

Paul Jordan
OSS Specialist
BT Technology | Tel +44 (0) 3316252643 Â| paul.m.jordan@bt.com

This email contains information from BT that might be privileged or confidential. And it's only meant for the person above.ÂIf that's not you, we're sorry - we must have sent it to you by mistake. Please email us to let us know, and don't copy or forward it to anyone else. Thanks.

We monitor our email systems and may record all our emails.
British Telecommunications plc
R/O : 81 Newgate Street, London EC1A 7AJ
Registered in England: No 1800000

Â



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]