Eclipse BaSyx
Use AAS Studio as the AI-extraction frontend for an Eclipse BaSyx AAS server, replacing manual entry in the BaSyx GUI for any AAS sourced from a PDF datasheet.
Audience: Industry 4.0 R&D teams + system integrators running BaSyx (or any IDTA-compliant AAS server) and tired of manual entry.
Topology
- Researcher / engineer drops a PDF datasheet into a watch folder, or hits a BaSyx admin button you've added
- Your BaSyx-side service calls AAS Studio /api/v1/extract with the PDF
- Map the structured ExtractionResult to BaSyx's AAS API (POST /shells, then for each submodel POST /shells/{id}/aas/submodels)
- BaSyx now serves a fully-populated AAS that any IDTA-compliant client can consume — no manual entry required
- Optionally: persist the AAS Studio extraction id and trigger a re-extract via the AAS Studio /studio UI when the datasheet is revised
TypeScript
import { AasStudioClient } from '@aas-studio/sdk'
const aas = new AasStudioClient({ apiKey: process.env.AAS_STUDIO_KEY! })
const BASYX_AAS_API = process.env.BASYX_URL + '/aas-api/shells'
async function importToBaSyx(pdf: Uint8Array, fileName: string) {
const { result } = await aas.extract({ file: pdf, fileName })
// 1. Create the shell
const shellId = encodeURIComponent(result.assetId)
await fetch(`${BASYX_AAS_API}/${shellId}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
idShort: result.assetIdShort,
id: result.assetId,
assetInformation: { assetKind: result.assetKind ?? 'Type', globalAssetId: result.assetId },
}),
})
// 2. POST each submodel
for (const sm of result.submodels) {
await fetch(`${BASYX_AAS_API}/${shellId}/aas/submodels/${encodeURIComponent(sm.id)}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
idShort: sm.idShort,
id: sm.id,
submodelElements: sm.elements.map(toBasyxElement),
}),
})
}
}
function toBasyxElement(el: { idShort: string; modelType: string; value?: string; valueType?: string }) {
return {
idShort: el.idShort,
modelType: el.modelType,
value: el.value ?? '',
valueType: el.valueType ?? 'xs:string',
}
}Install: npm install @aas-studio/sdk
Python
import requests
from aas_studio import AasStudioClient
aas = AasStudioClient(api_key=os.environ["AAS_STUDIO_KEY"])
BASYX_AAS_API = os.environ["BASYX_URL"] + "/aas-api/shells"
def import_to_basyx(pdf_bytes: bytes, file_name: str):
response = aas.extract(pdf_bytes, file_name=file_name)
result = response["result"]
shell_id = requests.utils.quote(result["assetId"], safe="")
requests.put(f"{BASYX_AAS_API}/{shell_id}", json={
"idShort": result["assetIdShort"],
"id": result["assetId"],
"assetInformation": {"assetKind": "Instance", "globalAssetId": result["assetId"]},
})
for sm in result["submodels"]:
sm_id = requests.utils.quote(sm["id"], safe="")
requests.put(f"{BASYX_AAS_API}/{shell_id}/aas/submodels/{sm_id}", json={
"idShort": sm["idShort"],
"id": sm["id"],
"submodelElements": [{
"idShort": e["idShort"],
"modelType": e["modelType"],
"value": e.get("value", ""),
"valueType": e.get("valueType", "xs:string"),
} for e in sm["elements"]],
})Install: pip install aas-studio
Common pitfalls
- BaSyx's submodelElement schema requires modelType to match exactly one of the IDTA-defined values. AAS Studio emits IDTA-conformant modelTypes (Property, MultiLanguageProperty, Range, File). For Range elements, the BaSyx API expects min/max as siblings of valueType — adapt the mapping function above.
- BaSyx's shell ID is the assetId URN — make sure you URL-encode it before PUT. The example above does this with encodeURIComponent / requests.utils.quote.
- For BaSyx clusters with auth: the AAS Studio output has no notion of BaSyx-side ACL. Decide upfront whether new shells go in a "supplier-extracted" namespace your team owns or in the production tenant.
- Eclipse BaSyx's versioning model: re-extracting the same PDF and PUTting the same shellId will overwrite. If you need a version history, persist each extraction's id from /api/v1/extractions and tag the BaSyx submodel with it as a custom attribute.