Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Octave library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Octave library
Commits
c4b43e99
Verified
Commit
c4b43e99
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Jupyter notebook for the first step with caosdb
parent
9b2f636c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#24353
failed
2 years ago
Stage: setup
Stage: test
Stage: deploy
Changes
1
Pipelines
118
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/notebooks/Live Demo CaosDB Octave.ipynb
+101
-0
101 additions, 0 deletions
doc/notebooks/Live Demo CaosDB Octave.ipynb
with
101 additions
and
0 deletions
doc/notebooks/Live Demo CaosDB Octave.ipynb
0 → 100644
+
101
−
0
View file @
c4b43e99
{
"cells": [
{
"cell_type": "markdown",
"id": "b165f725",
"metadata": {},
"source": [
"# Live demo: Octave's CaosDB package"
]
},
{
"cell_type": "markdown",
"id": "11f407ec",
"metadata": {},
"source": [
"## Load & connect\n",
"Let's load the CaosDB package, connect to the server and get some information about the server."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f7ad7c18",
"metadata": {},
"outputs": [],
"source": [
"pkg load caosdb;\n",
"c = Caosdb();\n",
"c.info()"
]
},
{
"cell_type": "markdown",
"id": "c77f09e5",
"metadata": {},
"source": [
"## Execute a query\n",
"The demo CaosDB contains a number of musical instruments and analyses about the instruments. Let's find an instrument that was not too cheap."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2273ac0d",
"metadata": {},
"outputs": [],
"source": [
"result = c.query(\"FIND MusicalInstrument WITH price > 2022 €\");\n",
"instrument_3 = result{3}"
]
},
{
"cell_type": "markdown",
"id": "07ec19e7",
"metadata": {},
"source": [
"## Further inspect the instrument\n",
"Records from CaosDB may contain properties. We want to find out how expensive the instrument actually was."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aa1fd55b",
"metadata": {},
"outputs": [],
"source": [
"price = instrument_3.get_properties_as_struct().price"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Octave",
"language": "octave",
"name": "octave"
},
"language_info": {
"file_extension": ".m",
"help_links": [
{
"text": "GNU Octave",
"url": "https://www.gnu.org/software/octave/support.html"
},
{
"text": "Octave Kernel",
"url": "https://github.com/Calysto/octave_kernel"
},
{
"text": "MetaKernel Magics",
"url": "https://metakernel.readthedocs.io/en/latest/source/README.html"
}
],
"mimetype": "text/x-octave",
"name": "octave",
"version": "6.2.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:markdown id:b165f725 tags:
# Live demo: Octave's CaosDB package
%% Cell type:markdown id:11f407ec tags:
## Load & connect
Let's load the CaosDB package, connect to the server and get some information about the server.
%% Cell type:code id:f7ad7c18 tags:
```
octave
pkg load caosdb;
c = Caosdb();
c.info()
```
%% Cell type:markdown id:c77f09e5 tags:
## Execute a query
The demo CaosDB contains a number of musical instruments and analyses about the instruments. Let's find an instrument that was not too cheap.
%% Cell type:code id:2273ac0d tags:
```
octave
result = c.query("FIND MusicalInstrument WITH price > 2022 €");
instrument_3 = result{3}
```
%% Cell type:markdown id:07ec19e7 tags:
## Further inspect the instrument
Records from CaosDB may contain properties. We want to find out how expensive the instrument actually was.
%% Cell type:code id:aa1fd55b tags:
```
octave
price = instrument_3.get_properties_as_struct().price
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment