### Backup Workspace Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Creates a backup of all workspace files. This operation is performed by sending a GET request to the backup-workspace endpoint. ```bash curl -X GET "http://localhost:8080/ame/api/package/backup-workspace" ``` -------------------------------- ### GET /ame/api/models/migrate-workspace Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Migrates all aspect models in the workspace to the latest SAMM version. Optionally, it can also increment version numbers. ```APIDOC ## GET /ame/api/models/migrate-workspace ### Description Migrates all aspect models in the workspace to the latest SAMM version. Optionally, it can also increment version numbers. ### Method GET ### Endpoint /ame/api/models/migrate-workspace ### Query Parameters - **setNewVersion** (boolean) - Optional - If true, increments version numbers of the migrated models. ### Request Example ``` GET /ame/api/models/migrate-workspace?setNewVersion=true Host: localhost:8080 ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the migration was successful. - **errors** (array) - A list of any errors encountered during migration. #### Response Example ```json { "success": true, "errors": [] } ``` ``` -------------------------------- ### GET /api/models Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Retrieves a turtle file representing an aspect model based on its URN. The URN must be provided in the 'aspect-model-urn' header. ```APIDOC ## GET /api/models ### Description Retrieves a turtle file based on the Aspect Model URN. The URN follows the format `urn:samm:namespace:version#AspectModelElement`. ### Method GET ### Endpoint /ame/api/models ### Parameters #### Headers - **aspect-model-urn** (string) - Required - The URN of the aspect model to retrieve. - **Accept** (string) - Optional - The desired content type, e.g., `text/turtle`. ### Request Example ```bash curl -X GET "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" \ -H "Accept: text/turtle" ``` ### Response #### Success Response (200) - **body** (text/turtle) - The content of the requested turtle file. #### Response Example ```turtle @prefix samm: . @prefix : . :Movement a samm:Aspect ; samm:preferredName "movement"@en ; samm:properties ( :isMoving :position :speed ) ... ``` ``` -------------------------------- ### Get All Namespaces (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Retrieves a map of all namespaces present in the workspace, including their versions and associated models. An optional query parameter `onlyAspectModels` can filter for namespaces containing only aspect models. ```bash # Get all namespaces curl -X GET "http://localhost:8080/ame/api/models/namespaces" # Get only namespaces containing Aspect definitions curl -X GET "http://localhost:8080/ame/api/models/namespaces?onlyAspectModels=true" ``` -------------------------------- ### GET /api/models/namespaces Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Retrieves a map of all namespaces within the workspace, including their versions and associated models. An optional query parameter can filter for namespaces containing only Aspect models. ```APIDOC ## GET /api/models/namespaces ### Description Returns a map of all namespaces with their versions and models in the workspace. ### Method GET ### Endpoint /ame/api/models/namespaces ### Parameters #### Query Parameters - **onlyAspectModels** (boolean) - Optional - If set to `true`, only namespaces containing Aspect definitions will be returned. ### Request Example ```bash # Get all namespaces curl -X GET "http://localhost:8080/ame/api/models/namespaces" # Get only namespaces containing Aspect definitions curl -X GET "http://localhost:8080/ame/api/models/namespaces?onlyAspectModels=true" ``` ### Response #### Success Response (200) - **body** (object) - A map where keys are namespace names and values are arrays of objects, each containing `version`, `models`, and potentially other metadata. #### Response Example ```json { "org.eclipse.examples": [ { "version": "1.0.0", "models": [ { "model": "Movement.ttl", "existing": true, "version": "2.1.0" } ] } ] } ``` ``` -------------------------------- ### Batch Get Models by URNs (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Fetches multiple aspect models in a single request by providing a list of URNs. The request body is a JSON array containing details for each model to be retrieved. ```bash # Batch retrieve models curl -X POST "http://localhost:8080/ame/api/models/batch" \ -H "Content-Type: application/json" \ -d '[ { "absoluteName": "Movement", "aspectModelUrn": "urn:samm:org.eclipse.examples:1.0.0#Movement", "modelVersion": "1.0.0" } ]' ``` -------------------------------- ### Get Aspect Model by URN (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Retrieves an aspect model in Turtle format using its unique URN. This endpoint is part of the Model Management API and requires the URN as a header. ```bash # Get an aspect model by URN curl -X GET "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" \ -H "Accept: text/turtle" ``` -------------------------------- ### Export Package by URN Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Exports a package of aspect model files identified by a URN. The request sends a GET request to the export endpoint and receives a ZIP file containing the related .ttl files. ```bash curl -X GET "http://localhost:8080/ame/api/package/export" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" \ --output package.zip ``` -------------------------------- ### Build and Run Backend Application Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Instructions for building and running the ESMF Aspect Model Editor Backend using Maven. The backend requires JDK 21 and Maven for compilation and execution. ```bash # Build the project mvn clean package # Run the application mvn exec:java -pl aspect-model-editor-runtime # Run with development profile mvn exec:java -pl aspect-model-editor-runtime -Dspring.profiles.active=dev ``` -------------------------------- ### Standard License Header for Java Files Source: https://github.com/eclipse-esmf/esmf-aspect-model-editor-backend/blob/main/CONTRIBUTING.md This is a standard license header required for all Java files contributed to the project. It includes copyright notices, authorship information, and the Mozilla Public License v. 2.0 statement. The placeholders for year and company names need to be replaced. ```java /* * Copyright (c) {YEAR} {NAME OF COMPANY X} * Copyright (c) {YEAR} {NAME OF COMPANY Y} * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. * * SPDX-License-Identifier: MPL-2.0 */ ``` -------------------------------- ### Semantic Versioning Syntax for Git Tags Source: https://github.com/eclipse-esmf/esmf-aspect-model-editor-backend/blob/main/CONTRIBUTING.md Defines the versioning syntax for Git tags used in this project, following Semantic Versioning. It includes the MAJOR.MINOR.PATCH format and allows for pre-release identifiers. ```git vX.Y.Z-[pre-release-identifier] Examples: v1.0.0-RC1, v1.0.0 ``` -------------------------------- ### Backup Workspace Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Creates a backup of all workspace files. This is useful for data safety and version control. ```APIDOC ## GET /ame/api/package/backup-workspace ### Description Creates a backup of all workspace files. This is useful for data safety and version control. ### Method GET ### Endpoint /ame/api/package/backup-workspace ### Parameters None ### Request Example ```bash curl -X GET "http://localhost:8080/ame/api/package/backup-workspace" ``` ### Response #### Success Response (201) - **response** (status) - HTTP 201 Created indicating the backup was successful. ``` -------------------------------- ### Generate HTML Documentation from Aspect Model (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates human-readable HTML documentation from an aspect model. The output language can be specified, and the result is saved as an HTML file. ```bash curl -X POST "http://localhost:8080/ame/api/generate/documentation?language=en" \ -H "uri: blob://movement.ttl" \ -H "Accept: text/html" \ -F "aspectModel=@Movement.ttl" \ --output documentation.html ``` -------------------------------- ### Import Package Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Imports a ZIP file containing aspect model files into the workspace. This is achieved via a POST request with the ZIP file uploaded as form data. ```bash curl -X POST "http://localhost:8080/ame/api/package/import" \ -F "zipFile=@models-package.zip" ``` -------------------------------- ### Import Package Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Imports a ZIP file containing aspect model files into the workspace. This allows for adding or updating models in the system. ```APIDOC ## POST /ame/api/package/import ### Description Imports a ZIP file containing aspect model files into the workspace. This allows for adding or updating models in the system. ### Method POST ### Endpoint /ame/api/package/import ### Parameters #### Request Body - **zipFile** (file) - Required - The ZIP file containing the aspect model files to import. ### Request Example ```bash curl -X POST "http://localhost:8080/ame/api/package/import" \ -F "zipFile=@models-package.zip" ``` ### Response #### Success Response (200) - **response** (object) - A JSON object detailing the imported packages and their models. Example: ```json { "org.eclipse.examples": [ { "version": "1.0.0", "models": [{ "model": "Movement.ttl", "existing": true }] } ] } ``` ``` -------------------------------- ### Generate AsyncAPI Specification (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates an AsyncAPI specification for event-driven architectures. Supports output in YAML or JSON, with options to write separate files within a ZIP package. ```bash # Generate YAML AsyncAPI spec curl -X POST "http://localhost:8080/ame/api/generate/async-api-spec?output=yaml&applicationId=urn:example:movement-app&channelAddress=movement/events&useSemanticVersion=true" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" # Generate as separate files (ZIP package) curl -X POST "http://localhost:8080/ame/api/generate/async-api-spec?output=json&writeSeparateFiles=true" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" \ --output async-api-package.zip ``` -------------------------------- ### POST /api/models/batch Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Retrieves multiple aspect model turtle files in a single request by providing a list of model URNs in the request body. ```APIDOC ## POST /api/models/batch ### Description Retrieves multiple turtle files in a single request based on a list of URNs. ### Method POST ### Endpoint /ame/api/models/batch ### Parameters #### Request Body - **models** (array) - Required - An array of objects, where each object specifies the `aspectModelUrn`, `absoluteName`, and `modelVersion` of the models to retrieve. ### Request Example ```bash curl -X POST "http://localhost:8080/ame/api/models/batch" \ -H "Content-Type: application/json" \ -d '[ { "absoluteName": "Movement", "aspectModelUrn": "urn:samm:org.eclipse.examples:1.0.0#Movement", "modelVersion": "1.0.0" } ]' ``` ### Response #### Success Response (200) - **body** (array) - An array of `FileInformation` objects, each containing the content of a requested model. ``` -------------------------------- ### Generation API - AsyncAPI Specification Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates an AsyncAPI specification for event-driven architectures, with options for output format and detailed configuration. ```APIDOC ## POST /ame/api/generate/async-api-spec ### Description Generates AsyncAPI specification for event-driven architectures. ### Method POST ### Endpoint /ame/api/generate/async-api-spec ### Query Parameters - **output** (string) - Optional - The desired output format ('yaml' or 'json', defaults to 'yaml'). - **applicationId** (string) - Optional - The application identifier. - **channelAddress** (string) - Optional - The address of the channel. - **useSemanticVersion** (boolean) - Optional - Whether to use semantic versioning. - **writeSeparateFiles** (boolean) - Optional - If true, generates separate files for schemas (output as ZIP package). ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate the AsyncAPI specification from. ### Request Example ``` POST /ame/api/generate/async-api-spec?output=yaml&applicationId=urn:example:movement-app&channelAddress=movement/events&useSemanticVersion=true Host: localhost:8080 uri: blob://movement.ttl aspectModel: @Movement.ttl ``` ### Response #### Success Response (200) - **AsyncAPI specification** (string/file) - The generated AsyncAPI specification in YAML/JSON format, or a ZIP package if `writeSeparateFiles` is true. #### Response Example (YAML) ```yaml asyncapi: "2.0.0" info: title: "Movement Service" version: "1.0.0" description: "API for movement events." audiences: - "application-users" publish: movement/events: publish: message: payload: $ref: "#/components/messages/MovementEvent" components: messages: MovementEvent: payload: type: object properties: timestamp: type: string format: date-time # ... other properties ``` ``` -------------------------------- ### Generate Sample JSON Payload from Aspect Model (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates a sample JSON payload that conforms to the structure defined by the aspect model. It takes the model file as input. ```bash curl -X POST "http://localhost:8080/ame/api/generate/json-sample" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### POST /api/models/format Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Formats a given aspect model turtle file according to SAMM conventions. The model content is expected in the request body. ```APIDOC ## POST /api/models/format ### Description Formats a turtle file according to SAMM conventions. ### Method POST ### Endpoint /ame/api/models/format ### Parameters #### Request Body - **body** (text) - Required - The content of the aspect model in Turtle format to be formatted. ### Request Example *(No specific curl example provided in the source text, but would involve sending the turtle content in the request body)* ### Response #### Success Response (200) - **body** (text/turtle) - The formatted content of the aspect model. ``` -------------------------------- ### Generation API - HTML Documentation Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates human-readable HTML documentation from an aspect model. ```APIDOC ## POST /ame/api/generate/documentation ### Description Generates human-readable HTML documentation from an aspect model. ### Method POST ### Endpoint /ame/api/generate/documentation ### Query Parameters - **language** (string) - Optional - The language for the generated documentation, defaults to 'en'. ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. - **Accept** (string) - Optional - The desired response content type, defaults to `text/html`. #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate documentation from. ### Request Example ``` POST /ame/api/generate/documentation?language=en Host: localhost:8080 uri: blob://movement.ttl Accept: text/html aspectModel: @Movement.ttl --output documentation.html ``` ### Response #### Success Response (200) - **HTML documentation file** (file) - The generated HTML documentation. #### Response Example ```html Movement Aspect Documentation

Movement Aspect

This document describes the Movement aspect.

Properties

``` ``` -------------------------------- ### POST /ame/api/models/format Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Formats an aspect model and returns its content in Turtle format. ```APIDOC ## POST /ame/api/models/format ### Description Formats an aspect model and returns its content in Turtle format. ### Method POST ### Endpoint /ame/api/models/format ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. - **Accept** (string) - Optional - The desired response content type, defaults to `text/turtle`. #### Request Body - **aspectModel** (file) - Required - The aspect model file to format. ### Request Example ``` POST /ame/api/models/format Host: localhost:8080 uri: blob://movement.ttl Accept: text/turtle aspectModel: @Movement.ttl ``` ### Response #### Success Response (200) - **Formatted Turtle file content** (string) - The formatted aspect model in Turtle format. #### Response Example ```turtle @prefix rdf: @prefix ns1: ns1:Movement a ns1:Aspect ; ns1:isMoving "true"^^ ; ns1:speed "50.5"^^ . ns1:SpatialPosition a ns1:Aspect ; ns1:latitude "9.1781"^^ ; ns1:longitude "48.80835"^^ ; ns1:altitude "153.0"^^ . ``` ``` -------------------------------- ### Generation API - JSON Sample Payload Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates a sample JSON payload based on the structure of the aspect model. ```APIDOC ## POST /ame/api/generate/json-sample ### Description Generates a sample JSON payload based on the aspect model structure. ### Method POST ### Endpoint /ame/api/generate/json-sample ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate the sample payload from. ### Request Example ``` POST /ame/api/generate/json-sample Host: localhost:8080 uri: blob://movement.ttl aspectModel: @Movement.ttl ``` ### Response #### Success Response (200) - **Sample JSON payload** (object) - A sample JSON payload conforming to the aspect model. #### Response Example ```json { "isMoving": true, "position": { "latitude": 9.1781, "longitude": 48.80835, "altitude": 153.0 }, "speed": 50.5, "speedLimitWarning": "green" } ``` ``` -------------------------------- ### POST /api/models/migrate Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Migrates an existing aspect model to the latest SAMM version. The model is provided via multipart form data and the migrated content is returned in the response. ```APIDOC ## POST /api/models/migrate ### Description Migrates a turtle file to the latest SAMM version with validation. ### Method POST ### Endpoint /ame/api/models/migrate ### Parameters #### Headers - **uri** (string) - Required - A URI identifying the model, e.g., `blob://old-movement.ttl`. - **Accept** (string) - Optional - The desired content type for the migrated model, e.g., `text/turtle`. #### Request Body - **aspectModel** (file) - Required - The aspect model file to migrate (multipart/form-data). ### Request Example ```bash # Migrate an aspect model to latest version curl -X POST "http://localhost:8080/ame/api/models/migrate" \ -H "uri: blob://old-movement.ttl" \ -H "Accept: text/turtle" \ -F "aspectModel=@OldMovement.ttl" ``` ### Response #### Success Response (200) - **body** (text/turtle) - The content of the migrated aspect model with updated SAMM version prefixes. ``` -------------------------------- ### Package Management API - Export Package Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Exports an aspect model and its dependencies as a ZIP package. ```APIDOC ## POST /ame/api/package/export ### Description Exports an aspect model and its dependencies as a ZIP package. ### Method POST ### Endpoint /ame/api/package/export ### Parameters #### Headers - **uri** (string) - Required - The URI of the root aspect model to export. #### Request Body - **aspectModel** (file) - Required - The root aspect model file. ### Request Example ```bash curl -X POST "http://localhost:8080/ame/api/package/export" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" \ --output movement-package.zip ``` ### Response #### Success Response (200) - **ZIP package** (file) - A ZIP archive containing the aspect model and its dependencies. #### Response Example (Binary data representing a ZIP file) ``` -------------------------------- ### POST /api/models Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Creates or updates an aspect model. The aspect model URN is provided in the header and the model content in the request body. ```APIDOC ## POST /api/models ### Description Creates or updates a turtle file in the workspace. Validates the model syntax before saving. ### Method POST ### Endpoint /ame/api/models ### Parameters #### Headers - **aspect-model-urn** (string) - Required - The URN of the aspect model to create or update. - **Content-Type** (string) - Required - Must be `text/plain`. #### Request Body - **body** (text) - Required - The content of the aspect model in Turtle format. ### Request Example ```bash curl -X POST "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" \ -H "Content-Type: text/plain" \ -d '@prefix samm: . @prefix samm-c: . @prefix xsd: . @prefix : . :Movement a samm:Aspect ; samm:preferredName "movement"@en ; samm:description "Aspect for movement information"@en ; samm:properties ( :isMoving ) ; samm:operations ( ) ; samm:events ( ) . :isMoving a samm:Property ; samm:preferredName "is moving"@en ; samm:characteristic samm-c:Boolean .' ``` ### Response #### Success Response (201) - **body** - Indicates successful creation or update. ``` -------------------------------- ### Handling Optional Values in Java Source: https://github.com/eclipse-esmf/esmf-aspect-model-editor-backend/blob/main/CONVENTIONS.md Demonstrates correct and anti-pattern usage of Java's Optional type. It emphasizes functional approaches like map() and ifPresent() over explicit null checks and .get(). Uses Objects.requireNonNull() or Guava's Preconditions for non-null assertions. ```java import java.util.Optional; import java.util.Objects; public class OptionalExample { // Anti-pattern: Checking for null and isPresent before calling .get() public void processOptionalAntiPattern(Optional someOptional) { if (someOptional != null && someOptional.isPresent()) { String value = someOptional.get(); System.out.println("Value: " + value); } } // Preferred: Using functional style patterns public void processOptionalPreferred(Optional someOptional) { someOptional.ifPresent(value -> System.out.println("Value: " + value)); } // Preferred: Using orElse* for fallbacks public String getOptionalValueWithFallback(Optional someOptional, String defaultValue) { return someOptional.orElse(defaultValue); } // Anti-pattern: Using Optional.ofNullable().orElseThrow() for checks public String assignValueAntiPattern(String potentiallyNullValue) { // This is an anti-pattern for simple non-null checks // return Optional.ofNullable(potentiallyNullValue).orElseThrow(() -> new IllegalArgumentException("Value cannot be null")); // Preferred: Using Objects.requireNonNull() Objects.requireNonNull(potentiallyNullValue, "Value cannot be null"); return potentiallyNullValue; } // Example with Guava Preconditions (if applicable) // public String assignValueWithGuava(String potentiallyNullValue) { // com.google.common.base.Preconditions.checkNotNull(potentiallyNullValue, "Value cannot be null"); // return potentiallyNullValue; // } } ``` -------------------------------- ### Format Aspect Model (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Formats a given aspect model (Turtle file) using the API. It requires the model file and specifies the desired output format (Turtle). ```bash curl -X POST "http://localhost:8080/ame/api/models/format" \ -H "uri: blob://movement.ttl" \ -H "Accept: text/turtle" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### Generate OpenAPI Specification (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates an OpenAPI 3.0 specification from an aspect model. Options include output format (JSON/YAML), base URL, and inclusion of query parameters, CRUD operations, and POST methods. ```bash # Generate JSON OpenAPI spec with all options curl -X POST "http://localhost:8080/ame/api/generate/open-api-spec?output=json&baseUrl=https://api.example.com&includeQueryApi=true&useSemanticVersion=true&pagingOption=TIME_BASED_PAGING&includeCrud=false&includePost=true" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" # Generate YAML OpenAPI spec (default) curl -X POST "http://localhost:8080/ame/api/generate/open-api-spec?output=yaml&baseUrl=https://api.example.com" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### Migrate Workspace Models (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Migrates all aspect models within the workspace to the latest SAMM version. An optional parameter can be used to increment version numbers. ```bash # Migrate all models in workspace curl -X GET "http://localhost:8080/ame/api/models/migrate-workspace" # Migrate and increment version numbers curl -X GET "http://localhost:8080/ame/api/models/migrate-workspace?setNewVersion=true" ``` -------------------------------- ### Create or Save Aspect Model (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Creates or updates an aspect model in Turtle format. The API validates the model syntax before saving. It requires the URN and content type in the headers and the model data in the request body. ```bash # Create a new aspect model curl -X POST "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" \ -H "Content-Type: text/plain" \ -d '@prefix samm: . @prefix samm-c: . @prefix xsd: . @prefix : . :Movement a samm:Aspect ; samm:preferredName "movement"@en ; samm:description "Aspect for movement information"@en ; samm:properties ( :isMoving ) ; samm:operations ( ) ; samm:events ( ) . :isMoving a samm:Property ; samm:preferredName "is moving"@en ; samm:characteristic samm-c:Boolean .' ``` -------------------------------- ### Format Aspect Model (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Formats a given aspect model file according to SAMM conventions. The endpoint is part of the Model Validation and Migration API. ```bash # The code for formatting an aspect model would typically be a POST request to a /format endpoint. ``` -------------------------------- ### Generation API - AAS Files Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates Asset Administration Shell (AAS) files in various formats including AASX, XML, and JSON. ```APIDOC ## Generation API - AAS Files ### Description Generates Asset Administration Shell files in various formats (AASX, XML, JSON). ### Method POST ### Endpoints - `/ame/api/generate/aasx` - `/ame/api/generate/aas-xml` - `/ame/api/generate/aas-json` ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. - **Accept** (string) - Optional - The desired response content type (e.g., `application/xml` for AAS XML). #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate AAS files from. ### Request Examples #### Generate AASX package ```bash curl -X POST "http://localhost:8080/ame/api/generate/aasx" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" \ --output model.aasx ``` #### Generate AAS XML ```bash curl -X POST "http://localhost:8080/ame/api/generate/aas-xml" \ -H "uri: blob://movement.ttl" \ -H "Accept: application/xml" \ -F "aspectModel=@Movement.ttl" ``` #### Generate AAS JSON ```bash curl -X POST "http://localhost:8080/ame/api/generate/aas-json" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` ### Response #### Success Response (200) - **AAS file** (file) - The generated AAS file in the requested format (AASX, XML, or JSON). #### Response Example (JSON) ```json { "assetAdministrationShells": [ { "@type": "#AssetAdministrationShell", "idShort": "MovementShell", // ... other AAS properties } ], "submodels": [ // ... submodel details ] } ``` ``` -------------------------------- ### Export Package by URN Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Exports a package of aspect models identified by a URN. The exported package is a ZIP file containing all related .ttl files. ```APIDOC ## GET /ame/api/package/export ### Description Exports a package of aspect models identified by a URN. The exported package is a ZIP file containing all related .ttl files. ### Method GET ### Endpoint /ame/api/package/export ### Parameters #### Query Parameters - **aspect-model-urn** (string) - Required - The URN of the aspect model to export (e.g., "urn:samm:org.eclipse.examples:1.0.0#Movement"). ### Request Example ```bash curl -X GET "http://localhost:8080/ame/api/package/export?aspect-model-urn=urn:samm:org.eclipse.examples:1.0.0#Movement" \ --output package.zip ``` ### Response #### Success Response (200) - **response** (file) - A ZIP file containing all related .ttl files. ``` -------------------------------- ### Migrate Aspect Model to Latest Version (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Migrates an existing aspect model to the latest SAMM version. The model is provided via multipart form data, and the response contains the migrated Turtle file content. ```bash # Migrate an aspect model to latest version curl -X POST "http://localhost:8080/ame/api/models/migrate" \ -H "uri: blob://old-movement.ttl" \ -H "Accept: text/turtle" \ -F "aspectModel=@OldMovement.ttl" ``` -------------------------------- ### Generate AAS Files (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates Asset Administration Shell (AAS) files in various formats, including AASX packages, XML, and JSON. Each format has a dedicated API endpoint. ```bash # Generate AASX package curl -X POST "http://localhost:8080/ame/api/generate/aasx" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" \ --output model.aasx # Generate AAS XML curl -X POST "http://localhost:8080/ame/api/generate/aas-xml" \ -H "uri: blob://movement.ttl" \ -H "Accept: application/xml" \ -F "aspectModel=@Movement.ttl" # Generate AAS JSON curl -X POST "http://localhost:8080/ame/api/generate/aas-json" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### Generation API - OpenAPI Specification Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates an OpenAPI 3.0 specification from an aspect model with configurable options for output format, base URL, and feature inclusion. ```APIDOC ## POST /ame/api/generate/open-api-spec ### Description Generates OpenAPI 3.0 specification from an aspect model with configurable options. ### Method POST ### Endpoint /ame/api/generate/open-api-spec ### Query Parameters - **output** (string) - Optional - The desired output format for the specification ('json' or 'yaml', defaults to 'yaml'). - **baseUrl** (string) - Optional - The base URL for the API. - **includeQueryApi** (boolean) - Optional - Whether to include query API endpoints. - **useSemanticVersion** (boolean) - Optional - Whether to use semantic versioning for the API. - **pagingOption** (string) - Optional - The paging option to use (e.g., 'TIME_BASED_PAGING'). - **includeCrud** (boolean) - Optional - Whether to include CRUD operations. - **includePost** (boolean) - Optional - Whether to include POST operations. ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate the OpenAPI specification from. ### Request Example ``` POST /ame/api/generate/open-api-spec?output=json&baseUrl=https://api.example.com&includeQueryApi=true&useSemanticVersion=true&pagingOption=TIME_BASED_PAGING&includeCrud=false&includePost=true Host: localhost:8080 uri: blob://movement.ttl aspectModel: @Movement.ttl ``` ### Response #### Success Response (200) - **OpenAPI Specification** (object/string) - The generated OpenAPI specification in JSON or YAML format. #### Response Example (JSON) ```json { "openapi": "3.0.3", "info": { "title": "movement", "version": "v1.0.0", "description": "Aspect for movement information" }, "servers": [{ "url": "https://api.example.com/api/v1.0.0" }], "paths": { ... }, "components": { "schemas": { ... } } } ``` ``` -------------------------------- ### Generate JSON Schema from Aspect Model (cURL) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates a JSON Schema from an aspect model for data validation purposes. The language for the schema can be specified. ```bash curl -X POST "http://localhost:8080/ame/api/generate/json-schema?language=en" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### POST /api/models/validate Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Validates a given aspect model (provided as a multipart form data) against the SAMM specification and returns any validation errors. ```APIDOC ## POST /api/models/validate ### Description Validates a turtle file against the SAMM specification and returns any violations. ### Method POST ### Endpoint /ame/api/models/validate ### Parameters #### Headers - **uri** (string) - Required - A URI identifying the model, e.g., `blob://movement.ttl`. #### Request Body - **aspectModel** (file) - Required - The aspect model file to validate (multipart/form-data). ### Request Example ```bash # Validate an aspect model (multipart form) curl -X POST "http://localhost:8080/ame/api/models/validate" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` ### Response #### Success Response (200) - **violationErrors** (array) - An array of error objects if violations are found, or an empty array if the model is valid. #### Response Example (valid model) ```json { "violationErrors": [] } ``` #### Response Example (invalid model) ```json { "violationErrors": [ { "message": "Property is missing required characteristic", "focusNode": "urn:samm:org.eclipse.examples:1.0.0#invalidProperty", "fix": ["Add a samm:characteristic to the property"], "errorCode": "ERR_MISSING_CHARACTERISTIC" } ] } ``` ``` -------------------------------- ### Generation API - JSON Schema Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Generates a JSON Schema from an aspect model for data validation purposes. ```APIDOC ## POST /ame/api/generate/json-schema ### Description Generates a JSON Schema from an aspect model for data validation. ### Method POST ### Endpoint /ame/api/generate/json-schema ### Query Parameters - **language** (string) - Optional - The language for the generated schema, defaults to 'en'. ### Parameters #### Headers - **uri** (string) - Required - The URI of the aspect model. #### Request Body - **aspectModel** (file) - Required - The aspect model file to generate the schema from. ### Request Example ``` POST /ame/api/generate/json-schema?language=en Host: localhost:8080 uri: blob://movement.ttl aspectModel: @Movement.ttl ``` ### Response #### Success Response (200) - **JSON Schema** (object) - The generated JSON Schema. #### Response Example ```json { "$schema": "http://json-schema.org/draft-04/schema", "type": "object", "components": { "schemas": { "Boolean": { "type": "boolean" }, "Speed": { "type": "number" }, "SpatialPosition": { "type": "object", "properties": { "latitude": { "$ref": "#/components/schemas/Coordinate" }, "longitude": { "$ref": "#/components/schemas/Coordinate" } } } } }, "properties": { "isMoving": { "$ref": "#/components/schemas/Boolean" }, "speed": { "$ref": "#/components/schemas/Speed" } } } ``` ``` -------------------------------- ### Validate Aspect Model (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Validates a given aspect model (provided as a file) against the SAMM specification. It returns any validation errors found. The request uses multipart form data, with the model file being sent as `aspectModel`. ```bash # Validate an aspect model (multipart form) curl -X POST "http://localhost:8080/ame/api/models/validate" \ -H "uri: blob://movement.ttl" \ -F "aspectModel=@Movement.ttl" ``` -------------------------------- ### DELETE /api/models Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Deletes an aspect model identified by its URN. The URN must be provided in the 'aspect-model-urn' header. ```APIDOC ## DELETE /api/models ### Description Deletes a turtle file based on the Aspect Model URN. ### Method DELETE ### Endpoint /ame/api/models ### Parameters #### Headers - **aspect-model-urn** (string) - Required - The URN of the aspect model to delete. ### Request Example ```bash curl -X DELETE "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" ``` ### Response #### Success Response (200) - **body** - Indicates successful deletion. ``` -------------------------------- ### Delete Aspect Model by URN (REST API) Source: https://context7.com/eclipse-esmf/esmf-aspect-model-editor-backend/llms.txt Deletes an aspect model identified by its URN. This operation is part of the Model Management API and requires the URN in the header. ```bash # Delete an aspect model curl -X DELETE "http://localhost:8080/ame/api/models" \ -H "aspect-model-urn: urn:samm:org.eclipse.examples:1.0.0#Movement" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.