### Install Node Packages and Start Angular Server Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html Installs the project's dependencies and starts the local development server for the Angular application. This allows you to view the default application in a browser. ```bash npm install npm run start ``` -------------------------------- ### Start Local Development Server (npm) Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html This command starts the local HTTP server for development, allowing you to preview your changes in the browser. Ensure Node.js and npm are installed. ```bash npm run start ``` -------------------------------- ### Implement Offset Pagination Source: https://docs.bosch-semantic-stack.com/rql/syntax-guide.html The limit operator provides offset-based pagination. It requires a start index (offset) and a count of results to return. ```rql option=limit(start,count) ``` ```rql option=limit(10,5) ``` -------------------------------- ### Example SHA256 Hash Calculation Source: https://docs.bosch-semantic-stack.com/catena-x/find-shells-rql.html An example demonstrating the calculation of a SHA256 hash for a specific `specificAssetIds` name and value pair using the provided bash command. ```bash echo -n "manufacturerId_man1_" | tr '[:upper:]' '[:lower:]' | iconv -f UTF-8 -t UTF-16LE | sha256sum 413eadca8e6764f6561cf711e9b91c31b7f96b1e8cd5c908794873c753a4c718 ``` -------------------------------- ### Selecting Specific Attributes with RQL Source: https://docs.bosch-semantic-stack.com/digital-twin-registry/how-to-guides/find-digital-twins.html This example shows how to use the RQL 'select' operator to retrieve only specific attributes, significantly improving response times by reducing data transfer. It also includes an example of filtering results simultaneously. ```rql select=idExternal&filter=eq(labels.name, "blue") ``` -------------------------------- ### Install Angular CLI Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html Installs the Angular CLI framework, version 14, globally on your system. This is a prerequisite for creating and managing Angular projects. ```bash npm install -g @angular/cli@14 ``` -------------------------------- ### Implement Cursor Pagination Source: https://docs.bosch-semantic-stack.com/rql/syntax-guide.html The cursor operator provides key-set pagination. It accepts an optional start cursor and a limit for the number of results to fetch. ```rql option=cursor(start?,limit) ``` ```rql option=limit("myCursor",10) ``` ```rql option=limit(100) ``` -------------------------------- ### Install Angular Schematics CLI Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html Installs the Angular Schematics CLI, version 14, globally. Schematics are used for code generation and modification within Angular projects. ```bash npm install -g @angular-devkit/schematics-cli@14 ``` -------------------------------- ### Create Asset Administration Shell via POST Source: https://docs.bosch-semantic-stack.com/catena-x/shell-patch-operation.html Initial setup example showing the creation of an Asset Administration Shell in the Digital Twin Registry to serve as a base for subsequent update operations. ```http POST https://registry.bosch-semantic-stack.com/aas-api/v3/{tenantId}/shell-descriptors Body: { "id": "myId1", "idShort": "myIdShort1", "description": [ { "language": "de", "text": "Beispielbeschreibung" } ], "globalAssetId": "DDE823EE-254E-464F-948D-1FC7132E335D", "assetKind": "Instance", "labels": [ "myLabel1", "myLabel2" ], "specificAssetIds": [ { "name": "vin", "value": "12345" } ] } ``` -------------------------------- ### Install ESMF Semantic UI Schematics Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html Installs the ESMF Semantic UI Schematics, version 2.1.0, from a specific release URL. These schematics are used to generate UI components for the ESMF Semantic Stack. ```bash npm install https://github.com/eclipse-esmf/esmf-sdk-js-schematics/releases/download/v2.1.0/esmf-semantic-ui-schematics-2.1.0.tgz ``` -------------------------------- ### Example JSON for Asset Administration Shell Source: https://docs.bosch-semantic-stack.com/catena-x/find-shells-rql.html An example JSON object representing an Asset Administration Shell with `specificAssetIds`. This is used to demonstrate the hash calculation for query optimization. ```json { "id": "shell1", "specificAssetIds": [ { "name": "manufacturerId", "value": "man1" } ] } ``` -------------------------------- ### GET /shells Source: https://docs.bosch-semantic-stack.com/catena-x/aas-api-standardized.html Retrieve a list of Asset Administration Shells based on search criteria. ```APIDOC ## GET /shells ### Description Finds and retrieves a collection of Asset Administration Shells based on provided query parameters. ### Method GET ### Endpoint /shells ### Parameters #### Query Parameters - **idShort** (string) - Optional - Filter shells by their short identifier. - **assetId** (string) - Optional - Filter shells by the associated asset ID. ### Request Example GET /shells?idShort=MyMotor ### Response #### Success Response (200) - **items** (array) - A list of Asset Administration Shell objects. #### Response Example { "items": [ { "id": "example-shell-id", "idShort": "MyMotor" } ] } ``` -------------------------------- ### GET /shell-descriptors Source: https://docs.bosch-semantic-stack.com/news-archive.html Retrieve Asset Administration Shells from the registry with support for filtering by creation date. ```APIDOC ## GET /shell-descriptors ### Description Queries the Asset Administration Shell Registry for shells, now supporting a filter for creation timestamps. ### Method GET ### Endpoint /shell-descriptors ### Parameters #### Query Parameters - **createdAfter** (string) - Optional - ISO 8601 timestamp to filter shells created after this date. ### Request Example GET /shell-descriptors?createdAfter=2024-01-01T00:00:00Z ### Response #### Success Response (200) - **items** (array) - List of matching Asset Administration Shell descriptors. #### Response Example { "items": [ { "id": "shell-123", "created": "2024-05-01T10:00:00Z" } ] } ``` -------------------------------- ### POST /shells Source: https://docs.bosch-semantic-stack.com/catena-x/aas-api-standardized.html Create a new Asset Administration Shell instance. ```APIDOC ## POST /shells ### Description Creates a new Asset Administration Shell in the system. ### Method POST ### Endpoint /shells ### Parameters #### Request Body - **id** (string) - Required - The unique identifier for the shell. - **idShort** (string) - Required - The short identifier for the shell. ### Request Example { "id": "urn:uuid:12345", "idShort": "NewShell" } ### Response #### Success Response (201) - **id** (string) - The ID of the created shell. #### Response Example { "status": "created", "id": "urn:uuid:12345" } ``` -------------------------------- ### Cursor Pagination - General Principles Source: https://docs.bosch-semantic-stack.com/digital-twin-registry/how-to-guides/find-digital-twins.html Explains the core concepts of cursor pagination, including its advantages over offset pagination and how the 'limit' parameter is used. ```APIDOC ## Cursor Pagination - General Principles ### Description Cursor pagination divides large datasets into pages using a cursor, which is provided by the server. This method is ideal for continuous scrolling and is generally more performant than offset pagination for large datasets. ### Method N/A (Conceptual Overview) ### Endpoint N/A (Conceptual Overview) ### Parameters #### Query Parameters - **limit** (integer) - Optional - Specifies the number of items per page. Defaults vary by API type (e.g., 500 for non-bulk, bulk quota for bulk APIs). #### Request Body - **limit** (integer) - Optional - Used in bulk APIs to specify the number of items per page. ### Response - **nextCursor** (string) - Provided in the response if more pages are available. Used in subsequent requests to fetch the next page. ``` -------------------------------- ### Build RQL Query Model Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Demonstrates how to use the RqlParser builder to construct a query model with select, filter, sort, and limit operations. ```java final RqlQueryModel model = RqlParser.builder() .select( "att1", "att2", "att3.subAtt4" ) .filter( RqlBuilder.and( RqlBuilder.eq( "att2", "theSame" ), RqlBuilder.or( RqlBuilder.lt( "att1", 5238907523475022349L ), RqlBuilder.not( RqlBuilder.gt( "att1", new BigInteger( "12345678901234567890123456789012345678901234567890" ) ) ) ) ) ) .sort( RqlBuilder.asc( "att1" ), RqlBuilder.desc( "att2" ) ) .limit( 0, 500 ) .build(); ``` -------------------------------- ### GET /entities (Filtering & Sorting) Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Retrieve entities using RQL filter expressions and sorting options. Supports nested attributes and collection constraints. ```APIDOC ## GET /entities ### Description Filters and sorts entity collections using RQL syntax. Supports comparison operators (eq, in, ne, gt, ge, lt, le, like) and logical operators (and, or, not). ### Method GET ### Endpoint /entities ### Parameters #### Query Parameters - **filter** (string) - Optional - RQL expression to filter results (e.g., eq(firstName,"John"), like(hobbies.description,"?iking*")) - **option** (string) - Optional - Sorting configuration (e.g., sort(-address.zipCode,+name)) ### Request Example GET /entities?filter=and(like(hobbies.description,"?iking*"),eq(hobbies.name,"ships"))&option=sort(-address.zipCode,+name) ### Response #### Success Response (200) - **data** (array) - List of entities matching the criteria #### Response Example { "results": [ { "firstName": "John", "address": { "zipCode": 1234 }, "hobbies": [ { "name": "ships", "description": "hiking" } ] } ] } ``` -------------------------------- ### Delete Twins by Query Source: https://docs.bosch-semantic-stack.com/getting-started/_attachments/B2-setup-data.json This endpoint allows for the deletion of twins based on a query. It's useful for bulk removal of twin data, for example, by category. ```APIDOC ## DELETE /twins/query ### Description Deletes twins from the registry based on a provided query filter. Useful for bulk deletion operations. ### Method DELETE ### Endpoint {{url}}/registry-api-bulk/v1/{{tenantId}}/twins/query ### Parameters #### Header Parameters - **Authorization** (string) - Required - `{{bearer}}` - **Content-Type** (string) - Required - `application/json` #### Request Body - **query** (string) - Required - A filter string to select twins for deletion. Example: `filter=like(twinCategory,\"*\")` to delete all twins. ### Request Example ```json { "query": "filter=like(twinCategory,\"*\")" } ``` ### Response #### Success Response (200) (No specific success response body is detailed in the provided information.) #### Response Example (No example provided.) ``` -------------------------------- ### GET /twins Source: https://docs.bosch-semantic-stack.com/getting-started/_attachments/B2-setup-data.json Retrieves a list of twins based on a filter. This endpoint is commonly used to find a twin's ID using a machine number. ```APIDOC ## GET /twins ### Description Retrieves a list of twins based on a filter. This endpoint is commonly used to find a twin's ID using a machine number. ### Method GET ### Endpoint {{url}}/{{registryApiPath}}/{{registryApiVersion}}/{{tenantId}}/twins ### Query Parameters - **filter** (string) - Required - A filter expression to narrow down the search results. Example: `eq(localIdentifiers.localIdentifierKeyPairs.machineNumber, "234DFC1")` ### Request Example ```bash curl -X GET \ '{{url}}/{{registryApiPath}}/{{registryApiVersion}}/{{tenantId}}/twins?filter=eq(localIdentifiers.localIdentifierKeyPairs.machineNumber, "234DFC1")' \ -H 'Authorization: {{bearer}}' ``` ### Response #### Success Response (200) - **items** (array) - A list of twin objects matching the filter. - **id** (string) - The unique identifier of the twin. #### Response Example ```json { "items": [ { "id": "some-twin-id", "name": "Machine Name", "description": "Machine Description" } ] } ``` ``` -------------------------------- ### Filter and Sort Entities using RQL Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Demonstrates how to define query filters for top-level and nested attributes, including collection constraints, and how to apply sorting options. ```text filter=eq(firstName,"John") filter=eq(address.zipCode,1234) filter=like(hobbies.description,"?iking*") filter=and(like(hobbies.description,"?iking*"),eq(hobbies.name,"ships")) option=sort(-address.zipCode,+name) ``` -------------------------------- ### Retrieve updated Asset Administration Shell via GET Source: https://docs.bosch-semantic-stack.com/catena-x/shell-patch-operation.html Example of verifying the state of an Asset Administration Shell after a partial update operation has been applied. ```http GET https://registry.bosch-semantic-stack.com/aas-api/v3/{tenantId}/shell-descriptors/bXlJZDI= Response: { "description": [ { "language": "de", "text": "Beispielbeschreibung" } ], "displayName": [], "assetKind": "Instance", "globalAssetId": "BA3878F4-6E85-4CF0-AA3B-FC67D2F09738", "id": "myId2", "specificAssetIds": [ { "supplementalSemanticIds": [], "name": "vin", "value": "12345" } ], "submodelDescriptors": [], "groups": [], "labels": [ "myLabel1", "myLabel2" ], "createdAt": "2025-06-12T12:43:05.311Z" } ``` -------------------------------- ### Create New Angular Project Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html Creates a new default Angular project named 'demoUI'. This command initializes the project structure and necessary configuration files for an Angular application. ```bash ng new demoUI ``` -------------------------------- ### Measurement Property Data Example Source: https://docs.bosch-semantic-stack.com/getting-started/understand-aspect-models.html Example of JSON data representing a numeric property. This corresponds to the 'speed' property in the Aspect Model. ```json "speed" : 23.5 ``` -------------------------------- ### User-Defined Sorting with RQL Source: https://docs.bosch-semantic-stack.com/digital-twin-registry/how-to-guides/find-digital-twins.html This example demonstrates how to provide sorting information to the API using the RQL 'sort' option. Ascending order is indicated by '+' and descending by '-'. This method allows clients to control the order of retrieved results. ```rql option=sort(-idShort) ``` -------------------------------- ### Boolean Property Data Example Source: https://docs.bosch-semantic-stack.com/getting-started/understand-aspect-models.html Example of JSON data representing a boolean property. This corresponds to the 'isMoving' property in the Aspect Model. ```json "isMoving" : true ``` -------------------------------- ### Configure Maven Dependencies for Querydsl Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Provides the necessary Maven dependency configurations for integrating the RQL parser and Querydsl annotation processing into a project. ```xml com.querydsl querydsl-apt ${querydsl.version} jpa provided ``` -------------------------------- ### Customize QueryDSL paths using delegate methods Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Demonstrates how to flatten or alias complex nested paths in QueryDSL using @QueryEntity and @QueryDelegate. This allows developers to map deep object paths to simpler, more intuitive method names. ```java public class Foo { private FooBar fooBar; } public class FooBar{ private Bar bar; } public class Bar{ private String name; } ``` ```java @QueryEntity public class FooExtension { @QueryDelegate( QFoo.class ) public static SetPath bar( final QFoo foo ) { return foo.fooBars; } } ``` ```java @QueryEntity public class FooBarExtension { @QueryDelegate( QFooBar.class ) public static StringPath name( final QFooBar fooBar ) { return fooBar.bar.name; } } ``` -------------------------------- ### Using the Select Operator Source: https://docs.bosch-semantic-stack.com/rql/syntax-guide.html Shows how to use the select operator to limit the API response to specific attributes, improving performance by excluding unnecessary data. ```text select=attribute1,attribute2,attributeN select=id,name ``` -------------------------------- ### Filter entities using case-insensitive pattern matching Source: https://docs.bosch-semantic-stack.com/rql/syntax-guide.html Shows how to use the 'likeIgnoreCase' operator with wildcards to find entities matching a string pattern regardless of capitalization. ```rql likeIgnoreCase(description,"*my device*") ``` -------------------------------- ### RQL Filter Examples for Asset Administration Shells Source: https://docs.bosch-semantic-stack.com/catena-x/find-shells-rql.html Examples of RQL filter expressions to retrieve Asset Administration Shells based on different criteria. These expressions can be used with the `/aas-api/v3/shell-descriptors` endpoint. ```RQL eq(assetKind,"INSTANCE") ``` ```RQL in(idExternal,"id1","id2","id3") ``` ```RQL eq(labels.name,"A") ``` ```RQL and(eq(assetKind,"INSTANCE"), eq(labels.name,"Floor1")) ``` ```RQL and(eq(specificAssetIds.name,"AssetId"), eq(specificAssetIds.value,"Floor1")) ``` ```RQL eq(specificAssetIds.hash,"") ``` -------------------------------- ### Create initial Twins Source: https://docs.bosch-semantic-stack.com/getting-started/_attachments/B2-setup-data.json Creates multiple digital twins (twins) in the Bosch Semantic Stack. This endpoint is useful for setting up initial data or bulk imports. ```APIDOC ## POST /registry-api-bulk/v1/{tenantId}/twins ### Description Creates one or more digital twins within a specified tenant. The request body contains an array of twin objects, each with properties like description, category, and local identifiers. ### Method POST ### Endpoint `{{url}}/registry-api-bulk/v1/{{tenantId}}/twins` ### Parameters #### Path Parameters - **tenantId** (string) - Required - The ID of the tenant where twins will be created. #### Query Parameters None #### Request Body - **items** (array) - Required - A list of twin objects to create. - **description** (string) - Optional - A description for the twin. - **twinCategory** (string) - Required - The category of the twin (e.g., `vehicle`, `agv`, `machine`). - **twinType** (string) - Optional - The specific type of the twin (e.g., `convertible`, `welding machine`). - **manufacturer** (string) - Optional - The manufacturer of the twin. - **localIdentifiers** (array) - Required - A list of local identifier key-value pairs. - **localIdentifierKeyPairs** (array) - Required - Key-value pairs for local identification. - **key** (string) - Required - The key of the identifier (e.g., `vin`, `agvId`, `machineNumber`). - **value** (string) - Required - The value of the identifier. ### Request Example ```json { "items": [ { "description": "Demo Car 1", "twinCategory": "vehicle", "localIdentifiers": [ { "localIdentifierKeyPairs": [ { "key": "vin", "value": "JA4DB1A40PS000X84" } ] } ] }, { "description": "Demo AGV 1", "twinCategory": "agv", "manufacturer": "Demo Robotics Inc", "localIdentifiers": [ { "localIdentifierKeyPairs": [ { "key": "agvId", "value": "1" } ] } ] } ] } ``` ### Response #### Success Response (200) - **createdTwins** (array) - A list of twins that were successfully created. - **failedTwins** (array) - A list of twins that failed to be created, with reasons for failure. #### Response Example ```json { "createdTwins": [ { "id": "some-twin-id-1", "description": "Demo Car 1" }, { "id": "some-twin-id-2", "description": "Demo AGV 1" } ], "failedTwins": [] } ``` ``` -------------------------------- ### Implement Paging and Sorting with Spring Data Source: https://docs.bosch-semantic-stack.com/rql/developer-guide.html Provides a pattern for converting RQL pagination and ordering information into Spring Data PageRequest objects. ```java public Page findWithQuery( final QueryModelToQueryDSL queryDsl ) { if ( queryDsl == null ) { throw new IllegalArgumentException( "Query must not be null" ); } return find( queryDsl ); } private Page find( final QueryModelToQueryDSL queryDsl ) { final PageRequest pageRequest = createPageRequest( queryDsl ); final Optional predicate = queryDsl.getPredicate(); return predicate.map( p -> repository.findAll( p, pageRequest ) ) .orElse( repository.findAll( pageRequest ) ); } ``` -------------------------------- ### Cursor Pagination - Non-Bulk APIs Source: https://docs.bosch-semantic-stack.com/digital-twin-registry/how-to-guides/find-digital-twins.html Details the interaction lifecycle for cursor pagination within non-bulk APIs (e.g., v2 API), including parameterization and response handling. ```APIDOC ## Cursor Pagination - Non-Bulk APIs ### Description This section details the interaction flow for cursor pagination in non-bulk APIs, such as those in the v2 API. It explains how to request data and navigate through pages using cursors. ### Method N/A (Conceptual Overview) ### Endpoint N/A (Conceptual Overview) ### Parameters #### Query Parameters - **limit** (integer) - Optional - The desired page size, up to a maximum of 500. Defaults to 500 if absent. - **filter** (string) - Optional - RQL filter to apply to the dataset. Defaults to all elements if absent. - **cursor** (string) - Required for subsequent requests - The cursor value received from the previous response. ### Request Example ```json { "limit": 50, "cursor": "some_cursor_string" } ``` ### Response #### Success Response (200) - **elements** (array) - The list of data elements for the current page. - **nextCursor** (string) - A cursor string if more elements are available in the dataset. Absent if this is the last page. ``` -------------------------------- ### Ensure GET Request for Live Data (TypeScript) Source: https://docs.bosch-semantic-stack.com/getting-started/create-ui.html This TypeScript code snippet from the movement-table.service.ts file ensures that the HTTP request to the remote API uses the GET method, which is crucial for fetching live data. ```typescript return this.http.get(remoteAPI); ```