Is there a way to access entity value metadata in Watson Assistant using the JSON editor or SPEL - watson-assistant

I'm attempting to define some relationships between entity values, using metadata.
I've uploaded metadata to an entity value using the Watson API v1. When I list the entities through the same API I can see the metadata. I have not been able to access the metadata from Watson Assistant though.
As a test I changed the entity value and checked through Watson Assistant it was changed, so I know I'm working with the correct workspace. I've also checked the entity using the JSON editor to verify it was defined and tried assigning the entity to a context variable.
I've tried several methods including:
#Room.building, #Room.metadata.building, entities['Room']?metadata?.building, entities['Room']?.building (all within the < ? tags). Using #Room and entities['Room']?.value returns the entity value correctly. It's accessing the metadata where it fails.
The metadata for building should not be returning null, but I"m either receiving a null or, depending on how I'm attempting to retrieve the value, a SPEL exception - no property on undefined.

Unfortunately, it is not possible to access metadata defined on user entities in the WA runtime at this moment. The metadata are only returned when making the direct API call. You could use cloud functions call though to get the metadata in WA although that is not ideal either.

Related

How to define custom handling for a response class in Spring doc?

I've been using arrow-kt and spring together a lot lately. I've actually constructed a bridge between the two with several key features, one of which is a spring controller that returns an Either will automatically unwrap it and either handle the exception (Left) or return the result (Right). My long term goal is to publish this as a library.
My latest obstacle is Swagger, or more accurately springdoc openapi. Obviously it is seeing the Either, but i want it to show only the Right value as the success response type. While I know there are annotations where I can set the response model on each controller method individually, I'm trying to avoid this.
My real goal is to setup some global converter so that wherever Swagger sees an Either it will automatically unpack this. I'm just not super familiar with the customization API in Spring doc, and everything I Google just points me to the ApiResponse annotation solution.
How can I define default handling for this type of response?

How to define a translator for an Integration Object Item Attribute -Hybris

How can we define a translator for an Integration Object Item Attribute in SAP Commerce?
Below screenshot is a sample Integration Object Item Attribute definition.
Is it possible to define a translator for an attribute let us say attribute available in StockLevel. When the inbound requests inserts Integration Object data through odata2webservices API Post calls, the translator should get invoked and executes some business logic and updates the value of attribute (available)
You can try to create custom Populator (see: DefaultCollectionType2MapPopulator) and insert it into the defaultItemToIntegrationObjectMapConverter. It is important to implement the isApplicable() method correctly.

json api fetching some weird keys

http://musicbrainz.org/ws/2/release/?query=release:fred&fmt=json
i am working with this api.
i have fetched it successfully.
how can i access the value of those keys which have - between them, for ex- status-id track-count
In JavaScript, you can access a property in 2 ways: value.innervalue or value["innervalue"]. You can access the properties using the 2nd way, as it works with dashes in the name.
Consider having a look at the following answer for better understanding if required
Access JSON or JS property using string

forge properties.sqlite vs viewable json for revit type parameters

My understanding was that the derivative properties were base on the PropertyDatabase. However it seems in Revit type parameters (as opposed to instance parameters), for example used in a custom family based on shared parameters seem to be handled differently.. They appear in the derivative properties of the {3D} view, but not in the PropertyDatabase. Why aren't they in the PropertyDatabase as well, where else is that information kept?
Whether you're accessing the properties via the GET :urn/metadata/:guid/properties endpoint, through Forge Viewer APIs, or any other way, the data is still the same.
You are correct though that the "inherited properties" are handled slightly differently. For example, in case of Revit documents, certain properties may be defined on the "family type" node, and it's up to the consumer of this data to make these properties visible on "instances" as well. It's possible that the Model Derivative endpoint handles this, including the family metadata in each instance as well.
Btw. we've recently discovered this issue in Forge Viewer's search function as well. When searching for a specific string, the method would only return "family type" objects as matches, but non of their instances. This is currently being addressed by the engineering team.

Can't store attribute's value with properly type using IoTAgentUL

I need to store the values of devices' attributes with the right type in OrionCB's MongoDB.
As I was unable to perform that I dived into the code and found that IoTAgentUL (as well as IoTAgentJSON) uses OrionCB's API v1 instead of API v2.
As I can see API v1's updateContext sends data to MongoDB without it's type, so every measure is stored as text.
In the other hand I found that API v2's update entity send data to MongoDB with it's type. It produces that I can store attribute's values with it's type which benefits me when manipulating data (i.e. creating indexes, sorting, etc).
My question is if is there any workaround to solve this using the current implementations of IoT Agents.
The only workaround I can imagine is, once entities are automatically created by the IoT Agents, to update the type of such entities by your own. I mean, AFAIK, you can update both the value and the type of an entity.
In more details, I can think on a script that subscribes for all entities of certain type (those created by the agents). Then, when an entity is created this is notified to the script, which automatically updates the type of the entity's attributes.
Please observe you only need to modify the attribute's types once, just when the entities are created, not when an entity's attribute is updated; thus, something like an array or cache of already modified entities is needed in your script.