ge-high-assurance / RITE

DARPA's Automated Rapid Certification of Software (ARCOS) project called RITE (RACK Integrated CerTification Environment)
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Manifest Import is Not Following the Specified Graphs #75

Closed kityansiu closed 1 year ago

kityansiu commented 1 year ago

When right clicking on manifest.yaml and doing "Manifest Import", the ingestion goes to the default graphs specified in Window > Preferences > RACK instead of following what's in either model.yaml or import.yaml when they're specified. Here's the desired behavior demonstrated via RACK cli.

In MBSE-Ontology/OwlModels/model.yaml, I have the following :

model-graphs:
- http://rack001/mbsemodel
files:
- mbse.owl

And in MBSE-Ontology/manifest.yaml, I have the following:

name: 'MBSE Ontology'
description: 'extension to core ontology with mbe concepts' 
footprint:
  model-graphs:
  - http://rack001/mbsemodel
steps:
  - model: OwlModels/model.yaml

When I run rack manifest import manifest.yaml it correctly ingests the model into the model-graph http://rack001/mbsemodel.

Here's another example. In ADEPT/InstanceData/import.yaml, I have the following:

data-graph: http://rack001/adeptdata
model-graphs:
- http://rack001/model
- http://rack001/mbsemodel
ingestion-steps:
- class: http://arcos.rack/PROV-S#ACTIVITY
  csv: ingest_ACTIVITY.csv
- class: http://arcos.rack/mbse#Engine
  csv: ingest_Engine.csv
- class: http://arcos.rack/mbse#Measurement
  csv: ingest_DesignedPartMeasurement.csv
- class: http://arcos.rack/mbse#Assembly
  csv: ingest_DesignedAssembly.csv
- class: http://arcos.rack/mbse#DesignedPart
  csv: ingest_DesignedPart.csv
- class: http://arcos.rack/REQUIREMENTS#REQUIREMENT
  csv: ingest_REQUIREMENT.csv
- class: http://arcos.rack/mbse#ManufacturedPart
  csv: ingest_Turbine.csv
- class: http://arcos.rack/mbse#Measurement
  csv: ingest_AirfoilMeasurements.csv
- class: http://arcos.rack/mbse#ManufacturedPart
  csv: ingest_Airfoil.csv

And in ADEPT/manifest.yaml, I have the following:

name: 'ADEPT Engine'
description: 'MBE Demo'
footprint:
  model-graphs:
  - http://rack001/model
  - http://rack001/mbsemodel
  data-graphs:
  - http://rack001/adeptdata
steps:
  - data: InstanceData/import.yaml

When I run rack manifest import manifest.yaml it correctly ingests the data into the data-graph http://rack001/adeptdata while correctly referencing both model-graphs.

Note: The top-level "footprint" is only used to make sure the lower ones don't violate it. It isn't actually used. So, the best practice is to specify the model-graphs and data-graph in both the import.yaml (for data) and data.yaml (for model). Otherwise, the default graphs (http://rack001/model and http://rack001/data) can be used.

saratge commented 1 year ago

Easiest way to test:

saratge commented 1 year ago

The issue is resolved with commit: https://github.com/ge-high-assurance/RITE/pull/122/commits/e78b2f06cc7f2fcdc8c6f7585bb3682cefc2b986

The commit message mentions other things

I have highlighted specific lines that make the fix possible, I pass in a list of model graphs from yaml instead of single model graph:

https://github.com/ge-high-assurance/RITE/pull/122/commits/e78b2f06cc7f2fcdc8c6f7585bb3682cefc2b986#diff-af9642f405830f6e743376bb87f56e481a8346f8fd0dcbd94b8ba380262cd67eR678

https://github.com/ge-high-assurance/RITE/pull/122/commits/e78b2f06cc7f2fcdc8c6f7585bb3682cefc2b986#diff-af9642f405830f6e743376bb87f56e481a8346f8fd0dcbd94b8ba380262cd67eR689