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

Set Multiple AAS Environment Files as Input #172

Open
mehtanin opened this issue Aug 8, 2022 · 6 comments
Open

Set Multiple AAS Environment Files as Input #172

mehtanin opened this issue Aug 8, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@mehtanin
Copy link

mehtanin commented Aug 8, 2022

Description
Does FAAAST supports multiple aas environment files as input while starting the service? If so, what is the procedure?

To Reproduce
Steps to reproduce the behavior:

  1. To start the service 'java -jar starter-{version}.jar -m {path/to/your/AASEnvironment}'
  2. Here, how can we set multiple files in the aas environment path as the input of FAAAST service?

Expected behavior
Multiple aas environment files will be given as input when starting the FAAAST service.

Output
The HTTP endpoint will return results from multiple aas environment files based on the query.

@mehtanin mehtanin added the bug Something isn't working label Aug 8, 2022
@mjacoby mjacoby added enhancement New feature or request and removed bug Something isn't working labels Aug 8, 2022
@mjacoby
Copy link
Member

mjacoby commented Aug 8, 2022

This feature is not supported. We are aware that some users would like to have this feature but currently we cannot provide any details on if/when it will be available in the future. This is also because merging multiple environments becomes quite complex once there are collisions/overlaps in the different files.

As a quick work-around you could use the FA³ST Package Explorer Converter; a tool intended to convert JSON files exported from the AASX Package Explorer to be FA³ST-compliant. However, it also has a (rather primitive) merge feature. You'll have to manually merge your files into one with this and then load the merged file into FA³ST.

@tsaihsing3
Copy link

Is multiple aas as input while starting the service supported in latest version now, using FileStorageSystem?

@mjacoby
Copy link
Member

mjacoby commented Jun 17, 2024

No, it is still not supported.
The FileStorageFileSystem you are referring to is an implementation of the FileStorage interface which is responsible for reading/writing complementary files, e.g. files like pictures or PDFs or such that are linked to the model via the submodel element File or AssetInformation.thumbnail.

The reason it is not yet supported to load multiple model files is that it would require rather changes to the FilePersistence for storing updates, i.e. when choosing to update the original files, that are not trivial.

Could you maybe provide some insight in your use case and how you would like to operate FA³ST using multiple models? Are you using in-memory or file-based persistence? Do you maybe only need to create a read-only instance, i.e. users should not be able to modify the model via API once FA³ST is started?

@tsaihsing3
Copy link

Thanks for your detailed explanation! I understand it now.
I was only reading the documentation and do not have use cases in mind.

@sirchnik-xitaso
Copy link

sirchnik-xitaso commented Nov 13, 2024

With the recently 😄 merged proprietary '/import'-Feature (similar to basyx '/upload') uploading multiple aasx is easier possible now, but merging is still primitive right?

cat $e | curl -H "Content-Type: application/asset-administration-shell-package+xml" -X POST --data-binary @- http://localhost:8080/api/v3.0/import
PS I guess '/reset' should not use GET (CSRF).
❯ : curl -X 'POST' http://localhost:8080/api/v3.0/reset
{
  "messages" : [ {
    "messageType" : "Error",
    "text" : "method 'POST' not allowed for URL 'reset' (allowed methods: GET)",
    "timestamp" : "2024-11-13T08:35:24.838+00:00"
  } ]
}

@mjacoby
Copy link
Member

mjacoby commented Nov 13, 2024

Correct. The new /import feature does not do any merging. In fact, it will only import elements (AAS, submodel, concept description, files) that are not present in the server. As a response you will get a JSON object listing all errors that occurred looking like this

{
	"fileErrors": {
		"[filename]": "[error message]",
		...
	},
	"modelErrors": {
		"[serialized reference to element that caused the error]": "[error message]",
		...
	}
}

In the future, this might be extended to provide more options about how to handle conflicts but right now, no merging algorithm exists in FA³ST.

/reset is currently using GET as it does not require any input, i.e., POST is not required. The idea was to make it easy to call /reset e.g. via Browser. However, I can see the argument that POST should be used as it is not reading but manipulating data. We might change this in the future as both features are very new and not yet released in any official release besides the latest SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants