aas-specs icon indicating copy to clipboard operation
aas-specs copied to clipboard

Produce a holistic JSON example

Open mristin opened this issue 10 months ago • 5 comments

The issue has been moved from https://github.com/aas-core-works/aas-core-codegen/issues/461.

We copy in the following the original description by @VladimirAlexiev for the context.

(cc @mristin)

In https://github.com/VladimirAlexiev/aas-core-codegen/tree/main/test_data/jsonld_context/trials#next-steps and https://github.com/admin-shell-io/aas-specs/issues/386#issuecomment-2007619361 I asked for some more holistic examples, so I can experiment with langString, datatyped literals, and maybe framing.

@ethieblin referred to JSON examples. But if we take one of those eg https://github.com/admin-shell-io/aas-specs/blob/master/schemas/json/examples/generated/LangStringPreferredNameTypeIec61360/maximal.json, it doesn't look like complete AAS data, so I'm not sure whether I can expect to get "complete" turtle out of it.

I think that having a bigger realistic example will be very useful for implementers and users alike.

Eg see the hundreds of examples in these folders (Turtle and Diagrams are automatically generated from JSON):

  • https://github.com/gs1/EPCIS/tree/master/JSON
  • https://github.com/gs1/EPCIS/tree/master/Turtle
  • https://github.com/gs1/EPCIS/tree/master/Diagrams

mristin avatar Apr 12 '24 07:04 mristin

Here are the latest findings by @VladimirAlexiev from https://github.com/aas-core-works/aas-core-codegen/issues/461.

https://v3.admin-shell-io.com/submodels/

  • The first two are submodel templates with empty elements.
  • But the third one is an instance of "Nameplate" (a Linear motor axis by WEISS) with useful info.
  • And googling for several of the IRDIs finds submodel PDF specifications ("manual linked data" ;-))

Here are indexes of useful examples (can be extracted with jq)

  • 2 Nameplate-Weiss
  • 3 ContactInformation
  • 4 HandoverDocumentation
  • 5 TechnicalData
  • 9 ArticleInformation
  • 11 ServiceNotifications
  • 12 Nameplate-Festo

These are empty

  • 6 MCAD https://admin-shell.io/sandbox/idta/handover/MCAD/0/1/
  • 7 Electrical_and_Fluid_CAD https://admin-shell.io/sandbox/idta/handover/EFCAD/0/1/
  • 8 PLC_Programming https://admin-shell.io/vdi/2770/1/1/Documentation
  • 10 BillOfMaterial

Some more googling turns up Submodel definitions and examples, but these are in XML not JSON:

  • https://github.com/admin-shell-io/submodel-templates/tree/main/published/Digital%20nameplate/2/0 , with 19 siblings
  • https://github.com/admin-shell-io/submodel-templates/tree/main/published/ZVEI_Digital_Nameplate/1/0 with 2 variants (pure/qualified)

There are 229 models.

curl https://v3.admin-shell-io.com/submodels/ > submodels-v3.json
jq ".result[].idShort" submodels-v3.json | wc -l
229

Here is a count by type:

jq ".result[].idShort" submodels-v3.json | sort | uniq -c
      2 "ArticleInformation"
      1 "AssetIdentification"
      4 "BillOfMaterial"
      1 "CarbonFootprint"
      1 "CertificatesAndDeclarations"
      8 "ContactInformation"
      2 "ContactInformations"
      1 "cynapseTeachInService"
      6 "DeviceDescriptionFiles"
      1 "DeviceInfo"
     19 "Document"
     11 "Documentation"
      6 "Electrical_and_Fluid_CAD"
      1 "Electrical_and_FluidCAD"
      1 "FluidCAD"
      8 "HandoverDocumentation"
     33 "Identification"
      1 "ingredients"
      2 "ManufacturerDocumentation"
     16 "MCAD"
     44 "Nameplate"
      1 "nutrition_facts"
      1 "OperationalData"
      1 "PLC_Programming"
      1 "SecurityMetaModelForServer"
      1 "SecuritySettingsForServer"
     27 "Service"
      3 "ServiceNotifications"
     22 "TechnicalData"
      3 "TechnicalSpecification"

To extract the first few useful submodels:

jq ".result[2]"  submodels-v3.json > Nameplate-Weiss.json
jq ".result[3]"  submodels-v3.json > ContactInformation.json
jq ".result[4]"  submodels-v3.json > HandoverDocumentation.json
jq ".result[5]"  submodels-v3.json > TechnicalData.json
jq ".result[9]"  submodels-v3.json > ArticleInformation.json
jq ".result[11]" submodels-v3.json > ServiceNotifications.json
jq ".result[12]" submodels-v3.json > Nameplate-Festo.json
# jq ".result[170]" submodels-v3.json > CarbonFootprint.json # empty

mristin avatar Apr 12 '24 08:04 mristin

@VladimirAlexiev while you are at it, would you mind verifying the AAS with https://github.com/aas-core-works/aas-core3.0-cli-swiss-knife?

You only have to convert each Submodel to an Environment. You can simply embed it in an Environment by this template:

{
"submodels": [
"some-submodel": <your submodel comes here>
]
}

Then you can call:

aas-core3.0-sk-verify.exe --environment <path to the environment file>

mristin avatar Apr 12 '24 08:04 mristin

As @mristin correct stated the existing examples are reflecting older versions only. Sorry for this. But there is good news: Today it was announced in the IDTA newletter that all published Submodel Templates are now compatible with AAS V3.0.

https://github.com/admin-shell-io/submodel-templates/tree/main/published

Other examples AASX files will be added.

@juileetikekar

@ethieblin I am not sure I understand the issue: do you "just" want examples or do you want a single (or two) example file(s) as part of the specification similar to the generated one but "more holistic". If it is the first, the issue is not really part of this repository as well.

BirgitBoss avatar Apr 12 '24 11:04 BirgitBoss

  • saving to https://github.com/admin-shell-io/aas-knowledge-graph/tree/main/examples
  • How about these, are they up to date? https://github.com/admin-shell-io/aas-specs/tree/master/schemas/rdf/examples
  • How to convert AAS XML to JSON?

VladimirAlexiev avatar Apr 15 '24 11:04 VladimirAlexiev

When you import an AAS xml to the aasx package explorer you can also export/save it again in JSON or RDF. For some functionality the package explorer also offers a corresponding command line execution.

Generated examples for xml, JSON and RDF are always up-to-date

To me it seems that the examples in https://github.com/admin-shell-io/aas-knowledge-graph/tree/main/examples/aasx are not up-to-date (at least the naming suggest that you copied them from some of the very first demonstrators of the AAS)

BirgitBoss avatar Sep 06 '24 20:09 BirgitBoss