Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed data for example notebooks? #5

Open
lrice648 opened this issue Feb 13, 2023 · 3 comments
Open

Seed data for example notebooks? #5

lrice648 opened this issue Feb 13, 2023 · 3 comments

Comments

@lrice648
Copy link

I have the API running locally but the data initialized empty so none of the provided notebooks have the example outputs. Is there a way to seed the database with the example data or another .sysml file? If not, are there examples showing how to correctly create and insert sysml data via the REST API?

@ReisKoenig97
Copy link

I have almost the same issue. Did you solved it? I used the methods of the cookbook notebooks to post the given example on my local server but now I'm a bit confused about sending a .sysml file directly since it is only shown for a JSON format data input ( e.g. "Element_Create_Update_Delete.ipynb"). Inside Jupyter notebook it is all handled by the magic %publish command which post a request with a sysml file and transforms it automatically in the right file format but only to the official test servers (http://sysml2.intercax.com:9000/docs/)

I hope someone can help me.

@manasbajaj
Copy link
Contributor

Hello Folks

These notebooks are showing direct interaction with the Systems Modeling API and Services REST API on a pilot implementation server. This can done using any programming language but Jupyter notebooks with Python are used for their ease.

However, this should not be mixed/confused with the SysML v2 textual notation and use of the SysML v2 language kernel in Jupyter where SysML v2 models can be authored and published to the repository via the same REST API as above.

A simple workflow to get started:

  1. Create a SysML v2 model using textual notation in Jupyter with the SysML v2 kernel.
  2. Use the %publish command to publish the model to the REST API pilot implementation server.
  3. Use example notebooks provided in this repository to fetch data from the server.
  4. Also, try creating a test project directly from the API. The Project_Commit_Branch_Tag_Recipe.ipynb notebook is a good example. More notebooks to create models directly using the API will be added. The ro

I hope this helps.

Best Regards
Manas

@ReisKoenig97
Copy link

ReisKoenig97 commented Jan 3, 2025

Hello Manas,

Thanks for you answer. I already did this workflow and it works very well but I wanted to test that on a local server, which can all be done with the given python code inside the API Cookbook as well. In this case: I can't really send a sysml file directly to the local server (which is done by %publish to the test servers) but I can create, edit a project via json format (as shown in the recipes). Therefore I have to "rewrite" my sysml file so that I have the same json-ld format for sending it on my local server right?

The confusion is that the %publish command in Jupyter Notebook transforms a .sysml file to a JSON format. I was trying to get achieve kinda the same with more automation and custom GUI. Since working with the API directly I cant just send a .sysml file but have to map/translate the sysml file to JSON. Is that the intended way? How can I achieve the same when I just want to upload a .sysml file?

Another point is that for the JSON format (send request) there are no good documentation about how I can send/create a project with more content (in one example: project_data = {
"@type":"Project",
"name": project_name,
"description": "Spacecraft project with multiple commits, branches, and tags"
})
Where can I find a documentation about how the JSON has to look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants