From 28332d2eec630a2db3dadab6089e227a44edf635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Mon, 14 Dec 2020 16:39:32 +0000 Subject: [PATCH] DOC: Queries --- CHANGELOG.md | 1 + README_SETUP.md | 5 +- References_button.png | Bin 0 -> 3256 bytes model.svg | 632 ++++++++++++++++++++++++++++++ src/doc/index.rst | 2 +- src/doc/tutorials/first_steps.rst | 54 +++ src/doc/tutorials/index.rst | 2 +- src/doc/tutorials/query.rst | 143 +++++++ 8 files changed, 835 insertions(+), 4 deletions(-) create mode 100644 References_button.png create mode 100644 model.svg create mode 100644 src/doc/tutorials/query.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4911ac..358beda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 a xml representation of entities. * After a SELECT statement now also all referenced files can be downloaded. * Automated documentation builds: `make doc` +- documentation on queries ### Changed (for changes in existing functionality) diff --git a/README_SETUP.md b/README_SETUP.md index 8a2cd006..efad321c 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -22,6 +22,8 @@ --> # Getting Started with the Web Interface +Here, we document how to install and build the CaosDB Web Interface. If you are +only interested in how to use it, please continue [here](tutorials/first_steps.html) ## Folder Structure @@ -48,8 +50,7 @@ All files in that directory will be sourced during `make install` and `make test Thus any customized configuration can also be added to that folder by just placing files in there which override the default values from `00_default.properties`. -See `build.properties.d/00_default.properties` for more -information. +See `build.properties.d/00_default.properties` for more information. ## Setup diff --git a/References_button.png b/References_button.png new file mode 100644 index 0000000000000000000000000000000000000000..998ef42f7ccb17e32b0c88b8395c249b4529c97f GIT binary patch literal 3256 zcmeAS@N?(olHy`uVBq!ia0y~yV7SA;z+l6{#K6GNRO1}Nz`(#+;1OBOz`$?Cz`)<Z z=y*!}2Ll67mZytjNX4ADbE`vykINlb=Rd&l$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{;l-W+u>?qZuQYS++t_- zD+`qq-o3v|?*CY-ePwFUsoPcs+^<$?=RJFV^^t8bPou!GquI0SJ$5X<U9eYf=^okp tQv^;#Fou^XRI$&oX@4OLZ|eS$pSk@@-9-tGLktWI44$rjF6*2UngA>LH4y*+ literal 0 HcmV?d00001 diff --git a/model.svg b/model.svg new file mode 100644 index 00000000..2602cb43 --- /dev/null +++ b/model.svg @@ -0,0 +1,632 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + contentScriptType="application/ecmascript" + contentStyleType="text/css" + height="502" + preserveAspectRatio="none" + version="1.1" + viewBox="0 0 407 502" + width="407" + zoomAndPan="magnify" + id="svg233" + sodipodi:docname="model.svg" + inkscape:version="0.92.4 5da689c313, 2019-01-14"> + <metadata + id="metadata237"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1043" + id="namedview235" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="1.1817368" + inkscape:cx="112.55875" + inkscape:cy="257" + inkscape:window-x="1920" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg233" /> + <defs + id="defs11"> + <filter + height="3" + id="f64vrt8w3qxjw" + width="3" + x="-1" + y="-1"> + <feGaussianBlur + result="blurOut" + stdDeviation="2.0" + id="feGaussianBlur2" /> + <feColorMatrix + in="blurOut" + result="blurOut2" + type="matrix" + values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0" + id="feColorMatrix4" /> + <feOffset + dx="4.0" + dy="4.0" + in="blurOut2" + result="blurOut3" + id="feOffset6" /> + <feBlend + in="SourceGraphic" + in2="blurOut3" + mode="normal" + id="feBlend8" /> + </filter> + </defs> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.13385832;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4867" + width="407" + height="502" + x="0" + y="0" /> + <polygon + id="polygon13" + style="fill:#dddddd;stroke:#000000;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + points="533.5,526 126.5,526 126.5,24 236.5,24 243.5,46.2969 533.5,46.2969 " + transform="translate(-126.5,-24)" /> + <line + id="line15" + y2="22.296902" + y1="22.296902" + x2="117" + x1="0" + style="stroke:#000000;stroke-width:1.5" /> + <text + style="font-weight:bold;font-size:14px;font-family:sans-serif;fill:#000000" + id="text17" + y="38.995098" + x="130.5" + textLength="104" + lengthAdjust="spacingAndGlyphs" + font-weight="bold" + font-size="14" + transform="translate(-126.5,-24)">RecordTypes</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text42" + y="144.7104" + x="461" + textLength="0" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)" /> + <rect + y="411" + x="16" + width="116" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="Manufacturer" + height="60.804699" /> + <circle + r="11" + id="ellipse47" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="427" + cx="31" /> + <path + inkscape:connector-curvature="0" + id="path49" + d="m 33.9688,432.6406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text51" + y="455.1543" + x="171.5" + textLength="84" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">Manufacturer</text> + <line + id="line53" + y2="443" + y1="443" + x2="131" + x1="17" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text55" + y="481.21039" + x="152.5" + textLength="0" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)" /> + <line + id="line57" + y2="463.80469" + y1="463.80469" + x2="131" + x1="17" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <rect + y="235" + x="16" + width="174" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="MusicalInstrument" + height="101.6211" /> + <circle + r="11" + id="ellipse60" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="251" + cx="43.600006" /> + <path + inkscape:connector-curvature="0" + id="path62" + d="m 46.5688,256.6406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text64" + y="279.1543" + x="186.89999" + textLength="114" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">MusicalInstrument</text> + <line + id="line66" + y2="267" + y1="267" + x2="189" + x1="17" + style="stroke:#a80036;stroke-width:1.5" /> + <line + id="line68" + y2="281.40231" + y1="281.40231" + x2="73.5" + x1="17" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text70" + y="308.71039" + x="200" + textLength="59" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">Properties</text> + <line + id="line72" + y2="281.40231" + y1="281.40231" + x2="189" + x1="132.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text74" + y="341.2222" + x="148.5" + textLength="86" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">price (DOUBLE)</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text76" + y="354.02689" + x="148.5" + textLength="162" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">Manufacturer (Manufacturer)</text> + <line + id="line78" + y2="300.60941" + y1="300.60941" + x2="62" + x1="17" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text80" + y="327.91751" + x="188.5" + textLength="82" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">recommended</text> + <line + id="line82" + y2="300.60941" + y1="300.60941" + x2="189" + x1="144" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <rect + y="411" + x="167.5" + width="65" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="Violin" + height="60.804699" /> + <circle + r="11" + id="ellipse85" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="427" + cx="182.5" /> + <path + inkscape:connector-curvature="0" + id="path87" + d="m 185.4688,432.6406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text89" + y="455.1543" + x="323" + textLength="33" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">Violin</text> + <line + id="line91" + y2="443" + y1="443" + x2="231.5" + x1="168.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text93" + y="481.21039" + x="304" + textLength="0" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)" /> + <line + id="line95" + y2="463.80469" + y1="463.80469" + x2="231.5" + x1="168.5" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <rect + y="397" + x="267.5" + width="119" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="Guitar" + height="88.816399" /> + <circle + r="11" + id="ellipse98" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="413" + cx="304.54999" /> + <path + inkscape:connector-curvature="0" + id="path100" + d="m 307.5188,418.6406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text102" + y="441.1543" + x="449.95001" + textLength="38" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">Guitar</text> + <line + id="line104" + y2="429" + y1="429" + x2="385.5" + x1="268.5" + style="stroke:#a80036;stroke-width:1.5" /> + <line + id="line106" + y2="443.40231" + y1="443.40231" + x2="297.5" + x1="268.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text108" + y="470.71039" + x="424" + textLength="59" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">Properties</text> + <line + id="line110" + y2="443.40231" + y1="443.40231" + x2="385.5" + x1="356.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text112" + y="503.2222" + x="400" + textLength="107" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">electric (BOOLEAN)</text> + <line + id="line114" + y2="462.60941" + y1="462.60941" + x2="286" + x1="268.5" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text116" + y="489.91751" + x="412.5" + textLength="82" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">recommended</text> + <line + id="line118" + y2="462.60941" + y1="462.60941" + x2="385.5" + x1="368" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <rect + y="255.5" + x="225.5" + width="165" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="SoundQualityAnalyzer" + height="60.804699" /> + <circle + r="11" + id="ellipse121" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="271.5" + cx="240.5" /> + <path + inkscape:connector-curvature="0" + id="path123" + d="m 243.4688,277.1406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text125" + y="299.6543" + x="381" + textLength="133" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">SoundQualityAnalyzer</text> + <line + id="line127" + y2="287.5" + y1="287.5" + x2="389.5" + x1="226.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text129" + y="325.71039" + x="362" + textLength="0" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)" /> + <line + id="line131" + y2="308.30469" + y1="308.30469" + x2="389.5" + x1="226.5" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <rect + y="35" + x="20" + width="268" + style="fill:#fefece;stroke:#a80036;stroke-width:1.5;filter:url(#f64vrt8w3qxjw)" + id="Analysis" + height="140.0352" /> + <circle + r="11" + id="ellipse134" + style="fill:#ff1111;stroke:#a80036;stroke-width:1" + cy="51" + cx="124.75" /> + <path + inkscape:connector-curvature="0" + id="path136" + d="m 127.7188,56.6406 q -0.5782,0.2969 -1.2188,0.4375 -0.6406,0.1563 -1.3437,0.1563 -2.5,0 -3.8282,-1.6406 -1.3125,-1.6563 -1.3125,-4.7813 0,-3.125 1.3125,-4.7812 1.3282,-1.6563 3.8282,-1.6563 0.7031,0 1.3437,0.1563 0.6563,0.1562 1.2188,0.4531 v 2.7187 q -0.625,-0.5781 -1.2188,-0.8437 -0.5937,-0.2813 -1.2187,-0.2813 -1.3438,0 -2.0313,1.0782 -0.6875,1.0625 -0.6875,3.1562 0,2.0938 0.6875,3.1719 0.6875,1.0625 2.0313,1.0625 0.625,0 1.2187,-0.2656 0.5938,-0.2813 1.2188,-0.8594 z" /> + <text + style="font-size:12px;font-family:sans-serif;fill:#000000" + id="text138" + y="79.154297" + x="271.75" + textLength="50" + lengthAdjust="spacingAndGlyphs" + font-size="12" + transform="translate(-126.5,-24)">Analysis</text> + <line + id="line140" + y2="67" + y1="67" + x2="287" + x1="21" + style="stroke:#a80036;stroke-width:1.5" /> + <line + id="line142" + y2="81.402298" + y1="81.402298" + x2="124.5" + x1="21" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text144" + y="108.7104" + x="251" + textLength="59" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">Properties</text> + <line + id="line146" + y2="81.402298" + y1="81.402298" + x2="287" + x1="183.5" + style="stroke:#a80036;stroke-width:1.5" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text148" + y="141.2222" + x="152.5" + textLength="134" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">quality_factor (DOUBLE)</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text150" + y="154.0269" + x="152.5" + textLength="92" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">date (DATETIME)</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text152" + y="166.8315" + x="152.5" + textLength="111" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">report (REFERENCE)</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text154" + y="179.6362" + x="152.5" + textLength="256" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">SoundQualityAnalyzer (SoundQualityAnalyzer)</text> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text156" + y="192.4409" + x="152.5" + textLength="220" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">MusicalInstrument (MusicalInstrument)</text> + <line + id="line158" + y2="100.6094" + y1="100.6094" + x2="113" + x1="21" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <text + style="font-size:11px;font-family:sans-serif;fill:#000000" + id="text160" + y="127.9175" + x="239.5" + textLength="82" + lengthAdjust="spacingAndGlyphs" + font-size="11" + transform="translate(-126.5,-24)">recommended</text> + <line + id="line162" + y2="100.6094" + y1="100.6094" + x2="287" + x1="195" + style="stroke:#a80036;stroke-width:1;stroke-dasharray:1, 2" /> + <path + inkscape:connector-curvature="0" + style="fill:none;stroke:#a80036;stroke-width:1" + id="MusicalInstrument-Violin" + d="m 145.51,354.27 c 12.48,19.76 25.51,40.37 35.69,56.48" /> + <polygon + id="polygon211" + style="fill:none;stroke:#a80036;stroke-width:1" + points="261.26,361.26 277.86,374.43 266.03,381.91 " + transform="translate(-126.5,-24)" /> + <path + inkscape:connector-curvature="0" + style="fill:none;stroke:#a80036;stroke-width:1" + id="MusicalInstrument-Guitar" + d="m 192.64,348.42 c 25.04,17.17 51.64,35.39 74.51,51.06" /> + <polygon + id="polygon214" + style="fill:none;stroke:#a80036;stroke-width:1" + points="302.54,361.05 322.99,366.58 315.08,378.13 " + transform="translate(-126.5,-24)" /> + <path + inkscape:connector-curvature="0" + style="fill:none;stroke:#a80036;stroke-width:1" + id="MusicalInstrument-Manufacturer" + d="m 91.08,350.09 c -3.97,21 -8.2,43.41 -11.46,60.66" /> + <polygon + id="polygon217" + style="fill:#a80036;stroke:#a80036;stroke-width:1" + points="220,361.26 214.9551,366.4126 217.771,373.0512 222.8159,367.8986 " + transform="translate(-126.5,-24)" /> + <path + inkscape:connector-curvature="0" + style="fill:none;stroke:#a80036;stroke-width:1" + id="Analysis-SoundQualityAnalyzer" + d="m 222.3,185.39 c 21.35,24.82 43.61,50.69 60.09,69.84" /> + <polygon + id="polygon220" + style="fill:#a80036;stroke:#a80036;stroke-width:1" + points="340.04,199.21 340.9231,206.3668 347.869,208.3043 346.9859,201.1475 " + transform="translate(-126.5,-24)" /> + <path + inkscape:connector-curvature="0" + style="fill:none;stroke:#a80036;stroke-width:1" + id="Analysis-MusicalInstrument" + d="m 130.66,187.93 c -4.56,16 -9.21,32.33 -13.37,46.92" /> + <polygon + id="polygon223" + style="fill:#a80036;stroke:#a80036;stroke-width:1" + points="260.78,199.21 255.287,203.8819 257.4868,210.7493 262.9798,206.0774 " + transform="translate(-126.5,-24)" /> +</svg> diff --git a/src/doc/index.rst b/src/doc/index.rst index ac85c69f..d24e94bd 100644 --- a/src/doc/index.rst +++ b/src/doc/index.rst @@ -8,8 +8,8 @@ Welcome to the documentation of CaosDB's web UI! :hidden: Getting started <getting_started> + Tutorials <tutorials/index> Concepts <concepts> - tutorials/index API Index<genindex> diff --git a/src/doc/tutorials/first_steps.rst b/src/doc/tutorials/first_steps.rst index eb0a0427..48126b2a 100644 --- a/src/doc/tutorials/first_steps.rst +++ b/src/doc/tutorials/first_steps.rst @@ -24,10 +24,64 @@ can also translate the examples to the data model that you have at hand. +Main Menu (WIP) +--------------- +.. note:: + By default only 10 Entities are shown on one page. You can get to + other pages with the “Next Page” and “Previous Page” buttons. + +:math:`\Rightarrow` What are the differences between the options of the +“Entities” menu? + +Entities, Records, Properties…What? + + +- semantic data modeling + +- entries in LinkAhead are like Objects + +- RecordType: blue print for data + +- Record: actual data + + +See also the +`wiki <https://gitlab.com/caosdb/caosdb/wikis/Concepts/Data%20Model>`__ +or the `paper <https://www.mdpi.com/2306-5729/4/2/83>`__ + +|image| + +References in two directions + +- | References in LinkAhead are directed: + | A Record A references another Record B + +- The referencing Record A has a corresponding Property. + +- The referenced Record B does not. + +- In order to get referencing Records in the Web Interface, click on the following button + (or “Backref” on older systems). + +|image1| + +File System +----------- + +- Clicking on “File System” in the main menu allows you to browse files + that LinkAhead knows about. + +- Typically, most files will be mounted from some file server. + +.. note:: You will not find any Records in this view (that are not Files). + .. _here: https://gitlabio.something .. _`demo instance`: https://demo.indiscale.com .. _`IndiScale`: https://indiscale.com +.. |image| image:: model.svg +.. |image1| image:: References_button.png + :width: 4em diff --git a/src/doc/tutorials/index.rst b/src/doc/tutorials/index.rst index 35f3d0b7..2ac21fc8 100644 --- a/src/doc/tutorials/index.rst +++ b/src/doc/tutorials/index.rst @@ -10,4 +10,4 @@ This chapter contains tutorials. :hidden: first_steps - + query diff --git a/src/doc/tutorials/query.rst b/src/doc/tutorials/query.rst new file mode 100644 index 00000000..29d998cc --- /dev/null +++ b/src/doc/tutorials/query.rst @@ -0,0 +1,143 @@ + +Querying CaosDB +=============== + +You should have the web interface of a CaosDB instance at hand. If you do not +have one, you can visit https://demo.indiscale.com + +Introduction +------------ + +The semantic data model of CaosDB allows efficient data access. The +CaosDB Query Language (CQL) is used to search data. Queries can be entered in +the webinterface under the respective menu entry. + +Let's start with a simple one:: + + FIND RECORD MusicalInstrument + +Most queries simply start with the ``FIND`` keyword and describe what we are +looking for behind that. The ``RECORD`` keyword denotes that we are only looking +for Records (and not Files, Properties or RecordTypes). Finally, we provided +a RecordType name: MusicalInstrument. This means that we will get all Records +that have this RecordType as parent. Try it out! + +Let's look at:: + + FIND Guitar + +When we leave out the ``RECORD`` keyword, we will get every entity that is a +Guitar. When you submit this query you should find also a RecordType Guitar +in the results. Using ``FIND RecordType Guitar`` would restrict the result to +only that RecordType. + +Note, that you cannot only provide RecordType names after the ``FIND``, but names +in general: ``FIND RECORD Nice Guitar``. This will give you a Record with the +name "Nice Guitar" (if one exists... and there should be one in the demo instance). + +While it does not matter whether you use capital letters or not, the names have to +be exact. There are two features that make it easy to use names for querying +in spite of this: +- You can use "*" to match any string. E.g. ``FIND RECORD Nice*`` +- After typing three letters, names that start with those three are +suggested by the auto completion. + +.. note:: + + Train yourself by trying to guess what the result will be before + actually executing the query. + + +Searching Data Using Properties +-------------------------------- + +Looking for entities with certain names or such that have certain parents is +nice. However, the queries become really useful if we can impose further conditions +on the results. Let's start with an example again:: + + FIND Guitar with price > 10000 + +This should list expensive guitars where are in the demo instance. Thus, +we are using a property (the price) of the Guitar Records to restrict the +result set. In general this looks like:: + + FIND <Name> <Property Filter> + +Typically, the filter has the form ``<Property> <Operator> <Value>``, +for example ``length >= 0.7mm``. +There are many filters available. You can check the specification for a comprehensive description of +those. Here, we will only look at the most common examples. + + +If you only want to assure that Records have a certain Property, without imposing +constrains on the value, you can use:: + + FIND RECORD MusicalInstrument WITH Manufacturer + + +Similarly, to what we saw above when using incomplete names, you can use a "*" +to match parts of text properties:: + + FIND RECORD WITH serialNumber like KN* + +There is large number of operators that can be used together with dates or +timestamps. One of the most useful is probably:: + + FIND RECORD WITH date in 2019 + +A lot of valuable information is often stored in the relations among data, i.e. in +the references of entities. So how can we use those?:: + + FIND RECORD WHICH REFERENCES A Guitar + +This should be pretty self explanatory. And it is also possible to check for +references in the other direction:: + + FIND RECORD WHICH IS REFERENCED BY A Analysis + +You can also simply provide the ID of the entity:: + + FIND RECORD WHICH IS REFERENCED BY 123`` + + +Using Multiple Filters +---------------------- + +Often, one condition is not sufficient. Thus multiple filters/conditions can be combined. +This can for example be done using the following structure:: + + FIND <Name> <Property Filter> (AND|OR) <Property Filter> + +An example would be:: + + FIND Guitar WITH price>48 AND electric=TRUE + +Furthermore, reference conditions can be nested:: + + FIND <Name> WHICH REFERENCES <Name> WHICH REFERENCES <Name> + + +For example:: + + FIND Manufacturer WHICH IS REFERENCED BY Guitar WHICH IS REFERENCED BY Analysis + + +Restricting Result Information +------------------------------ + +Using ``COUNT`` instead of ``FIND`` will only return the number of +entities in the result set. + +.. note:: This is often useful when experimenting with queries. + +Using ``SELECT ... FROM`` instead of ``FIND`` returns specific +information in a table. A comma separated list of Property names can be provided behind the +``SELECT`` keyword:: + + SELECT price, electric FROM Guitar + +Or:: + + SELECT quality_factor, report, date FROM Analysis WHICH REFERENCES A Guitar WITH electric=TRUE + + -- GitLab