Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API to look up a model by a specific attribute value defined in the mapping #299

Closed
aedelmann opened this issue Jun 26, 2016 · 1 comment

Comments

@aedelmann
Copy link
Contributor

aedelmann commented Jun 26, 2016

Currently, Vorto converts an (information) model to a platform specific output format using code generators with the support of mapping definitions. This process is uni-directional.

The problem in that is that you cannot re-verse lookup a model from this mapped output in order to find out from which Vorto Model it originated. This issue ought so solve this problem.

A possible use case is for example , when a LWM2M server receives a message containing a specific object ID and payload, the server could ask Vorto to lookup the function block associated with the Object ID and validate its payload.

A second use case would be that a message sent in one format (known to Vorto) can be converted into another Vorto-known platform format (on-the-fly).

@aedelmann
Copy link
Contributor Author

This use cases are now supported by a new REST - API and Java Client API that allows to lookup Vorto Properties by platform specific attribute:

IModelRepository modelRepository = builder.buildModelRepositoryClient();

FunctionBlockModel temperatureSensorContent = modelRepo.getContent(ModelId.fromPrettyFormat("com.ipso.smartobjects.Temperature:0.0.1"), FunctionblockModel.class,"lwm2m").get();

IMapping mapping = builder.buildMappingClient();

List properties = mapping.newPropertyQuery(temperatureSensorContent).stereotype("Resource").attribute("ID", "5602").list();

@aedelmann aedelmann added this to the 0.10.0-M2 milestone Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant