From 82af1c5bdb39d054246ab32e217d339e0b04bb23 Mon Sep 17 00:00:00 2001 From: raphael-istari Date: Wed, 29 Oct 2025 12:18:27 -0700 Subject: [PATCH 1/2] add hmtltest and change runnable Runnable executes query against play.dgraph.io which not available anymore. Change the shortcode to only display the code sample with different clients. Keep the original shortcode to reactivate it later. --- .gitignore | 2 + .htmltest.yml | 14 ++ content/dql/predicate-indexing.md | 1 - themes/hugo-docs/layouts/partials/footer.html | 1 - .../layouts/shortcodes/runnable-original.html | 129 ++++++++++++++++++ .../layouts/shortcodes/runnable.html | 97 ++----------- 6 files changed, 156 insertions(+), 88 deletions(-) create mode 100644 .htmltest.yml create mode 100644 themes/hugo-docs/layouts/shortcodes/runnable-original.html diff --git a/.gitignore b/.gitignore index 560dd7ee..edfd401f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .DS_Store *.lock static/images/.DS_Store +tmp/.htmltest/htmltest.log +tmp/.htmltest/refcache.json diff --git a/.htmltest.yml b/.htmltest.yml new file mode 100644 index 00000000..0d984190 --- /dev/null +++ b/.htmltest.yml @@ -0,0 +1,14 @@ +DirectoryPath: "public/" +CheckDoctype: true +CheckExternal: true +CheckInternalHash: true +IgnoreDirectoryMissingTrailingSlash: true +IgnoreAltMissing: true +IgnoreURLs: + - "https://fonts.googleapis.com" + - "https://cdnjs.cloudflare.com" +ExternalTimeout: 15 +HTTPHeaders: + - url: ".*" + headers: + User-Agent: "Mozilla/5.0 (compatible; htmltest)" \ No newline at end of file diff --git a/content/dql/predicate-indexing.md b/content/dql/predicate-indexing.md index 25a9dc1b..f207e016 100644 --- a/content/dql/predicate-indexing.md +++ b/content/dql/predicate-indexing.md @@ -55,7 +55,6 @@ The indices available for `float32vector` are as follows. | `similar_to` | `hnsw` | HNSW index supports parameters `metric` and `exponent`. | -# `hnsw` (**Hierarchical Navigable Small World**) index supports the following parameters - metric : indicate the metric to use to compute vector similarity. One of `cosine`, `euclidean`, and `dotproduct`. Default is `euclidean`. diff --git a/themes/hugo-docs/layouts/partials/footer.html b/themes/hugo-docs/layouts/partials/footer.html index 3f2a09f8..18ddd568 100644 --- a/themes/hugo-docs/layouts/partials/footer.html +++ b/themes/hugo-docs/layouts/partials/footer.html @@ -206,7 +206,6 @@ - diff --git a/themes/hugo-docs/layouts/shortcodes/runnable-original.html b/themes/hugo-docs/layouts/shortcodes/runnable-original.html new file mode 100644 index 00000000..4335dcb8 --- /dev/null +++ b/themes/hugo-docs/layouts/shortcodes/runnable-original.html @@ -0,0 +1,129 @@ +{{ $code := trim .Inner "\n" }} +{{ $checksum := md5 $code }} + +
+
+
+
+
+
+ +
+
+ +
+
+ Run +
+
+
+
+ +
+
+
+ + Editing query... + +
+
+
+ +
+ +
+
+
{{ $code }}
+ +
+ +
+ +
+ +
+ {{ partial "example-curl" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-go-grpc" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-java" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-python" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-js-grpc" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-js-http" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} +
+
+ + +
+
+ +
+
+
+
+ + Response + +
+
+ +
+
+
+ + + +
+
+
+
+
diff --git a/themes/hugo-docs/layouts/shortcodes/runnable.html b/themes/hugo-docs/layouts/shortcodes/runnable.html index 4335dcb8..1ac47e86 100644 --- a/themes/hugo-docs/layouts/shortcodes/runnable.html +++ b/themes/hugo-docs/layouts/shortcodes/runnable.html @@ -1,16 +1,14 @@ {{ $code := trim .Inner "\n" }} -{{ $checksum := md5 $code }} -
+
-
+
-
-
+
-
-
- Run -
-
-
-
- -
-
-
- - Editing query... - -
-
{{ $code }}
- -
- -
-
- {{ partial "example-curl" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} + {{ partial "example-curl" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }}
- {{ partial "example-go-grpc" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} + {{ partial "example-go-grpc" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }} +
+
+ {{ partial "example-java" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }}
-
- {{ partial "example-java" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} -
- {{ partial "example-python" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} + {{ partial "example-python" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }}
- {{ partial "example-js-grpc" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} + {{ partial "example-js-grpc" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }}
- {{ partial "example-js-http" ( dict "Content" . "Code" "blahblah" "Vars" ( .Get "vars" ) ) }} + {{ partial "example-js-http" ( dict "Content" . "Code" $code "Vars" ( .Get "vars" ) ) }}
- - -
-
- -
-
-
-
- - Response - -
-
- -
-
-
- - -
From 549e2915d47770991be58aad8afd966d381fd156 Mon Sep 17 00:00:00 2001 From: raphael-istari Date: Wed, 29 Oct 2025 14:49:09 -0700 Subject: [PATCH 2/2] correct links --- .htmltest.yml | 14 ++++-- content/deploy/_index.md | 10 +--- content/deploy/admin/dgraph-administration.md | 10 ++-- content/deploy/admin/dgraph-alpha.md | 2 +- content/deploy/admin/tracing.md | 8 ++-- .../deploy/installation/single-host-setup.md | 2 +- content/dgraph-glossary.md | 2 +- content/dgraph-overview.md | 4 +- content/dql/clients/csharp.md | 6 --- content/dql/clients/go.md | 16 ------- content/dql/clients/java.md | 14 +----- content/dql/clients/javascript/grpc.md | 19 +------- content/dql/clients/javascript/http.md | 28 +---------- content/dql/clients/python.md | 15 +----- content/dql/dql-get-started.md | 6 +-- content/dql/dql-schema.md | 12 ++--- content/dql/dql-syntax/dql-rdf.md | 4 +- content/dql/predicate-indexing.md | 4 +- content/graphql-dql/dql-for-graphql.md | 2 +- content/graphql/custom/mutation.md | 2 +- content/howto/update-dgraph-types.md | 2 + .../data-engineer/data-model-101/_index.md | 7 --- .../tutorial-1/index.md | 12 ++--- .../tutorial-2/index.md | 24 +++++----- .../tutorial-3/index.md | 46 +++++++++---------- .../tutorial-4/index.md | 28 +++++------ .../tutorial-5/index.md | 40 ++++++++-------- .../tutorial-6/index.md | 20 ++++---- .../tutorial-7/index.md | 12 ++--- .../tutorial-8/index.md | 26 +++++------ content/learn/developer/react/_index.md | 1 - .../learn/developer/react/react-conclusion.md | 18 +------- .../todo-app-tutorial/todo-deploy.md | 1 + .../todo-app-tutorial/todo-overview.md | 2 +- htmltest.log | 2 + public/_redirects | 8 ---- refcache.json | 1 + scripts/linkcheck.sh | 37 +++++++++++++++ 38 files changed, 193 insertions(+), 274 deletions(-) create mode 100644 htmltest.log delete mode 100644 public/_redirects create mode 100644 refcache.json create mode 100644 scripts/linkcheck.sh diff --git a/.htmltest.yml b/.htmltest.yml index 0d984190..db836238 100644 --- a/.htmltest.yml +++ b/.htmltest.yml @@ -1,14 +1,18 @@ -DirectoryPath: "public/" +DirectoryPath: "public" CheckDoctype: true CheckExternal: true CheckInternalHash: true IgnoreDirectoryMissingTrailingSlash: true IgnoreAltMissing: true +IgnoreEmptyHref: true +IgnoreInternalEmptyHash: true IgnoreURLs: - "https://fonts.googleapis.com" - "https://cdnjs.cloudflare.com" + - "https://www.npmjs.com/package/@grpc/grpc-js" + - "https://www.npmjs.com/package/apollo-client" + - "http://localhost:*" + - "/livereload.js" + - ".*livereload.*" + - "^#$" ExternalTimeout: 15 -HTTPHeaders: - - url: ".*" - headers: - User-Agent: "Mozilla/5.0 (compatible; htmltest)" \ No newline at end of file diff --git a/content/deploy/_index.md b/content/deploy/_index.md index 162a5226..75f52391 100644 --- a/content/deploy/_index.md +++ b/content/deploy/_index.md @@ -8,16 +8,8 @@ aliases = ["/deploy/overview"] identifier = "deploy" +++ -You can deploy and manage Dgraph database in a variety of self-managed deployment scenarios, including: +You can deploy and manage Dgraph database in a variety of self-managed deployment scenarios. -* Running Dgraph on your on-premises infrastructure (bare-metal physical servers) -* Running Dgraph on your cloud infrastructure (AWS, GCP and Azure) - -This section focuses exclusively on deployment and management for these self-managed -scenarios. To learn about fully-managed options that let you focus on -building apps and websites, rather than managing infrastructure, see the -[Dgraph cloud services docs](https://dgraph.io/docs/cloud/), or -[Try Dgraph Cloud](https://cloud.dgraph.io/). A Dgraph cluster consists of the following: diff --git a/content/deploy/admin/dgraph-administration.md b/content/deploy/admin/dgraph-administration.md index 145bb43b..59224ee8 100644 --- a/content/deploy/admin/dgraph-administration.md +++ b/content/deploy/admin/dgraph-administration.md @@ -201,11 +201,11 @@ When the new cluster (that uses the upgraded version of Dgraph) is up and runnin ### Upgrade from v1.2.2 to v20.03.0 for Enterprise customers -1. Use [binary backup]({{< relref "enterprise-features/binary-backups.md">}}) to export data from old cluster +1. Use [binary backup]({{< relref "binary-backups.md">}}) to export data from old cluster 2. Ensure it is successful 3. [Shutdown Dgraph]({{< relref "#shut-down-database" >}}) and wait for all writes to complete 4. Upgrade `dgraph` binary to `v20.03.0` -5. [Restore]({{< relref "enterprise-features/binary-backups.md#restore-from-backup">}}) from the backups using upgraded `dgraph` binary +5. Restore from the backups using upgraded `dgraph` binary 6. Start a new Dgraph cluster using the restored data directories 7. Upgrade ACL data using the following command: @@ -219,7 +219,7 @@ dgraph upgrade --acl -a localhost:9080 -u groot -p password 2. Ensure it is successful 3. [Shutdown Dgraph]({{< relref "#shut-down-database" >}}) and wait for all writes to complete 4. Upgrade `dgraph` binary to `v20.07.0` -5. [Restore]({{< relref "enterprise-features/binary-backups.md#restore-from-backup">}}) from the backups using upgraded `dgraph` binary +5. Restore from the backups using upgraded `dgraph` binary 6. Start a new Dgraph cluster using the restored data directories 7. Upgrade ACL data using the following command: ```sh @@ -244,7 +244,7 @@ are affected. Then, you can drop the old types and predicates from DB. 2. Ensure it is successful 3. [Shutdown Dgraph]({{< relref "#shut-down-database" >}}) and wait for all writes to complete 4. Upgrade `dgraph` binary to `v21.03.0` -5. [Restore]({{< relref "enterprise-features/binary-backups.md#restore-from-backup">}}) from the backups using the upgraded `dgraph` binary +5. Restore from the backups using the upgraded `dgraph` binary 6. Start a new Dgraph cluster using the restored data directories 7. Upgrade the CORS and persisted queries. To upgrade an ACL cluster use: ```sh @@ -268,4 +268,4 @@ as backup and restore are cluster-wide operations and a single namespace cannot ## Post Installation -Now that Dgraph is up and running, to understand how to add and query data to Dgraph, follow [Query Language Spec](/query-language). Also, have a look at [Frequently asked questions](/faq). +Now that Dgraph is up and running, to understand how to add and query data to Dgraph, follow [Query Language Spec](/query-language). diff --git a/content/deploy/admin/dgraph-alpha.md b/content/deploy/admin/dgraph-alpha.md index afbe0456..16e7ffc0 100644 --- a/content/deploy/admin/dgraph-alpha.md +++ b/content/deploy/admin/dgraph-alpha.md @@ -92,7 +92,7 @@ query { - **`group`**: Group assigned based on the replication factor. - **`lastEcho`**: Last time, in Unix epoch, when the instance was contacted by another Alpha or Zero server. - **`ongoing`**: List of ongoing operations in the background. -- **`indexing`**: List of predicates for which indexes are built in the background. Read more [here]({{< relref "/dql/dql-schema.md#indexes-in-background" >}}). +- **`indexing`**: List of predicates for which indexes are built in the background. {{% notice "note" %}} The same information (except `ongoing` and `indexing`) is available from the `/health` and `/health?all` HTTP endpoints. diff --git a/content/deploy/admin/tracing.md b/content/deploy/admin/tracing.md index 640695e2..ef45344a 100644 --- a/content/deploy/admin/tracing.md +++ b/content/deploy/admin/tracing.md @@ -32,16 +32,16 @@ You can run multiple Jaeger collector components for the same single Jaeger back Once you have this configured, you can filter by tags in the Jaeger UI. Filter traces by tags matching `env=dev`: -{{% load-img "/images/jaeger-ui.png" "Jaeger UI" %}} +{{% load-img "images/jaeger-ui.png" "Jaeger UI" %}} Every trace has your custom tags set under the “Process” section of each span: -{{% load-img "/images/jaeger-server-query.png" "Jaeger Query" %}} +{{% load-img "images/jaeger-server-query.png" "Jaeger Query" %}} Filter traces by tags matching `env=qa`: -{{% load-img "/images/jaeger-json.png" "Jaeger JSON" %}} +{{% load-img "images/jaeger-json.png" "Jaeger JSON" %}} -{{% load-img "/images/jaeger-server-query-2.png" "Jaeger Query Result" %}} +{{% load-img "images/jaeger-server-query-2.png" "Jaeger Query Result" %}} To learn more about Jaeger, see [Jaeger's Deployment Guide](https://www.jaegertracing.io/docs/deployment/). \ No newline at end of file diff --git a/content/deploy/installation/single-host-setup.md b/content/deploy/installation/single-host-setup.md index dc40a9bc..17bd4cc1 100644 --- a/content/deploy/installation/single-host-setup.md +++ b/content/deploy/installation/single-host-setup.md @@ -63,7 +63,7 @@ The command should return basic cluster information: ``` ### Connect Ratel -Ratel is a web-based UI dashboard for interacting with Dgraph using Dgraph's query language,[DQL](./glossary#DQL). +Ratel is a web-based UI dashboard for interacting with Dgraph using Dgraph's query language, [DQL]({{}}). Optionnaly, launch Ratel using the dgraph/ratel docker image : diff --git a/content/dgraph-glossary.md b/content/dgraph-glossary.md index 1fb3ed16..c556cb52 100644 --- a/content/dgraph-glossary.md +++ b/content/dgraph-glossary.md @@ -67,7 +67,7 @@ A relationship is a named, directed link relating one [node](#node) to another. Sharding is a database architecture pattern to achieve horizontal scale by distributing data among many servers. Dgraph shards data per relationship, so all data for one relationship form a single shard, and are stored on one (group of) servers, an approach referred to as 'predicate-based sharding'. ### Triple ### -Because RDF statements consist of three elements: , they are called triples. A triple represents a single atomic statement about a node. The object in an RDF triple can be a literal value or can point to another node. See [DQL RDF Syntax]("/dql/dql-syntax/dql-rdf") for more details. +Because RDF statements consist of three elements: , they are called triples. A triple represents a single atomic statement about a node. The object in an RDF triple can be a literal value or can point to another node. See [DQL RDF Syntax](/dql/dql-syntax/dql-rdf) for more details. - when we store that a node name is "Alice". The predicate is ``name`` and predicate value is the string "Alice". The string becomes a node property. - when we store that Alice knows Bob, we may use a predicate ``knows`` with the node representing Alice. The value of this predicate would be the [uid](#uid) of the node representing Bob. In that case, ``knows`` is a [relationship](#relationship). diff --git a/content/dgraph-overview.md b/content/dgraph-overview.md index 126c2ab9..c4a038bc 100644 --- a/content/dgraph-overview.md +++ b/content/dgraph-overview.md @@ -52,7 +52,7 @@ Dgraph is built from the ground up as a distributed system. Data is automaticall Each Dgraph cluster consists of multiple server groups (shards) that work together to store and query your data. Queries are automatically distributed across the relevant shards and results are aggregated, making the distributed nature transparent to your application. This architecture provides both horizontal scalability and high availability. -For detailed information about Dgraph's distributed architecture, clustering, and replication, see the [Architecture documentation]("/deploy/archiveture"). +For detailed information about Dgraph's distributed architecture, clustering, and replication, see the [Architecture documentation](/deploy/dgraph-architecture). ## Enterprise-Grade Features @@ -120,7 +120,7 @@ The graph model naturally represents connected data, making it straightforward t ## What's Next - Get familiar with some terms in our [Glossary](/dgraph-glossary) -- Go through some [tutorials]("/learn") +- Go through some [tutorials]({{}}) diff --git a/content/dql/clients/csharp.md b/content/dql/clients/csharp.md index a8e85ad3..20d9c7c1 100644 --- a/content/dql/clients/csharp.md +++ b/content/dql/clients/csharp.md @@ -50,13 +50,7 @@ client.Login(lr) In the example above, the client logs into namespace `123` using username `userId` and password `password`. Once logged in, the client can perform all the operations allowed to the `userId` user of namespace `123`. -### Creating a Client for Dgraph Cloud Endpoint -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: - -```c# -var client = new DgraphClient(SlashChannel.Create("https://frozen-mango.eu-central-1.aws.cloud.dgraph.io/graphql", "api-key-here")); -``` ### Altering the Database diff --git a/content/dql/clients/go.md b/content/dql/clients/go.md index bdd3b101..e533a65c 100644 --- a/content/dql/clients/go.md +++ b/content/dql/clients/go.md @@ -89,23 +89,7 @@ if err := dc.LoginIntoNamespace(ctx, "groot", "password", 123); err != nil { In the example above, the client logs into namespace `123` using username `groot` and password `password`. Once logged in, the client can perform all the operations allowed to the `groot` user of namespace `123`. -### Creating a Client for Dgraph Cloud Endpoint -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: - -```go -// This example uses dgo -conn, err := dgo.DialCloud("https://frozen-mango.eu-central-1.aws.cloud.dgraph.io/graphql", "") -if err != nil { - log.Fatal(err) -} -defer conn.Close() -dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(conn)) -``` - -{{% notice "note" %}} -The `dgo.DialSlashEndpoint()` method has been deprecated and will be removed in v21.07. Please use `dgo.DialCloud()` instead. -{{% /notice %}} ## Alter the database diff --git a/content/dql/clients/java.md b/content/dql/clients/java.md index afe7c9e4..a129ece8 100644 --- a/content/dql/clients/java.md +++ b/content/dql/clients/java.md @@ -81,18 +81,6 @@ dgraphClient.loginIntoNamespace(USER_ID, USER_PASSWORD, NAMESPACE); Once logged-in, the `dgraphClient` object can be used to do any further operations. -### Creating a Client for Dgraph Cloud Endpoint - -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows : - -```java -DgraphStub stub = DgraphClient.clientStubFromCloudEndpoint("https://civic-wine.us-west-2.aws.cloud.dgraph.io/graphql", "your-api-key"); -DgraphClient dgraphClient = new DgraphClient(stub); -``` - -{{% notice "note" %}} -The `DgraphClient.clientStubFromSlashEndpoint()` method has been deprecated and will be removed in v21.07. Please use `DgraphClient.clientStubFromCloudEndpoint()` instead. -{{% /notice %}} ### Creating a Secure Client using TLS @@ -155,7 +143,7 @@ dgraphClient.alter(operation); Starting Dgraph version 20.03.0, indexes can be computed in the background. You can call the function `setRunInBackground(true)` as shown below before calling `alter`. You can find more details -[here]({{< relref "dql-schema.md#indexes-in-background" >}}). +[here]({{< relref "update-dgraph-types.md#indexes-in-background" >}}). ```java String schema = "name: string @index(exact) ."; diff --git a/content/dql/clients/javascript/grpc.md b/content/dql/clients/javascript/grpc.md index 43666169..b840fe87 100644 --- a/content/dql/clients/javascript/grpc.md +++ b/content/dql/clients/javascript/grpc.md @@ -80,23 +80,6 @@ await dgraphClientStub.loginIntoNamespace("groot", "password", 123); // where 12 In the example above, the client logs into namespace `123` using username `groot` and password `password`. Once logged in, the client can perform all the operations allowed to the `groot` user of namespace `123`. -### Creating a Client for Dgraph Cloud Endpoint - -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: - -```js -const dgraph = require("dgraph-js"); - -const clientStub = dgraph.clientStubFromSlashGraphQLEndpoint( - "https://frozen-mango.eu-central-1.aws.cloud.dgraph.io/graphql", - "" -); -const dgraphClient = new dgraph.DgraphClient(clientStub); -``` - -{{% notice "note" %}} -The `dgraph.clientStubFromSlashGraphQLEndpoint()` method has been deprecated and will be removed in v21.07. -{{% /notice %}} ### Altering the Database @@ -113,7 +96,7 @@ await dgraphClient.alter(op); Starting Dgraph version 20.03.0, indexes can be computed in the background. You can set `setRunInBackground` field of the `Operation` object to `true` before passing it to the `DgraphClient#alter(Operation)` method. You can find more details -[here]({{< relref "dql-schema.md#indexes-in-background" >}}). +[here]({{< relref "update-dgraph-types.md#indexes-in-background" >}}). ```js const schema = "name: string @index(exact) ."; diff --git a/content/dql/clients/javascript/http.md b/content/dql/clients/javascript/http.md index 1882ccc2..d7d35ef4 100644 --- a/content/dql/clients/javascript/http.md +++ b/content/dql/clients/javascript/http.md @@ -57,27 +57,6 @@ const dgraphClient = new dgraph.DgraphClient(clientStub); To facilitate debugging, [debug mode](#debug-mode) can be enabled for a client. -### Create a Client for Dgraph Cloud Endpoint - -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: - -```js -const dgraph = require("dgraph-js-http"); - -//here we pass the cloud endpoint -const clientStub = new dgraph.DgraphClientStub( - "https://super-pail.us-west-2.aws.cloud.dgraph.io", -); - -const dgraphClient = new dgraph.DgraphClient(clientStub); - -//here we pass the API key -dgraphClient.setSlashApiKey(""); -``` - -{{% notice "note" %}} -You need to remove the `/graphql` path when copying the endpoint URL from the Dgraph Cloud dashboard. -{{% /notice %}} ### Login into Dgraph @@ -105,18 +84,15 @@ await clientStub.login(); Some Dgraph configurations require extra access tokens. -1. Alpha servers can be configured with [Secure Alter Operations]({{< relref "dgraph-administration.md" >}}). + +Alpha servers can be configured with [Secure Alter Operations]({{< relref "dgraph-administration.md" >}}). In this case the token needs to be set on the client instance: ```js dgraphClient.setAlphaAuthToken("My secret token value"); ``` -2. [Dgraph Cloud](https://cloud.dgraph.io/) requires API key for HTTP access: -```js -dgraphClient.setSlashApiKey("Copy the Api Key from Dgraph Cloud admin page"); -``` ### Create https connection diff --git a/content/dql/clients/python.md b/content/dql/clients/python.md index 79a27e05..5a15806a 100644 --- a/content/dql/clients/python.md +++ b/content/dql/clients/python.md @@ -59,20 +59,7 @@ client.login_into_namespace("groot", "password", "123") In the example above, the client logs into namespace `123` using username `groot` and password `password`. Once logged in, the client can perform all the operations allowed to the `groot` user of namespace `123`. -### Creating a Client for Dgraph Cloud Endpoint -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: - -```python -import pydgraph - -client_stub = pydgraph.DgraphClientStub.from_cloud("https://frozen-mango.eu-central-1.aws.cloud.dgraph.io/graphql", "") -client = pydgraph.DgraphClient(client_stub) -``` - -{{% notice "note" %}} -The `DgraphClientStub.from_slash_endpoint()` method has been deprecated and will be removed in v21.07. Please use `DgraphClientStub.from_cloud()` instead. -{{% /notice %}} ### Altering the Database @@ -88,7 +75,7 @@ client.alter(op) Starting with Dgraph version 20.03.0, indexes can be computed in the background. You can set the `run_in_background` field of `pydgraph.Operation` to `True` before passing it to the `Alter` function. You can find more details -[here]({{< relref "dql-schema.md#indexes-in-background" >}}). +[here]({{< relref "update-dgraph-types.md#indexes-in-background" >}}). ```python schema = 'name: string @index(exact) .' diff --git a/content/dql/dql-get-started.md b/content/dql/dql-get-started.md index df1f2730..4ee86800 100644 --- a/content/dql/dql-get-started.md +++ b/content/dql/dql-get-started.md @@ -9,7 +9,7 @@ aliases = ["/get-started"] parent = "" +++ -This is a quick start guide to run [DQL]({{< relref "dgraph-glossary.md#RDF" >}}) queries and mutations. +This is a quick start guide to run [DQL]({{< relref "dgraph-glossary.md#rdf" >}}) queries and mutations. This guide helps you: @@ -64,14 +64,14 @@ Ratel UI makes it easier to run queries and mutations. } ``` -The input data is in JSON Format. Dgraph also supports [RDF]({{}}) notation. +The input data is in JSON Format. Dgraph also supports [RDF]({{}}) notation. The sample JSON data is an array of two movies with some attributes. These are stored as [Nodes]({{}}) in Dgraph. There will be stored as [Nodes]({{}}) in Dgraph. The "Star Wars" movie has a `director` field which is an JSON object and a `starring` field which is an array of JSON objects. -Each object is also stored as a Node in Dgraph . The `director` and `starring` are stored as [relations]({{}}). +Each object is also stored as a Node in Dgraph . The `director` and `starring` are stored as [relationship]({{}}). 3. Click **Run** to execute the mutation. diff --git a/content/dql/dql-schema.md b/content/dql/dql-schema.md index 05391cb1..326586d5 100644 --- a/content/dql/dql-schema.md +++ b/content/dql/dql-schema.md @@ -40,9 +40,9 @@ type Film { The schema contains information about [predicate types](#predicate-types) and [node types](#node-types). -A [predicate]({{< relref "dgraph-glossary.md#Predicate">}}) is the smallest piece of information about an object. A predicate can hold a literal value or a relation to another entity : +A [predicate]({{< relref "dgraph-glossary.md#predicate">}}) is the smallest piece of information about an object. A predicate can hold a literal value or a relation to another entity : - when we store that an entity name is "Alice". The predicate is ``name`` and predicate value is the string "Alice". -- when we store that Alice knows Bob, we may use a predicate ``knows`` with the node representing Alice. The value of this predicate would be the [uid]({{}}) of the node representing Bob. In that case, ``knows`` is a [relationship](#relationship). +- when we store that Alice knows Bob, we may use a predicate ``knows`` with the node representing Alice. The value of this predicate would be the [uid]({{}}) of the node representing Bob. In that case, ``knows`` is a [relationship](#relationships). Dgraph maintains a list of all predicates names and their type in the **Dgraph types schema**. @@ -92,7 +92,7 @@ or If a predicate type isn't declared in the schema, then the type is inferred from the first mutation and added to the schema. - If the mutation is using [RDF format]({{}}) with an RDF type, Dgraph uses this information to infer the predicate type. + If the mutation is using [RDF format]({{}}) with an RDF type, Dgraph uses this information to infer the predicate type. If no type can be inferred, the predicate type is set to `default`. @@ -122,7 +122,7 @@ convert your values to RFC 3339 format before sending them to Dgraph.{{% /notice The `float32vector` type denotes a vector of floating point numbers, i.e an ordered array of float32. A node type can contain more than one vector predicate. -Vectors are normaly used to store embeddings obtained from other information through an ML model. When a `float32vector` is [indexed](/dql/predicate-indexing/), the DQL [similar_to](/dql/dql-syntax/functions/#vector-similarity-search) function can be used for similarity search. +Vectors are normaly used to store embeddings obtained from other information through an ML model. When a `float32vector` is [indexed](/dql/predicate-indexing/), the DQL [similar_to]({{< relref "functions.md#vector-similarity-search">}}) function can be used for similarity search. @@ -343,7 +343,7 @@ output: ``` ## Predicate indexing -The schema is also used to set [predicates indexes](/dql/predicate-indexing/) which are required to apply [filtering functions](/dql/dql-syntax/functions/) in DQL queries. +The schema is also used to set [predicates indexes](/dql/predicate-indexing/) which are required to apply [filtering functions]({{< relref "functions.md">}}) in DQL queries. ## Node types Node types are declared along with [predicate types](#predicate-types) in the Dgraph types schema. @@ -417,7 +417,7 @@ Here's an example of mutation to set the types of a node: Node types are optional, but there are two use cases where actually knowing the list of potential predicates of a node is necessary: - deleting all the information about a node: this is the `delete { * * . }` mutation. -- retrieving all the predicates of a given node: this is done using the [expand(_all_)](/dql/dql-syntax/expand-predicates/) feature of DQL. +- retrieving all the predicates of a given node: this is done using the [expand(_all_)]({{< relref "expand-predicates.md">}}) feature of DQL. The Dgraph node types are used in those 2 use cases: when executing the `delete all predicates` mutation or the `expand all` query, Dgraph will check if the node has a ``dgraph.type`` predicate. If so, the engine is using the declared type to find the list of predicates and apply the delete or the expand on all of them. diff --git a/content/dql/dql-syntax/dql-rdf.md b/content/dql/dql-syntax/dql-rdf.md index 108d4dac..36e75348 100644 --- a/content/dql/dql-syntax/dql-rdf.md +++ b/content/dql/dql-syntax/dql-rdf.md @@ -39,7 +39,7 @@ Languages are written using `@lang`. For example <0x01> "Adélaïde"@fr . <0x01> "Person" . ``` -See also [how language strings are handled in queries]({{< relref "query-language/graphql-fundamentals.md#language-support" >}}). +See also [how language strings are handled in queries]({{< relref "language-support.md" >}}). ### Types Dgraph understands standard RDF types specified in RDF using the `^^` separator. For example @@ -122,7 +122,7 @@ Result: ``` {{% notice "tip" %}} Dgraph can automatically generate a reverse relation. If the user wants to run -queries in that direction, they would define the [reverse relationship]({{< relref "dql-schema.md#reverse-edges" >}}). +queries in that direction, they would define the [reverse relationship]({{< relref "dql-schema.md#reverse-predicates" >}}). {{% /notice %}} ## N-quads format diff --git a/content/dql/predicate-indexing.md b/content/dql/predicate-indexing.md index f207e016..4bf3a896 100644 --- a/content/dql/predicate-indexing.md +++ b/content/dql/predicate-indexing.md @@ -8,7 +8,7 @@ weight = 4 parent = "dql" +++ -Filtering on a predicate by applying a [function](/dql/dql-syntax/functions/) requires an index. +Filtering on a predicate by applying a [function]({{< relref "functions.md" >}}) requires an index. Indices are defined in the [Dgraph types schema]({{}}) using `@index` directive. @@ -131,7 +131,7 @@ score: [int] . * A set operation adds to the list of values. The order of the stored values is non-deterministic. * A delete operation deletes the value from the list. * Querying for these predicates would return the list in an array. -* Indexes can be applied on predicates which have a list type and you can use [Functions](/dql/dql-syntax/functions/) on them. +* Indexes can be applied on predicates which have a list type and you can use [Functions]({{< relref "functions.md" >}}) on them. * Sorting is not allowed using these predicates. * These lists are like an unordered set. For example: `["e1", "e1", "e2"]` may get stored as `["e2", "e1"]`, i.e., duplicate values will not be stored and order may not be preserved. diff --git a/content/graphql-dql/dql-for-graphql.md b/content/graphql-dql/dql-for-graphql.md index 5dbf82d3..325bf9fc 100644 --- a/content/graphql-dql/dql-for-graphql.md +++ b/content/graphql-dql/dql-for-graphql.md @@ -13,7 +13,7 @@ type = "graphql" Dgraph Query Language ([DQL](/dql/)) can be used to extend GraphQL API capabilities when writing: - [custom DQL resolvers]({{}}) -- [subscriptions on DQL queries](/graphql/schema/directives/directive-withsubscription/#subscriptions-to-custom-dql) +- [subscriptions on DQL queries]({{}}) diff --git a/content/graphql/custom/mutation.md b/content/graphql/custom/mutation.md index 2a7811b5..2cdda5eb 100644 --- a/content/graphql/custom/mutation.md +++ b/content/graphql/custom/mutation.md @@ -47,6 +47,6 @@ type Mutation { Find out more about how to turn off generated mutations and protecting mutations with authorization rules at: * [Remote Types - Turning off Generated Mutations with `@remote` Directive]({{}}) -* [Securing Mutations with the `@auth` Directive]("/graphql/security/mutations.md") +* [Securing Mutations with the `@auth` Directive](/graphql/security/mutations) --- diff --git a/content/howto/update-dgraph-types.md b/content/howto/update-dgraph-types.md index 974b5d85..3fab0fd1 100644 --- a/content/howto/update-dgraph-types.md +++ b/content/howto/update-dgraph-types.md @@ -3,8 +3,10 @@ date = "2017-03-20T22:25:17+11:00" title = "Update Dgraph types" type = "docs" weight = 15 +identifier = "update-types" [menu.main] parent = "howto" + +++ You modify Dgraph types (node types and predicates types) by diff --git a/content/learn/data-engineer/data-model-101/_index.md b/content/learn/data-engineer/data-model-101/_index.md index bd928f76..8aeb94a0 100644 --- a/content/learn/data-engineer/data-model-101/_index.md +++ b/content/learn/data-engineer/data-model-101/_index.md @@ -41,10 +41,3 @@ used by your app. Any data model that tracks lots of different relationships (or Whether this is the first time you are learning about graphs or looking to deepen your understanding of graphs with some concrete examples, this tutorial will help you along your journey. - -If you are already familiar with graphs, you can jump right into our coding -example for [React](/courses/messageboardapp/react/overview/introduction/). - -If you are a SQL user and you'd like to learn how common SQL syntax maps to -similar GraphQL syntax so you can use your SQL knowledge to jump-start your -GraphQL learning journey, see [Introduction to Dgraph for SQL Users](/courses/datamodel/sql-to-dgraph/overview/introduction). \ No newline at end of file diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-1/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-1/index.md index 13f20995..21b892d4 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-1/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-1/index.md @@ -66,11 +66,11 @@ docker run --rm -d -p 8000:8000 - dgraph/ratel:latest Just visit [http://localhost:8000](http://localhost:8000) from your browser, and you will be able to access it. -{{% load-img "/images/tutorials/1/gs-2.png" "ratel-1" %}} +{{% load-img "images/tutorials/1/gs-2.png" "ratel-1" %}} We'll be using the Console tab of Ratel. -{{% load-img "/images/tutorials/1/gs-3.png" "ratel-2" %}} +{{% load-img "images/tutorials/1/gs-3.png" "ratel-2" %}} ### Mutations using Ratel @@ -103,7 +103,7 @@ So Dgraph also creates a second entity that is the object of this predicate. Thi Let's execute this mutation. Click Run! -{{% load-img "/images/tutorials/1/mutate-example.gif" "Query-gif" %}} +{{% load-img "images/tutorials/1/mutate-example.gif" "Query-gif" %}} You can see in the response that two UIDs (Universal IDentifiers) have been created. The two values in the `"uids"` field of the response correspond @@ -127,7 +127,7 @@ The expression `has(name)` returns all the entities with a predicate `name` asso Go to the `Query` tab this time and type in the query above. Then, click `Run` on the top right of the screen. -{{% load-img "/images/tutorials/1/query-1.png" "query-1" %}} +{{% load-img "images/tutorials/1/query-1.png" "query-1" %}} Ratel renders a graph visualization of the result. @@ -136,11 +136,11 @@ matching the ones, we saw in the mutation's response. You can also view the JSON results in the JSON tab on the right. -{{% load-img "/images/tutorials/1/query-2.png" "query-2" %}} +{{% load-img "images/tutorials/1/query-2.png" "query-2" %}} #### Understanding the query -{{% load-img "/images/tutorials/1/explain-query-2.JPG" "Illustration with explanation" %}} +{{% load-img "images/tutorials/1/explain-query-2.JPG" "Illustration with explanation" %}} The first part of the query is the user-defined function name. In our query, we have named it as `people`. However, you could use any other name. diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-2/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-2/index.md index 1a55dca3..b2cc3dc6 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-2/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-2/index.md @@ -13,7 +13,7 @@ In the [previous tutorial]({{< relref "tutorial-1/index.md" >}}) of getting star we learned some of the basics of Dgraph. Including how to run the database, add new nodes and predicates, and query them back. -{{% load-img "/images/tutorials/2/graph-1.jpg" "Graph" %}} +{{% load-img "images/tutorials/2/graph-1.jpg" "Graph" %}} In this tutorial, we'll build the above Graph and learn more about operations using the UID (Universal Identifier) of the nodes. Specifically, we'll learn about: @@ -53,7 +53,7 @@ Go to Ratel's mutate tab, paste the mutation below in the text area, and click R } ``` -{{% load-img "/images/tutorials/2/a-add-data.gif" "mutation-1" %}} +{{% load-img "images/tutorials/2/a-add-data.gif" "mutation-1" %}} ## Query using UIDs @@ -80,7 +80,7 @@ Go to the query tab, type in the query below, and click Run. Now, from the result, copy the UID of Michael's node. -{{% load-img "/images/tutorials/2/b-get-uid-1.png" "get-uid" %}} +{{% load-img "images/tutorials/2/b-get-uid-1.png" "get-uid" %}} In the query below, replace the placeholder `MICHAELS_UID` with the UID you just copied, and run the query. @@ -94,7 +94,7 @@ In the query below, replace the placeholder `MICHAELS_UID` with the UID you just } ``` -{{% load-img "/images/tutorials/2/c-query-uid.png" "get_node_from_uid" %}} +{{% load-img "images/tutorials/2/c-query-uid.png" "get_node_from_uid" %}} *Note: `MICHAELS_UID` appears as `0x8` in the images. The UID you get on your machine might have a different value.* @@ -136,7 +136,7 @@ You can see that Michael's age is updated to 41. } ``` -{{% load-img "/images/tutorials/2/d-update-check.png" "update check" %}} +{{% load-img "images/tutorials/2/d-update-check.png" "update check" %}} Similarly, you can also add new predicates to an existing node. Since the predicate `country` doesn't exist for the node for `Michael`, it creates a new one. @@ -160,7 +160,7 @@ Let's say, `Leyla` starts to follow `Michael`. We know that this relationship between them has to represented by creating the `follows` edge between them. -{{% load-img "/images/tutorials/2/graph-2.jpg" "Graph" %}} +{{% load-img "images/tutorials/2/graph-2.jpg" "Graph" %}} First, let's copy the UIDs of nodes for `Leyla` and `Michael` from Ratel. @@ -205,7 +205,7 @@ Let's run a traversal query and then understand it in detail. Here's the result. -{{% load-img "/images/tutorials/2/e-traversal.png" "traversal-result" %}} +{{% load-img "images/tutorials/2/e-traversal.png" "traversal-result" %}} The query has three parts: @@ -232,7 +232,7 @@ Since Michael follows only one person, the traversal returns just one node. These are `level-2` nodes. The root nodes constitute the nodes for `level-1`. Again, we need to specify which predicates you want to get back from `level-2` nodes. -{{% load-img "/images/tutorials/2/j-explain.JPG" "get_node_from_uid" %}} +{{% load-img "images/tutorials/2/j-explain.JPG" "get_node_from_uid" %}} You can extend the query to make use of `level-2` nodes and traverse the Graph further and deeper. Let's explore that in the next section. @@ -264,7 +264,7 @@ That's when we say that the query is deep! } ``` -{{% load-img "/images/tutorials/2/f-level-3-traverse.png" "level-3-query" %}} +{{% load-img "images/tutorials/2/f-level-3-traverse.png" "level-3-query" %}} Here is one more example from the extension of the last query. @@ -289,7 +289,7 @@ Here is one more example from the extension of the last query. } ``` -{{% load-img "/images/tutorials/2/g-level-4-traversal.png" "level 3" %}} +{{% load-img "images/tutorials/2/g-level-4-traversal.png" "level 3" %}} This query is really long! The query is four levels deep. In other words, the depth of the query is four. @@ -324,7 +324,7 @@ The depth parameter specifies the maximum depth the traversal query should consi Let's run the recursive traversal query after replacing the placeholder with the UID of node for Michael. -{{% load-img "/images/tutorials/2/h-recursive-traversal.png" "recurse" %}} +{{% load-img "images/tutorials/2/h-recursive-traversal.png" "recurse" %}} [Check out the docs](https://dgraph.io/docs/query-language/#recurse-query) for detailed instructions on using the `recurse` directive. @@ -363,7 +363,7 @@ Let's delete the `age` predicate of the node for `Michael`. } ``` -{{% load-img "/images/tutorials/2/i-delete.png" "recurse" %}} +{{% load-img "images/tutorials/2/i-delete.png" "recurse" %}} ## Wrapping up diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-3/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-3/index.md index be5f1bad..9b709f20 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-3/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-3/index.md @@ -28,7 +28,7 @@ Check out the accompanying video: Let's start by building the graph of a simple blog application. Here's the Graph model of our application: -{{% load-img "/images/tutorials/3/a-main-graph.JPG" "main graph model" %}} +{{% load-img "images/tutorials/3/a-main-graph.JPG" "main graph model" %}} The above graph has three entities: Author, Blog posts, and Tags. The nodes in the graph represent these entities. For the rest of the tutorial, we'll call the nodes representing a blog as a `blog post` node and the node presenting a `tag` as a `tag node`, and so on. @@ -177,7 +177,7 @@ Go to Ratel, click on the mutate tab, paste the following mutation, and click Ru Our Graph is ready! -{{% load-img "/images/tutorials/3/l-fullgraph-2.png" "rating-blog-rating" %}} +{{% load-img "images/tutorials/3/l-fullgraph-2.png" "rating-blog-rating" %}} Our Graph has: @@ -193,7 +193,7 @@ Dgraph automatically detects the data type of its predicates. You can see the au Click on the schema tab on the left and then check the `Type` column. You'll see the predicate names and their corresponding data types. -{{% load-img "/images/tutorials/3/a-initial.png" "rating-blog-rating" %}} +{{% load-img "images/tutorials/3/a-initial.png" "rating-blog-rating" %}} These data types include `string`, `float`, and `int`, and `uid`. Besides them, Dgraph also offers three more basic data types: `geo`, `dateTime`, and `bool`. @@ -222,7 +222,7 @@ First, let's query for all the Authors and their ratings: } ``` -{{% load-img "/images/tutorials/3/a-find-rating-2.png" "authors" %}} +{{% load-img "images/tutorials/3/a-find-rating-2.png" "authors" %}} Refer to the [first episode]({{< relref "tutorial-1/index.md" >}}) if you have any questions related to the structure of the query in general. @@ -266,7 +266,7 @@ Let's try it out. } ``` -{{% load-img "/images/tutorials/3/b-index-missing.png" "index missing" %}} +{{% load-img "images/tutorials/3/b-index-missing.png" "index missing" %}} We got an error! The index for the `rating` predicate is missing. You cannot query for the value of a predicate unless you've added an index for it. @@ -302,11 +302,11 @@ Here's the sequence of steps: - Click on the `rating` predicate from the list. - Tick the index option in the Properties UI on the right. -{{% load-img "/images/tutorials/3/c-add-schema.png" "Add schema" %}} +{{% load-img "images/tutorials/3/c-add-schema.png" "Add schema" %}} We successfully added the index for `rating` predicate! Let's rerun our previous query. -{{% load-img "/images/tutorials/3/d-rating-query.png" "rating" %}} +{{% load-img "images/tutorials/3/d-rating-query.png" "rating" %}} We successfully queried for Author nodes with a rating of 4.0 or more. How about we also fetch the Blog posts of these authors? @@ -328,7 +328,7 @@ We already know that the `published` edge points from an `author` node to a `blo } ``` -{{% load-img "/images/tutorials/3/e-rating-blog.png" "rating-blog-rating" %}} +{{% load-img "images/tutorials/3/e-rating-blog.png" "rating-blog-rating" %}} _Check out our [previous tutorial]({{< relref "tutorial-2/index.md">}}) if you have questions around graph traversal queries._ @@ -353,13 +353,13 @@ Similarly, let's extend our previous query to fetch the tags of these blog posts } ``` -{{% load-img "/images/tutorials/3/m-four-blogs.png" "rating-blog-rating" %}} +{{% load-img "images/tutorials/3/m-four-blogs.png" "rating-blog-rating" %}} _Note: Author nodes are in blue, blogs posts in green, and tags in pink._ We have two authors, four blog posts, and their tags in the result. If you take a closer look at the result, there's a blog post with 12 dislikes. -{{% load-img "/images/tutorials/3/i-dislikes-2.png" "Dislikes" %}} +{{% load-img "images/tutorials/3/i-dislikes-2.png" "Dislikes" %}} Let's filter and fetch only the popular blog posts. Let's query for only those blog posts with fewer than 10 dislikes. @@ -395,7 +395,7 @@ Here's the query. The query returns: -{{% load-img "/images/tutorials/3/n-three-blogs.png" "rating-blog-rating" %}} +{{% load-img "images/tutorials/3/n-three-blogs.png" "rating-blog-rating" %}} Now, we only have three blogs in the result. The blog with 12 dislikes is filtered out. @@ -411,7 +411,7 @@ Let's run the following query and find all the tags in the database. } ``` -{{% load-img "/images/tutorials/3/o-tags.png" "tags" %}} +{{% load-img "images/tutorials/3/o-tags.png" "tags" %}} We got all the tags in the database. My favorite tag is `devrel`. What's yours? @@ -427,7 +427,7 @@ The `tag_name` predicate represents the name of a tag. It is of type `string`. H Let's start by adding an index to the `tag_name` predicate. Go to Ratel, click `tag_name` predicate from the list. -{{% load-img "/images/tutorials/3/p-string-index-2.png" "string index" %}} +{{% load-img "images/tutorials/3/p-string-index-2.png" "string index" %}} You can see that there are five choices for indexes that can be applied to any `string` predicate. The `fulltext`, `term`, and `trigram` are advanced string indexes. We'll discuss them in detail in our next episode. @@ -439,7 +439,7 @@ Although, any of the five string type indexes are compatible with the `eq` funct Let's add the `hash` index to the `tag_name` predicate. -{{% load-img "/images/tutorials/3/m-hash.png" "string index" %}} +{{% load-img "images/tutorials/3/m-hash.png" "string index" %}} Let's use the `eq` comparator and fetch the root node with `tag_name` set to `devrel`. @@ -451,7 +451,7 @@ Let's use the `eq` comparator and fetch the root node with `tag_name` set to `de } ``` -{{% load-img "/images/tutorials/3/q-devrel-2.png" "string index" %}} +{{% load-img "images/tutorials/3/q-devrel-2.png" "string index" %}} We finally have the node we wanted! @@ -474,7 +474,7 @@ Looks like the query didn't work! It didn't return us the blog posts! Don't be s Let's observe our Graph model again. -{{% load-img "/images/tutorials/3/a-main-graph.JPG" "main graph model" %}} +{{% load-img "images/tutorials/3/a-main-graph.JPG" "main graph model" %}} We know that the edges in Dgraph have directions. You can see that the `tagged` edge points from a `blog post` node to a `tag` node. @@ -498,7 +498,7 @@ Let's add the `tilde (~)` at the beginning of the `tagged` edge and initiate a r ``` -{{% load-img "/images/tutorials/3/r-reverse-2.png" "string index" %}} +{{% load-img "images/tutorials/3/r-reverse-2.png" "string index" %}} We got an error! @@ -506,7 +506,7 @@ Reverse traversals require an index on their predicate. Let's go to Ratel and add the `reverse` index to the edge. -{{% load-img "/images/tutorials/3/r-reverse-1.png" "string index" %}} +{{% load-img "images/tutorials/3/r-reverse-1.png" "string index" %}} Let's re-run the reverse edge traversal. @@ -523,9 +523,9 @@ Let's re-run the reverse edge traversal. } ``` -{{% load-img "/images/tutorials/3/s-devrel-blogs.png" "uid index" %}} +{{% load-img "images/tutorials/3/s-devrel-blogs.png" "uid index" %}} -{{% load-img "/images/tutorials/3/s-devrel-blogs-2.png" "uid index" %}} +{{% load-img "images/tutorials/3/s-devrel-blogs-2.png" "uid index" %}} Phew! Now we got all the blog posts that are tagged `devrel`. @@ -533,7 +533,7 @@ Similarly, you can extend the query to also find the authors of these blog posts Let's add the reverse index to the `published` edge. -{{% load-img "/images/tutorials/3/t-reverse-published.png" "uid index" %}} +{{% load-img "images/tutorials/3/t-reverse-published.png" "uid index" %}} Now, let's run the following query. @@ -554,9 +554,9 @@ Now, let's run the following query. } ``` -{{% load-img "/images/tutorials/3/u-author-reverse-1.png" "uid index" %}} +{{% load-img "images/tutorials/3/u-author-reverse-1.png" "uid index" %}} -{{% load-img "/images/tutorials/3/u-author-reverse-2.png" "uid index" %}} +{{% load-img "images/tutorials/3/u-author-reverse-2.png" "uid index" %}} With our previous query, we traversed the entire graph in reverse order. Starting from the tag nodes, we traversed up to the author nodes. diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-4/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-4/index.md index a324b7bc..c6638845 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-4/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-4/index.md @@ -30,7 +30,7 @@ Let's learn more about them! Let's start with building a simple food review Graph. Here's the Graph model. -{{% load-img "/images/tutorials/4/a-graph-model.jpg" "model" %}} +{{% load-img "images/tutorials/4/a-graph-model.jpg" "model" %}} The above Graph has three entities: Food, Comment, and Country. @@ -127,7 +127,7 @@ _Note: If this mutation syntax is new to you, refer to the [first tutorial]({{< Here's our Graph! -{{% load-img "/images/tutorials/4/a-full-graph.png" "full graph" %}} +{{% load-img "images/tutorials/4/a-full-graph.png" "full graph" %}} Our Graph has: @@ -138,7 +138,7 @@ Our Graph has: You can also see that Dgraph has auto-detected the data types of the predicates. You can check that out from the schema tab. -{{% load-img "/images/tutorials/4/c-schema.png" "full graph" %}} +{{% load-img "images/tutorials/4/c-schema.png" "full graph" %}} _Note: Check out the [previous tutorial]({{< relref "tutorial-3/index.md">}}) to know more about data types in Dgraph._ @@ -177,7 +177,7 @@ Now, Let's fetch only the food items and their reviews, As expected, these comments are in different languages. -{{% load-img "/images/tutorials/4/b-comments.png" "full graph" %}} +{{% load-img "images/tutorials/4/b-comments.png" "full graph" %}} But can we fetch the reviews based on their language? Can we write a query which says: _Hey Dgraph, can you give me only the reviews written in Chinese?_ @@ -235,7 +235,7 @@ Let's run the above mutation. Go to the mutate tab, paste the mutation, and click Run. -{{% load-img "/images/tutorials/4/d-lang-error.png" "lang error" %}} +{{% load-img "images/tutorials/4/d-lang-error.png" "lang error" %}} We got an error! Using the language tag requires you to add the `@lang` directive to the schema. @@ -246,11 +246,11 @@ Follow the instructions below to add the `@lang` directive to the `comment` pred - Tick mark the `lang` directive. - Click on the `Update` button. -{{% load-img "/images/tutorials/4/e-update-lang.png" "lang error" %}} +{{% load-img "images/tutorials/4/e-update-lang.png" "lang error" %}} Let's re-run the mutation. -{{% load-img "/images/tutorials/4/f-mutation-success.png" "lang error" %}} +{{% load-img "images/tutorials/4/f-mutation-success.png" "lang error" %}} Success! @@ -291,7 +291,7 @@ In the [previous article]({{< relref "tutorial-3/index.md">}}), we learned about Using that knowledge, let's first add the `hash` index for the `food_name` predicate. -{{% load-img "/images/tutorials/4/g-hash.png" "hash index" %}} +{{% load-img "images/tutorials/4/g-hash.png" "hash index" %}} Now, go to the query tab, paste the query in the text area, and click Run. @@ -306,7 +306,7 @@ Now, go to the query tab, paste the query in the text area, and click Run. } ``` -{{% load-img "/images/tutorials/4/h-comment.png" "hash index" %}} +{{% load-img "images/tutorials/4/h-comment.png" "hash index" %}} By default, the query only returns the untagged comment. @@ -324,7 +324,7 @@ Let's query for a review for `Sushi` in Japanese. } ``` -{{% load-img "/images/tutorials/4/i-japanese.png" "Japanese" %}} +{{% load-img "images/tutorials/4/i-japanese.png" "Japanese" %}} Now, let's query for a review for `Sushi` in Russian. @@ -339,7 +339,7 @@ Now, let's query for a review for `Sushi` in Russian. } ``` -{{% load-img "/images/tutorials/4/j-russian.png" "Russian" %}} +{{% load-img "images/tutorials/4/j-russian.png" "Russian" %}} You can also fetch all the comments for `Sushi` written in any language. @@ -354,7 +354,7 @@ You can also fetch all the comments for `Sushi` written in any language. } ``` -{{% load-img "/images/tutorials/4/k-star.png" "Russian" %}} +{{% load-img "images/tutorials/4/k-star.png" "Russian" %}} Here is the table with the syntax for various ways of making use of language tags while querying. @@ -371,7 +371,7 @@ Here is the table with the syntax for various ways of making use of language tag If you remember, we had initially added a Russian dish `Borscht` with its review in `Russian`. -{{% load-img "/images/tutorials/4/l-russian.png" "Russian" %}} +{{% load-img "images/tutorials/4/l-russian.png" "Russian" %}} If you notice, we haven't used the language tag `@ru` for the review written in Russian. @@ -379,7 +379,7 @@ Hence, if we query for all the reviews written in `Russian`, the review for `Bor Only the review for `Sushi,` written in `Russian`, makes it to the list. -{{% load-img "/images/tutorials/4/m-sushi.png" "Russian" %}} +{{% load-img "images/tutorials/4/m-sushi.png" "Russian" %}} So, here's the lesson of the day! diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-5/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-5/index.md index 4eee59a3..c74da8a9 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-5/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-5/index.md @@ -98,7 +98,7 @@ Therefore, we represent a mention as an edge between a tweet and the users menti We have three types of nodes: `User`, `Tweet,` and `Hashtag`. -{{% load-img "/images/tutorials/5/a-nodes.jpg" "graph nodes" %}} +{{% load-img "images/tutorials/5/a-nodes.jpg" "graph nodes" %}} Let's look at how these nodes might be related to each other and model their relationship as an edge between them. @@ -119,7 +119,7 @@ Let's name the edge which represents this relationship as `mentioned`. A `mentioned` edge points from a `Tweet` node to a `User` node. These users are the ones who are mentioned in the tweet. -{{% load-img "/images/tutorials/5/a-tweet-user.jpg" "graph nodes" %}} +{{% load-img "images/tutorials/5/a-tweet-user.jpg" "graph nodes" %}} **The tweet and the hashtag nodes** @@ -130,7 +130,7 @@ Let's name the edge, which represents this relationship as `tagged_with`. A `tagged_with` edge points from a `Tweet` node to a `Hashtag` node. These hashtag nodes correspond to the hashtags in the tweets. -{{% load-img "/images/tutorials/5/a-tagged.jpg" "graph nodes" %}} +{{% load-img "images/tutorials/5/a-tagged.jpg" "graph nodes" %}} **The Author and hashtag nodes** @@ -139,11 +139,11 @@ Hence, we don't need a direct edge between them. Our graph model of a tweet is ready! Here's it is. -{{% load-img "/images/tutorials/5/a-graph-model.jpg" "tweet model" %}} +{{% load-img "images/tutorials/5/a-graph-model.jpg" "tweet model" %}} Here is the graph of our sample tweet. -{{% load-img "/images/tutorials/5/c-tweet-model.jpg" "tweet model" %}} +{{% load-img "images/tutorials/5/c-tweet-model.jpg" "tweet model" %}} Let's add a couple of tweets to the list. @@ -267,7 +267,7 @@ _Note: If you're new to Dgraph, and yet to figure out how to run the database an Here is the graph we built. -{{% load-img "/images/tutorials/5/x-all-tweets.png" "tweet graph" %}} +{{% load-img "images/tutorials/5/x-all-tweets.png" "tweet graph" %}} Our graph has: @@ -285,7 +285,7 @@ Let's start our tweet exploration by querying for the twitter users in the datab } ``` -{{% load-img "/images/tutorials/5/j-users.png" "tweet model" %}} +{{% load-img "images/tutorials/5/j-users.png" "tweet model" %}} _Note: If the query syntax above looks not so familiar to you, check out the [first tutorial]({{< relref "tutorial-1/index.md" >}})._ @@ -307,7 +307,7 @@ Now, let's find their tweets and hashtags too. } ``` -{{% load-img "/images/tutorials/5/y-author-tweet.png" "tweet model" %}} +{{% load-img "images/tutorials/5/y-author-tweet.png" "tweet model" %}} _Note: If the traversal query syntax in the above query is not familiar to you, [check out the third tutorial]({{< relref "tutorial-3/index.md" >}}) of the series._ @@ -346,7 +346,7 @@ For a use case like this one, the `hash` index is recommended. Let's first add the `hash` index to the `user_handle` predicate. -{{% load-img "/images/tutorials/5/k-hash.png" "tweet model" %}} +{{% load-img "images/tutorials/5/k-hash.png" "tweet model" %}} Now, let's use the `eq` comparator to find all the tweets of `hackintoshrao`. @@ -363,7 +363,7 @@ Go to the query tab, type in the query, and click Run. } ``` -{{% load-img "/images/tutorials/5/z-exact.png" "tweet model" %}} +{{% load-img "images/tutorials/5/z-exact.png" "tweet model" %}} _Note: Refer to [the third tutorial]({{< relref "tutorial-3/index.md" >}}), if you want to know about comparator functions like `eq` in detail._ @@ -386,7 +386,7 @@ Let's extend the last query also to fetch the hashtags and the mentions. } ``` -{{% load-img "/images/tutorials/5/l-hash-query.png" "tweet model" %}} +{{% load-img "images/tutorials/5/l-hash-query.png" "tweet model" %}} _Note: If the traversal query syntax in the above query is not familiar to you, [check out the third tutorial]({{< relref "tutorial-3/index.md" >}}) of the series._ @@ -425,7 +425,7 @@ Let's find the twitter accounts which come after `dgraphlabs` in alphabetically } ``` -{{% load-img "/images/tutorials/5/n-exact-error.png" "tweet model" %}} +{{% load-img "images/tutorials/5/n-exact-error.png" "tweet model" %}} Oops, we have an error! @@ -441,7 +441,7 @@ The `hash` index would be a better option, as it is, in general, much more space Let's see the `exact` index in action. -{{% load-img "/images/tutorials/5/o-exact-conflict.png" "set exact" %}} +{{% load-img "images/tutorials/5/o-exact-conflict.png" "set exact" %}} We again have an error! @@ -452,7 +452,7 @@ The `user_handle` predicate already has the `hash` index, so trying to set the ` Let's uncheck the `hash` index for the `user_handle` predicate, select the `exact` index, and click update. -{{% load-img "/images/tutorials/5/p-set-exact.png" "set exact" %}} +{{% load-img "images/tutorials/5/p-set-exact.png" "set exact" %}} Though Dgraph allows you to change the index type of a predicate, do it only if it's necessary. When the indices are changed, the data needs to be re-indexed, and this takes some computing, so it could take a bit of time. @@ -460,7 +460,7 @@ While the re-indexing operation is running, all mutations will be put on hold. Now, let's re-run the query. -{{% load-img "/images/tutorials/5/q-exact-gt.png" "tweet model" %}} +{{% load-img "images/tutorials/5/q-exact-gt.png" "tweet model" %}} The result contains three twitter handles: `francesc`, `gopherpalooza`, and `hackintoshrao`. @@ -484,7 +484,7 @@ To be able to search tweets with specific keywords or terms, we need to first se Adding the `term` index is similar to adding any other string index. -{{% load-img "/images/tutorials/5/r-term-set.png" "term set" %}} +{{% load-img "images/tutorials/5/r-term-set.png" "term set" %}} Dgraph provides two built-in functions specifically to search for terms: `allofterms` and `anyofterms`. @@ -513,7 +513,7 @@ Here's the matched tweet from the query response: } ``` -{{% load-img "/images/tutorials/5/s-go-graph.png" "go graph set" %}} +{{% load-img "images/tutorials/5/s-go-graph.png" "go graph set" %}} _Note: Check out [the first tutorial]({{< relref "tutorial-1/index.md" >}}) if the query syntax, in general, is not familiar to you_ @@ -539,7 +539,7 @@ Now, let's find tweets that have either of the terms `Go` or `GraphQL` in them. } ``` -{{% load-img "/images/tutorials/5/t-go-graphql-all.png" "Go Graphql" %}} +{{% load-img "images/tutorials/5/t-go-graphql-all.png" "Go Graphql" %}} Oh wow, we have all the three tweets in the result. This means, all of the three tweets have either of the terms `Go` or `GraphQL`. @@ -555,7 +555,7 @@ We can do it by using the `allofterms` function. } ``` -{{% load-img "/images/tutorials/5/u-allofterms.png" "Go Graphql" %}} +{{% load-img "images/tutorials/5/u-allofterms.png" "Go Graphql" %}} We have an empty result. None of the tweets have both the terms `Go` and `GraphQL` in them. @@ -564,7 +564,7 @@ Besides `Go` and `Graph`, I'm also a big fan of `GraphQL` and `GraphDB`. Let's find out tweets that contain both the keywords `GraphQL` and `GraphDB` in them. -{{% load-img "/images/tutorials/5/v-graphdb-graphql.png" "Graphdb-GraphQL" %}} +{{% load-img "images/tutorials/5/v-graphdb-graphql.png" "Graphdb-GraphQL" %}} We have two tweets in a result which has both the terms `GraphQL` and `GraphDB`. diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-6/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-6/index.md index 2c469509..83688a0d 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-6/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-6/index.md @@ -25,7 +25,7 @@ The accompanying video of the tutorial will be out shortly, so stay tuned to [ou Before we dive in, let's do a quick recap of how to model the tweets in Dgraph. -{{% load-img "/images/tutorials/5/a-graph-model.jpg" "tweet model" %}} +{{% load-img "images/tutorials/5/a-graph-model.jpg" "tweet model" %}} In the previous tutorial, we took three real tweets as a sample dataset and stored them in Dgraph using the above graph as a model. @@ -135,7 +135,7 @@ _Note: If you're new to Dgraph, and this is the first time you're running a muta Voilà! Now you have a graph with `tweets`, `users`, and `hashtags`. It is ready for us to explore. -{{% load-img "/images/tutorials/5/x-all-tweets.png" "tweet graph" %}} +{{% load-img "images/tutorials/5/x-all-tweets.png" "tweet graph" %}} _Note: If you're curious to know how we modeled the tweets in Dgraph, refer to [the previous tutorial.]({{< relref "tutorial-5/index.md" >}})_ @@ -175,7 +175,7 @@ To be able to do a Full-text search, you need to first set a `fulltext` index on Creating a `fulltext` index on any string predicate is similar to creating any other string indices. -{{% load-img "/images/tutorials/6/a-set-index.png" "full text" %}} +{{% load-img "images/tutorials/6/a-set-index.png" "full text" %}} _Note: Refer to the [previous tutorial]({{< relref "tutorial-5/index.md" >}}) if you're not sure about creating an index on a string predicate._ @@ -204,7 +204,7 @@ Here is our search string: `graph data and analyze it in graphdb`. } ``` -{{% load-img "/images/tutorials/6/b-full-text-query-1.png" "tweet graph" %}} +{{% load-img "images/tutorials/6/b-full-text-query-1.png" "tweet graph" %}} Here's the matched tweet, which made it to the result. @@ -314,7 +314,7 @@ Let's first find all the hashtags in the database using the `has()` function. } ``` -{{% load-img "/images/tutorials/6/has-hashtag.png" "The hashtags" %}} +{{% load-img "images/tutorials/6/has-hashtag.png" "The hashtags" %}} _If you're not familiar with using the `has()` function, refer to [the first tutorial]({{< relref "tutorial-1/index.md" >}}) of the series._ @@ -341,17 +341,17 @@ Go to the query tab, type in the query, and click Run. Oops! We have an error! It looks like we forgot to set the `trigram` index on the `hashtag` predicate. -{{% load-img "/images/tutorials/6/trigram-error.png" "The hashtags" %}} +{{% load-img "images/tutorials/6/trigram-error.png" "The hashtags" %}} Again, setting a `trigram` index is similar to setting any other string index, let's do that for the `hashtag` predicate. -{{% load-img "/images/tutorials/6/set-trigram.png" "The hashtags" %}} +{{% load-img "images/tutorials/6/set-trigram.png" "The hashtags" %}} _Note: Refer to the [previous tutorial]({{< relref "tutorial-5/index.md" >}}) if you're not sure about creating an index on a string predicate._ Now, let's re-run the `regexp` query. -{{% load-img "/images/tutorials/6/regex-query-1.png" "regex-1" %}} +{{% load-img "images/tutorials/6/regex-query-1.png" "regex-1" %}} _Note: Refer to [the first tutorial]({{< relref "tutorial-1/index.md" >}}) if you're not familiar with the query structure in general_ Success! @@ -362,7 +362,7 @@ That's because `regexp` function is case-sensitive by default. Add the character `i` at the the end of the second argument of the `regexp` function to make it case insensitive: `regexp(predicate, /regular-expression/i)` -{{% load-img "/images/tutorials/6/regex-query-2.png" "regex-2" %}} +{{% load-img "images/tutorials/6/regex-query-2.png" "regex-2" %}} Now we have the four hashtags with substring `graph` in them. @@ -376,7 +376,7 @@ Let's modify the regular expression to match only the `hashtags` which have a pr } ``` -{{% load-img "/images/tutorials/6/regex-query-3.png" "regex-3" %}} +{{% load-img "images/tutorials/6/regex-query-3.png" "regex-3" %}} ## Summary diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-7/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-7/index.md index e7086b07..46bb1f4f 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-7/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-7/index.md @@ -29,7 +29,7 @@ The accompanying video of the tutorial will be out shortly, so stay tuned to Before we dive in, let's review of how we modeled the tweets in the previous two tutorials: -{{% load-img "/images/tutorials/5/a-graph-model.jpg" "tweet model" %}} +{{% load-img "images/tutorials/5/a-graph-model.jpg" "tweet model" %}} We used three real-life example tweets as a sample dataset and stored them in Dgraph using the above graph as a model. @@ -140,7 +140,7 @@ _Note: If you're new to Dgraph, and this is the first time you're running a muta Now you should have a graph with tweets, users, and hashtags, and it is ready for us to explore. -{{% load-img "/images/tutorials/5/x-all-tweets.png" "tweet graph" %}} +{{% load-img "images/tutorials/5/x-all-tweets.png" "tweet graph" %}} _Note: If you're curious to know how we modeled the tweets in Dgraph, refer to [the fifth tutorial]({{< relref "tutorial-5/index.md" >}})._ @@ -196,7 +196,7 @@ Before we use the `match` function, let's first get the list of user names store } ``` -{{% load-img "/images/tutorials/7/e-names.png" "tweet graph" %}} +{{% load-img "images/tutorials/7/e-names.png" "tweet graph" %}} As you can see from the result, we have four user names: `Gopherpalooza`, `Karthic Rao`, `Francesc Campoy`, and `Dgraph Labs`. @@ -216,7 +216,7 @@ Go to the query tab, paste the query below and click Run. } ``` -{{% load-img "/images/tutorials/7/h-one.png" "first query" %}} +{{% load-img "images/tutorials/7/h-one.png" "first query" %}} We got a positive match! Because the search string `graphLabs` is at a distance of two from the predicate @@ -236,7 +236,7 @@ Go to the query tab, paste the query below and click Run. } ``` -{{% load-img "/images/tutorials/7/i-two.png" "first query" %}} +{{% load-img "images/tutorials/7/i-two.png" "first query" %}} We still got a positive match with the `user_name` predicate with the value `Dgraph Labs`! That's because the search string `graphLab` is at a distance of three from the predicate @@ -256,7 +256,7 @@ Levenshtein Distance at 3. } ``` -{{% load-img "/images/tutorials/7/j-three.png" "first query" %}} +{{% load-img "images/tutorials/7/j-three.png" "first query" %}} Now you no longer see Dgraph Labs appears in the search result because the distance between the word `Dgraph` and `Dgraph Labs` is larger than 3. But based on normal diff --git a/content/learn/data-engineer/get-started-with-dgraph/tutorial-8/index.md b/content/learn/data-engineer/get-started-with-dgraph/tutorial-8/index.md index c67ecf2b..3cfec444 100644 --- a/content/learn/data-engineer/get-started-with-dgraph/tutorial-8/index.md +++ b/content/learn/data-engineer/get-started-with-dgraph/tutorial-8/index.md @@ -51,7 +51,7 @@ The following image has the point location with the latitude and longitude for t Paris. Point locations are useful for representing a precise location; for instance, your location when booking a cab or your delivery address. -{{% load-img "/images/tutorials/8/b-paris.png" "model" %}} +{{% load-img "images/tutorials/8/b-paris.png" "model" %}} - **Polygonal location** @@ -61,7 +61,7 @@ lake, or a national park, you should use a polygonal location. Here is an example: -{{% load-img "/images/tutorials/8/c-delhi.jpg" "model" %}} +{{% load-img "images/tutorials/8/c-delhi.jpg" "model" %}} The polygonal fence above represents the city of Delhi, India. This polygonal fence or the geo-fence is formed by connecting multiple straight-line boundaries, and @@ -72,7 +72,7 @@ and a polygonal fence can contain any number of lines. Let's start with building a simple San Francisco tourist graph, here's the graph model. -{{% load-img "/images/tutorials/8/a-graph.jpg" "model" %}} +{{% load-img "images/tutorials/8/a-graph.jpg" "model" %}} The above graph has three entities represented by the nodes: @@ -1489,7 +1489,7 @@ if you want to learn more about traversal queries like the above one._ Here's our graph! -{{% load-img "/images/tutorials/8/d-full-graph.png" "full graph" %}} +{{% load-img "images/tutorials/8/d-full-graph.png" "full graph" %}} Our graph has: @@ -1503,7 +1503,7 @@ We have four kinds of locations in our dataset: `museum`, `zoo`, `hotel`, and `t You can also see that Dgraph has auto-detected the data types of the predicates from the schema tab, and the location predicate has been auto-assigned `geo` type. -{{% load-img "/images/tutorials/8/e-schema.png" "type detection" %}} +{{% load-img "images/tutorials/8/e-schema.png" "type detection" %}} _Note: Check out the [previous tutorial]({{< relref "tutorial-3/index.md">}}) to know more about data types in Dgraph._ @@ -1533,7 +1533,7 @@ To use them, you have to set the `geo` index first. Go to the Schema tab and set the index on the `location` predicate. -{{% load-img "/images/tutorials/8/f-index.png" "geo-index" %}} +{{% load-img "images/tutorials/8/f-index.png" "geo-index" %}} After setting the `geo` index on the `location` predicate, you can use Dgraph's built-in function `near` to find the hotels near the Golden gate bridge. @@ -1560,7 +1560,7 @@ Go to the query tab, paste the query below and click Run. } ``` -{{% load-img "/images/tutorials/8/g-near-1.png" "geo-index" %}} +{{% load-img "images/tutorials/8/g-near-1.png" "geo-index" %}} Wait! The search returns not just the hotels, but also all other locations within 7 Km from the point coordinate on the `Golden Gate Bridge`. @@ -1582,13 +1582,13 @@ to refresh our previous discussions around using the `@filter` directive. Oops, we forgot to add an index while using the `eq` comparator in the filter. -{{% load-img "/images/tutorials/8/h-near-2.png" "geo-index" %}} +{{% load-img "images/tutorials/8/h-near-2.png" "geo-index" %}} Let's add a `hash` index to the `loc_type` and re-run the query. -{{% load-img "/images/tutorials/8/i-near-3.png" "geo-index" %}} +{{% load-img "images/tutorials/8/i-near-3.png" "geo-index" %}} -{{% load-img "/images/tutorials/8/j-near-4.png" "geo-index" %}} +{{% load-img "images/tutorials/8/j-near-4.png" "geo-index" %}} _Note: Refer to the [third tutorial]({{< relref "tutorial-3/index.md">}}) of the series to learn more about hash index and comparator functions in Dgraph._ @@ -1624,7 +1624,7 @@ so, we get only the locations of `hotels` in our result. } ``` -{{% load-img "/images/tutorials/8/k-near-5.png" "geo-index" %}} +{{% load-img "images/tutorials/8/k-near-5.png" "geo-index" %}} Voila! You can see in the result that, after adding the `@cascade` directive in the query, only the locations with type `hotel` appear in the result. @@ -1638,7 +1638,7 @@ the query, not at the level we traverse the location type nodes. Before you jump onto run the query, don't forget to add an index on the `price_per_night` predicate. -{{% load-img "/images/tutorials/8/l-float-index.png" "geo-index" %}} +{{% load-img "images/tutorials/8/l-float-index.png" "geo-index" %}} ```graphql { @@ -1653,7 +1653,7 @@ Before you jump onto run the query, don't forget to add an index on the `price_p ``` -{{% load-img "/images/tutorials/8/m-final-result.png" "geo-index" %}} +{{% load-img "images/tutorials/8/m-final-result.png" "geo-index" %}} Now we have a hotel well within the budget, and also close to the Golden Gate Bridge! diff --git a/content/learn/developer/react/_index.md b/content/learn/developer/react/_index.md index 6f5ef1f7..a322eeca 100644 --- a/content/learn/developer/react/_index.md +++ b/content/learn/developer/react/_index.md @@ -16,7 +16,6 @@ In this tutorial, you will start by looking at the app you are going to build and how such an app works in Dgraph Cloud. Then, the tutorial moves on to schema design with GraphQL, implementing a UI. -You can complete this tutorial using [Dgraph Cloud](https://cloud.dgraph.io/). ### Learning Goals diff --git a/content/learn/developer/react/react-conclusion.md b/content/learn/developer/react/react-conclusion.md index 35cb8c6c..59d4f0ee 100644 --- a/content/learn/developer/react/react-conclusion.md +++ b/content/learn/developer/react/react-conclusion.md @@ -24,23 +24,7 @@ subscriptions, and custom logic to this app. Playing with your app and taking your code to the next level? Be sure to share your creations on our [discussion boards](https://discuss.dgraph.io). -We love to see what you’re working on, and feel free to ask any questions - our -team of developers typically respond within 30 minutes! - -We hope you’ve enjoyed playing with [Dgraph Cloud](https://dgraph.io/cloud) -for this course. A fully-managed GraphQL backend database service, Dgraph Cloud -lets you focus on building apps, not managing infrastructure. Be sure to check -out our [example apps](/sample-apps/) - -tinker with the source code and get a feel for how it all works. Then build your -own creation! - -Want to learn more? Check out [another course](/courses/), or head over to our -[docs site](https://dgraph.io/docs). Want to request a tutorial? -[Drop us a comment](https://discuss.dgraph.io/t/dgraph-learn/11969)! - -And if you have been reading along but haven't tried it yet, -[try Dgraph Cloud](https://cloud.dgraph.io/) to launch your first hosted -GraphQL database. +We love to see what you’re working on! diff --git a/content/learn/developer/todo-app-tutorial/todo-deploy.md b/content/learn/developer/todo-app-tutorial/todo-deploy.md index 0d79fd6d..3c732127 100644 --- a/content/learn/developer/todo-app-tutorial/todo-deploy.md +++ b/content/learn/developer/todo-app-tutorial/todo-deploy.md @@ -1,5 +1,6 @@ +++ title = "Deploying on Dgraph Cloud" +draft = true description = "In just two steps on Dgraph Cloud (deployment & schema), you get a GraphQL API that you can easily use in any application." weight = 7 type = "learn" diff --git a/content/learn/developer/todo-app-tutorial/todo-overview.md b/content/learn/developer/todo-app-tutorial/todo-overview.md index 7b53cd7c..083c8128 100644 --- a/content/learn/developer/todo-app-tutorial/todo-overview.md +++ b/content/learn/developer/todo-app-tutorial/todo-overview.md @@ -19,6 +19,6 @@ This is a simple tutorial that will take you through making a basic to-do list a - [Add Auth Rules]({{< relref "todo-auth-rules">}}) - [Use Auth0's JWT]({{< relref "todo-auth0-jwt">}}) - [Use Firebase's JWT]({{< relref "todo-firebase-jwt">}}) -- [Deploy on Dgraph Cloud]({{< relref "todo-deploy">}}) +- Deploy --- diff --git a/htmltest.log b/htmltest.log new file mode 100644 index 00000000..1930be17 --- /dev/null +++ b/htmltest.log @@ -0,0 +1,2 @@ +testDocument on _redirects +missing doctype --- _redirects --> diff --git a/public/_redirects b/public/_redirects deleted file mode 100644 index 5c3a1a89..00000000 --- a/public/_redirects +++ /dev/null @@ -1,8 +0,0 @@ -/badger/* /docs/badger/:splat 301! -/docs/badger/* https://badger-docs.netlify.app/:splat 200! - -/docs/dgraphcloud/* /docs/cloud/:splat 301! -/docs/v21.03/* https://release-v21-03--dgraph-docs-repo.netlify.app/docs/v21.03/:splat 200! -/docs/v22.0/* https://release-v22-0--dgraph-docs-repo.netlify.app/docs/v22.0/:splat 200! -/docs/v23.0/* https://release-v23-0--dgraph-docs-repo.netlify.app/docs/v23.0/:splat 200! -/docs/v23.1/* https://release-v23-1--dgraph-docs-repo.netlify.app/docs/v23.1/:splat 200! diff --git a/refcache.json b/refcache.json new file mode 100644 index 00000000..adb2f17d --- /dev/null +++ b/refcache.json @@ -0,0 +1 @@ +{"https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify-frontend@1/dist/algoliasearchNetlify.css":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.249324-07:00"},"https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify-frontend@1/dist/algoliasearchNetlify.js":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.301351-07:00"},"https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.184728-07:00"},"https://cdn.lineicons.com/2.0/LineIcons.css":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.127532-07:00"},"https://code.jquery.com/jquery-3.2.1.min.js":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:30.690319-07:00"},"https://godoc.org/github.com/dgraph-io/dgo?status.svg":{"StatusCode":200,"LastSeen":"2025-10-29T12:38:01.279417-07:00"},"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:30.794578-07:00"},"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:30.912311-07:00"},"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.018347-07:00"},"https://unpkg.com/@dgraph-io/community":{"StatusCode":200,"LastSeen":"2025-10-29T12:42:31.46773-07:00"},"https://www.youtube.com/embed/8TKD-FFBVgE?autoplay=0\u0026controls=1\u0026end=0\u0026loop=0\u0026mute=0\u0026start=0":{"StatusCode":200,"LastSeen":"2025-10-29T12:38:56.274212-07:00"},"https://www.youtube.com/embed/Ww5cwixwkHo?autoplay=0\u0026controls=1\u0026end=0\u0026loop=0\u0026mute=0\u0026start=0":{"StatusCode":200,"LastSeen":"2025-10-29T12:38:57.465732-07:00"},"https://www.youtube.com/embed/_lDE9QXHZC0?autoplay=0\u0026controls=1\u0026end=0\u0026loop=0\u0026mute=0\u0026start=0":{"StatusCode":200,"LastSeen":"2025-10-29T12:38:53.929963-07:00"},"https://www.youtube.com/embed/f401or0hg5E?autoplay=0\u0026controls=1\u0026end=0\u0026loop=0\u0026mute=0\u0026start=0":{"StatusCode":200,"LastSeen":"2025-10-29T12:38:55.017286-07:00"},"https://www.youtube.com/embed/u73ovhDCPQQ?autoplay=0\u0026controls=1\u0026end=0\u0026loop=0\u0026mute=0\u0026start=0":{"StatusCode":200,"LastSeen":"2025-10-29T12:39:00.223225-07:00"}} diff --git a/scripts/linkcheck.sh b/scripts/linkcheck.sh new file mode 100644 index 00000000..2b0de4fd --- /dev/null +++ b/scripts/linkcheck.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Script to check for broken links in the Hugo-generated site + +set -e + +GREEN='\033[32;1m' +RED='\033[31;1m' +YELLOW='\033[33;1m' +RESET='\033[0m' + +echo -e "${GREEN}Building Hugo site...${RESET}" +hugo --destination=public --baseURL=http://example.com 1> /dev/null + +echo -e "${GREEN}Checking for broken links...${RESET}" + +# Option 1: htmltest (uses .htmltest.yml config) +if command -v htmltest &> /dev/null; then + echo -e "${YELLOW}Using htmltest...${RESET}" + htmltest -c .htmltest.yml +# Option 2: HTMLProofer (requires Ruby and html-proofer gem) +elif command -v htmlproofer &> /dev/null; then + echo -e "${YELLOW}Using HTMLProofer...${RESET}" + htmlproofer \ + --allow-hash-href \ + --check-html \ + --disable-external \ + --empty-alt-ignore \ + --url-ignore "/#/" \ + ./public +else + echo -e "${RED}HTMLProofer not found.${RESET}" + echo "Install it with: gem install html-proofer" + exit 1 +fi + +echo -e "${GREEN}Link check complete!${RESET}" +