Skip to content

Commit 6b6e058

Browse files
committed
Hugo rebuild all branches
1 parent 0f6bb39 commit 6b6e058

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+483
-343
lines changed

published/basic/1/index.html

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,15 @@
588588
<h1 class="lesson-heading">Hello World</h1>
589589

590590
<div>
591-
<div class="notices note" >
592-
<span class="type">Note</span>
593-
For the following queries to run, you should have loaded data in the [introduction](../../intro/3/).
591+
592+
593+
594+
<div class="notices note" >
595+
<span class="type">Note</span> <p>For the following queries to run, you should have loaded data in the <a href="../../intro/3/">introduction</a>.</p>
594596

595597
</div>
596598

599+
597600
<p>Let’s have a look at a hello world query in GraphQL+-.</p>
598601

599602
<p>Every query has a name, and the result is labelled with the same name.</p>
@@ -606,37 +609,40 @@ <h1 class="lesson-heading">Hello World</h1>
606609
<p>Something to try : Change the query to select someone else.
607610
You can check the <a href="../../intro/4">sample data</a> again.</p>
608611

612+
609613
<div class="expandable">
610614
<a data-action="toggle-expandable" href="#expand">
611615
<i class="fa fa-caret-down"></i> Show answer
612616
</a>
613617
<div class="expandable-content">
614-
615-
Find a name in the data and try
616-
```
617-
{
618-
find_someone(func: eq(name, "...name in here...")) {
618+
<p>Find a name in the data and try</p>
619+
620+
<pre><code>{
621+
find_someone(func: eq(name, &quot;...name in here...&quot;)) {
619622
name
620623
age
621624
}
622625
}
623-
```
624-
Or look at the `UID`s in the data and try
625-
```
626-
{
626+
</code></pre>
627+
628+
<p>Or look at the <code>UID</code>s in the data and try</p>
629+
630+
<pre><code>{
627631
find_someone(func: uid(...uid number here...)) {
628632
name
629633
age
630634
}
631635
}
632-
```
633-
You can edit the queries and try whatever you like. When there are
636+
</code></pre>
637+
638+
<p>You can edit the queries and try whatever you like. When there are
634639
answers like this, cut and paste them into the query panel, then edit and
635-
run them.
640+
run them.</p>
636641

637642
</div>
638643
</div>
639644

645+
640646
<p>The tutorial will handle the running of the query for you, so
641647
just focus on the query text. You can also learn about <a href="https://docs.dgraph.io/get-started/#step-3-run-queries">posting
642648
queries</a> or <a href="https://docs.dgraph.io/clients/">programming with Dgraph</a>.</p>

published/basic/11/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,13 @@ <h1 class="lesson-heading">How Dgraph Search Works</h1>
601601
<p>The root <code>func:</code> only accepts a single function and doesn&rsquo;t accept <code>AND</code>, <code>OR</code> and <code>NOT</code> connectives as in filters. So the syntax <code>query_name(func: foo(...)) @filter(... AND ...) {...}</code> is required when further filtering on the elements returned by the root function is required.</p>
602602

603603
<p>Something to try: Find all people who are in their 20s, and have at least 2 friends.
604+
604605
<div class="expandable">
605606
<a data-action="toggle-expandable" href="#expand">
606607
<i class="fa fa-caret-down"></i> Show answer
607608
</a>
608-
<div class="expandable-content"></p>
609-
610-
<pre><code>{
609+
<div class="expandable-content">
610+
<pre><code>{
611611
lots_of_friends(func: ge(count(friend), 2)) @filter(ge(age, 20) AND lt(age, 30)) {
612612
name@.
613613
age
@@ -618,8 +618,9 @@ <h1 class="lesson-heading">How Dgraph Search Works</h1>
618618
}
619619
</code></pre>
620620

621-
<p></div>
622-
</div></p>
621+
</div>
622+
</div>
623+
</p>
623624

624625
</div>
625626
</div>

published/basic/15/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,15 @@ <h1 class="lesson-heading">Normalize</h1>
596596
<li><p>flattens the result to remove nesting</p></li>
597597
</ul>
598598

599+
600+
601+
599602
<div class="notices tip" >
600-
<span class="type">Tip</span>
601-
Aliased names can be the same as the original edge.
603+
<span class="type">Tip</span> <p>Aliased names can be the same as the original edge.</p>
602604

603605
</div>
604606

607+
605608
</div>
606609
</div>
607610

published/basic/17/index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -610,13 +610,13 @@ <h1 class="lesson-heading">Facets : Edge attributes</h1>
610610
<p>For JSON mutation with Facets see: <a href="https://docs.dgraph.io/mutations/#facets">https://docs.dgraph.io/mutations/#facets</a></p>
611611

612612
<p>Run this mutation on you terminal, before running the query:
613+
613614
<div class="expandable">
614615
<a data-action="toggle-expandable" href="#expand">
615616
<i class="fa fa-caret-down"></i> Show answer
616617
</a>
617-
<div class="expandable-content"></p>
618-
619-
<pre><code>curl -H &quot;Content-Type: application/rdf&quot; localhost:8080/mutate?commitNow=true -XPOST -d $'
618+
<div class="expandable-content">
619+
<pre><code>curl -H &quot;Content-Type: application/rdf&quot; localhost:8080/mutate?commitNow=true -XPOST -d $'
620620
{
621621
set {
622622

@@ -658,8 +658,9 @@ <h1 class="lesson-heading">Facets : Edge attributes</h1>
658658
}' | python -m json.tool | less
659659
</code></pre>
660660

661-
<p></div>
662-
</div></p>
661+
</div>
662+
</div>
663+
</p>
663664

664665
<h3 id="add-multiple-attributes-to-a-third-single-node">Add multiple attributes to a third single node</h3>
665666

@@ -673,19 +674,20 @@ <h3 id="add-multiple-attributes-to-a-third-single-node">Add multiple attributes
673674
</code></pre>
674675

675676
<p>more example:
677+
676678
<div class="expandable">
677679
<a data-action="toggle-expandable" href="#expand">
678680
<i class="fa fa-caret-down"></i> Show answer
679681
</a>
680-
<div class="expandable-content"></p>
681-
682-
<pre><code>_:MyNode &lt;Morning&gt; &lt;0x0f43&gt; ( foo=true, and=1 , since=2006-02-02T13:01:09 ) .
682+
<div class="expandable-content">
683+
<pre><code>_:MyNode &lt;Morning&gt; &lt;0x0f43&gt; ( foo=true, and=1 , since=2006-02-02T13:01:09 ) .
683684
_:MyNode &lt;Evening&gt; &lt;0x0f43&gt; ( bar=false, and=2, since=2006-02-02T13:01:09 ) .
684685
_:MyNode &lt;Night&gt; &lt;0x22&gt; ( bar=true, and=3, since=2006-02-02T13:01:09 ) .
685686
</code></pre>
686687

687-
<p></div>
688-
</div></p>
688+
</div>
689+
</div>
690+
</p>
689691

690692
<p>If you do the same mutation above but using the same predicates instead of unique one. You gonna override the Edge attribute. Line by line. So you must to use distinct predicates.</p>
691693

published/basic/2/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,14 @@ <h1 class="lesson-heading">Graphs as results</h1>
601601
<p>Something to try : Michael also owns a pet, find it and its <code>name</code>. The
602602
<code>owns_pet</code> edge will help here.</p>
603603

604+
604605
<div class="expandable">
605606
<a data-action="toggle-expandable" href="#expand">
606607
<i class="fa fa-caret-down"></i> Show answer
607608
</a>
608609
<div class="expandable-content">
609-
610-
```
611-
{
612-
michaels_pet(func: eq(name, "Michael")) {
610+
<pre><code>{
611+
michaels_pet(func: eq(name, &quot;Michael&quot;)) {
613612
name
614613
age
615614
friend {
@@ -620,11 +619,12 @@ <h1 class="lesson-heading">Graphs as results</h1>
620619
}
621620
}
622621
}
623-
```
624-
622+
</code></pre>
623+
625624
</div>
626625
</div>
627626

627+
628628
</div>
629629
</div>
630630

published/basic/5/index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,16 @@ <h1 class="lesson-heading">Queries describe graphs</h1>
604604
<p>Something to try: How about Michael’s friends&rsquo; pets, or Michael&rsquo;s
605605
friends&rsquo; friends.</p>
606606

607+
607608
<div class="expandable">
608609
<a data-action="toggle-expandable" href="#expand">
609610
<i class="fa fa-caret-down"></i> Show answer
610611
</a>
611612
<div class="expandable-content">
612-
613-
Query Michael's friends' pets:
613+
<p>Query Michael&rsquo;s friends&rsquo; pets:</p>
614614

615-
```
616-
{
617-
michael_friends_pets(func: eq(name, "Michael")) {
615+
<pre><code>{
616+
michael_friends_pets(func: eq(name, &quot;Michael&quot;)) {
618617
name
619618
age
620619
friend {
@@ -625,12 +624,12 @@ <h1 class="lesson-heading">Queries describe graphs</h1>
625624
}
626625
}
627626
}
628-
```
627+
</code></pre>
629628

630-
Query Michael's friends' friends:
631-
```
632-
{
633-
michael_friends_friends(func: allofterms(name, "Michael")) {
629+
<p>Query Michael&rsquo;s friends&rsquo; friends:</p>
630+
631+
<pre><code>{
632+
michael_friends_friends(func: allofterms(name, &quot;Michael&quot;)) {
634633
name
635634
age
636635
friend {
@@ -641,11 +640,12 @@ <h1 class="lesson-heading">Queries describe graphs</h1>
641640
}
642641
}
643642
}
644-
```
643+
</code></pre>
645644

646645
</div>
647646
</div>
648647

648+
649649
<p>The idea is to formulate the query as a traversal
650650
through the graph, following edges to the desired data. The <code>uid</code>&rsquo;s in the JSON output allow
651651
interpretation as a graph rather than a tree. See, for example, the

published/basic/index.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<pubDate>Wed, 26 Apr 2017 22:36:18 +1000</pubDate>
1818

1919
<guid>https://tour.dgraph.io/basic/1/</guid>
20-
<description>Note For the following queries to run, you should have loaded data in the [introduction](../../intro/3/). Let’s have a look at a hello world query in GraphQL+-.
20+
<description>Note For the following queries to run, you should have loaded data in the introduction.
21+
Let’s have a look at a hello world query in GraphQL+-.
2122
Every query has a name, and the result is labelled with the same name.
2223
The search criteria func: ... matches nodes. Function eq does what you&amp;rsquo;d expect, matching nodes with a name equalling &amp;ldquo;Michael&amp;rdquo;. The result is the matched nodes and listed outgoing edges from those nodes.</description>
2324
</item>
@@ -171,7 +172,8 @@ In the query below, Dgraph returns all Michael&amp;rsquo;s friends, and only the
171172
<description>The @normalize directive
172173
returns only edges listed with an alias, and
173174
flattens the result to remove nesting
174-
Tip Aliased names can be the same as the original edge. </description>
175+
Tip Aliased names can be the same as the original edge.
176+
</description>
175177
</item>
176178

177179
<item>

published/blocksvars/1/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,15 @@
588588
<h1 class="lesson-heading">Multiple Named Query Blocks</h1>
589589

590590
<div>
591-
<div class="notices note" >
592-
<span class="type">Note</span>
593-
From now on, to run the queries, you'll need to have loaded the [million triple movie dataset](../../moredata/1/).
591+
592+
593+
594+
<div class="notices note" >
595+
<span class="type">Note</span> <p>From now on, to run the queries, you&rsquo;ll need to have loaded the <a href="../../moredata/1/">million triple movie dataset</a>.</p>
594596

595597
</div>
596598

599+
597600
<p>Queries can be issued as multiples.</p>
598601

599602
<p>For queries labelled <code>q1, ..., qn</code> issued as a multiple query block, the JSON

published/blocksvars/11/index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,13 @@ <h1 class="lesson-heading">Exercise : Latest Movies</h1>
591591
<p>Write a query to find the most recently released movie by each director and order the result by the release dates.</p>
592592

593593
<p>If you need some hints try:
594+
594595
<div class="expandable">
595596
<a data-action="toggle-expandable" href="#expand">
596597
<i class="fa fa-caret-down"></i> Show answer
597598
</a>
598-
<div class="expandable-content"></p>
599-
600-
<p>To solve this, you&rsquo;ll need to</p>
599+
<div class="expandable-content">
600+
<p>To solve this, you&rsquo;ll need to</p>
601601

602602
<ul>
603603
<li>work out how to query for all directors - what have directors done that make them directors?</li>
@@ -608,17 +608,18 @@ <h1 class="lesson-heading">Exercise : Latest Movies</h1>
608608
<li>for something extra, try using <code>since</code> to work out how many days since the movie was released (or how many days till release, for some)</li>
609609
</ul>
610610

611-
<p></div>
612-
</div></p>
611+
</div>
612+
</div>
613+
</p>
613614

614615
<p>Spoiler alert:
616+
615617
<div class="expandable">
616618
<a data-action="toggle-expandable" href="#expand">
617619
<i class="fa fa-caret-down"></i> Show answer
618620
</a>
619-
<div class="expandable-content"></p>
620-
621-
<pre><code>{ # Get all directors
621+
<div class="expandable-content">
622+
<pre><code>{ # Get all directors
622623
var(func: has(director.film)) @cascade {
623624
director.film {
624625
date as initial_release_date
@@ -642,8 +643,9 @@ <h1 class="lesson-heading">Exercise : Latest Movies</h1>
642643
}
643644
</code></pre>
644645

645-
<p></div>
646-
</div></p>
646+
</div>
647+
</div>
648+
</p>
647649

648650
</div>
649651
</div>

published/blocksvars/6/index.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -601,23 +601,22 @@ <h1 class="lesson-heading">Exercise: Query Variables linking queries</h1>
601601
<p>As an optional challenge, for each
602602
of those actors list the movies they have made with either director.</p>
603603

604+
604605
<div class="expandable">
605606
<a data-action="toggle-expandable" href="#expand">
606607
<i class="fa fa-caret-down"></i> Show answer
607608
</a>
608609
<div class="expandable-content">
609-
610-
```
611-
{
612-
var(func: allofterms(name@en, "Peter Jackson")) {
610+
<pre><code>{
611+
var(func: allofterms(name@en, &quot;Peter Jackson&quot;)) {
613612
F_PJ as director.film {
614613
starring{
615614
A_PJ as performance.actor
616615
}
617616
}
618617
}
619618

620-
var(func: allofterms(name@en, "Martin Scorsese")) {
619+
var(func: allofterms(name@en, &quot;Martin Scorsese&quot;)) {
621620
F_MS as director.film {
622621
starring{
623622
A_MS as performance.actor
@@ -634,12 +633,14 @@ <h1 class="lesson-heading">Exercise: Query Variables linking queries</h1>
634633
}
635634
}
636635
}
637-
```
638-
The syntax `uid(F_PJ, F_MS)` means the UIDs in either `F_PJ` or `F_MS` and is equivalent to `uid(F_PJ) OR uid(F_MS)`.
636+
</code></pre>
637+
638+
<p>The syntax <code>uid(F_PJ, F_MS)</code> means the UIDs in either <code>F_PJ</code> or <code>F_MS</code> and is equivalent to <code>uid(F_PJ) OR uid(F_MS)</code>.</p>
639639

640640
</div>
641641
</div>
642642

643+
643644
</div>
644645
</div>
645646

0 commit comments

Comments
 (0)