From e601e9d2df1bd4752da1dfbd70282e39da880b63 Mon Sep 17 00:00:00 2001 From: rderbier Date: Mon, 13 Feb 2023 16:07:17 -0800 Subject: [PATCH] move predicate types (ex schema) to DQL section update all references --- content/clients/java.md | 10 +++++----- content/clients/javascript/grpc.md | 2 +- content/clients/python.md | 2 +- content/deploy/dgraph-administration.md | 2 +- content/deploy/dgraph-alpha.md | 2 +- content/design-concepts/concepts.md | 2 +- .../schema.md => dql/predicate-types.md} | 10 +++++----- content/dql/type-system.md | 4 ++-- content/enterprise-features/access-control-lists.md | 2 +- content/graphql/dgraph/index.md | 2 +- content/mutations/language-rdf-types.md | 2 +- content/query-language/count.md | 2 +- content/query-language/facets.md | 2 +- content/query-language/functions.md | 4 ++-- content/query-language/sorting.md | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) rename content/{query-language/schema.md => dql/predicate-types.md} (98%) diff --git a/content/clients/java.md b/content/clients/java.md index 12092d81..20cdf20a 100644 --- a/content/clients/java.md +++ b/content/clients/java.md @@ -10,7 +10,7 @@ A minimal implementation for a Dgraph client for Java 1.8 and above, using [gRPC This client follows the [Dgraph Go client]({{< relref "go.md" >}}) closely. {{% notice "tip" %}} -The official Java client [can be found here](https://github.com/dgraph-io/dgraph4j). +The official Java client [can be found here](https://github.com/dgraph-io/dgraph4j). Follow the [install instructions](https://github.com/dgraph-io/dgraph4j#download) to get it up and running. {{% /notice %}} @@ -35,7 +35,7 @@ be found in the [Using the Asynchronous Client](#using-the-asynchronous-client) ## Using the Synchronous Client {{% notice "tip" %}} -You can find a [DgraphJavaSample](https://github.com/dgraph-io/dgraph4j/tree/master/samples/DgraphJavaSample) project, +You can find a [DgraphJavaSample](https://github.com/dgraph-io/dgraph4j/tree/master/samples/DgraphJavaSample) project, which contains an end-to-end working example of how to use the Java client. {{% /notice %}} @@ -154,7 +154,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 "/query-language/schema.md#indexes-in-background" >}}). +[here]({{< relref "/predicate-types.md#indexes-in-background" >}}). ```java String schema = "name: string @index(exact) ."; @@ -357,7 +357,7 @@ txn.doRequest(request); ### Running a Query with RDF response -You can get query results as an RDF response by calling either `queryRDF()` or `queryRDFWithVars()`. +You can get query results as an RDF response by calling either `queryRDF()` or `queryRDFWithVars()`. The response contains the `getRdf()` method, which will provide the RDF encoded output. **Note**: If you are querying for `uid` values only, use a JSON format response @@ -510,7 +510,7 @@ Here is the asynchronous version of the code above, which runs a query. ```java // Query -String query = +String query = "query all($a: string){\n" + " all(func: eq(name, $a)) {\n" + " name\n" + diff --git a/content/clients/javascript/grpc.md b/content/clients/javascript/grpc.md index 33ffcb8e..458f613c 100644 --- a/content/clients/javascript/grpc.md +++ b/content/clients/javascript/grpc.md @@ -112,7 +112,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 "/query-language/schema.md#indexes-in-background" >}}). +[here]({{< relref "predicate-types.md#indexes-in-background" >}}). ```js const schema = "name: string @index(exact) ."; diff --git a/content/clients/python.md b/content/clients/python.md index 0ca3c9f4..7cddc295 100644 --- a/content/clients/python.md +++ b/content/clients/python.md @@ -87,7 +87,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 "/query-language/schema.md#indexes-in-background" >}}). +[here]({{< relref "/predicate-types.md#indexes-in-background" >}}). ```python schema = 'name: string @index(exact) .' diff --git a/content/deploy/dgraph-administration.md b/content/deploy/dgraph-administration.md index f2c54027..a75f9078 100644 --- a/content/deploy/dgraph-administration.md +++ b/content/deploy/dgraph-administration.md @@ -87,7 +87,7 @@ This would allow admin operations from hosts with hostnames `admin-bastion` and By default, you can perform mutation operations for any predicate. If the predicate in mutation doesn't exist in the schema, the predicate gets added to the schema with an appropriate -[Dgraph Type]({{< relref "query-language/schema.md" >}}). +[Dgraph Type]({{< relref "predicate-types.md" >}}). You can use `--limit "mutations=disallow"` to disable all mutations, which is set to `allow` by default. diff --git a/content/deploy/dgraph-alpha.md b/content/deploy/dgraph-alpha.md index 229fb971..748dba39 100644 --- a/content/deploy/dgraph-alpha.md +++ b/content/deploy/dgraph-alpha.md @@ -76,6 +76,6 @@ Here’s an example of JSON returned from the above query: - `group`: Group assigned based on the replication factor. Read more [here]({{< relref "/deploy/cluster-setup.md" >}}). - `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 "/query-language/schema.md#indexes-in-background" >}}). +- `indexing`: List of predicates for which indexes are built in the background. Read more [here]({{< relref "/predicate-types.md#indexes-in-background" >}}). The same information (except `ongoing` and `indexing`) is available from the `/health` and `/health?all` endpoints of Alpha server. diff --git a/content/design-concepts/concepts.md b/content/design-concepts/concepts.md index 337c8718..989c577e 100644 --- a/content/design-concepts/concepts.md +++ b/content/design-concepts/concepts.md @@ -17,7 +17,7 @@ Both the terminologies get used interchangeably in our code. Dgraph considers ed i.e. from `Subject -> Object`. This is the direction that the queries would be run. {{% notice "tip" %}}Dgraph can automatically generate a reverse edge. If the user wants to run -queries in that direction, they would need to define the [reverse edge]({{< relref "query-language/schema.md#reverse-edges" >}}) +queries in that direction, they would need to define the [reverse edge]({{< relref "predicate-types.md#reverse-edges" >}}) as part of the schema.{{% /notice %}} Internally, the RDF N-Quad gets parsed into this format. diff --git a/content/query-language/schema.md b/content/dql/predicate-types.md similarity index 98% rename from content/query-language/schema.md rename to content/dql/predicate-types.md index cd7b5854..bf6ee07a 100644 --- a/content/query-language/schema.md +++ b/content/dql/predicate-types.md @@ -1,9 +1,9 @@ +++ date = "2017-03-20T22:25:17+11:00" -title = "Schema" -weight = 20 +title = "Predicate types" +weight = 3 [menu.main] - parent = "query-language" + parent = "dql" +++ For each predicate, the schema specifies the target's type. If a predicate `p` has type `T`, then for all subject-predicate-object triples `s p o` the object `o` is of schema type `T`. @@ -258,7 +258,7 @@ email: string @index(exact) @noconflict . Dgraph supports a number of [RDF types in mutations]({{< relref "mutations/language-rdf-types.md" >}}). -As well as implying a schema type for a [first mutation]({{< relref "query-language/schema.md" >}}), an RDF type can override a schema type for storage. +As well as implying a schema type for a first mutation, an RDF type can override a schema type for storage. If a predicate has a schema type and a mutation has an RDF type with a different underlying Dgraph type, the convertibility to schema type is checked, and an error is thrown if they are incompatible, but the value is stored in the RDF type's corresponding Dgraph type. Query results are always returned in schema type. @@ -381,7 +381,7 @@ Incorrect index choice can impose performance penalties and an increased transaction conflict rate. Use only the minimum number of and simplest indexes that your application needs. {{% /notice %}} - + ### DateTime Indices The indices available for `dateTime` are as follows. diff --git a/content/dql/type-system.md b/content/dql/type-system.md index f8451a97..d6049a5a 100644 --- a/content/dql/type-system.md +++ b/content/dql/type-system.md @@ -1,7 +1,7 @@ +++ date = "2017-03-20T22:25:17+11:00" -title = "Type System" -weight = 3 +title = "Node types" +weight = 4 [menu.main] parent = "dql" +++ diff --git a/content/enterprise-features/access-control-lists.md b/content/enterprise-features/access-control-lists.md index 0b17e436..4e56f64a 100644 --- a/content/enterprise-features/access-control-lists.md +++ b/content/enterprise-features/access-control-lists.md @@ -522,7 +522,7 @@ mutation { } ``` -In case you have [reverse edges]({{< relref "query-language/schema.md#reverse-edges" >}}), they have to be given the permission to the group as well +In case you have [reverse edges]({{< relref "predicate-types.md#reverse-edges" >}}), they have to be given the permission to the group as well ```graphql mutation { diff --git a/content/graphql/dgraph/index.md b/content/graphql/dgraph/index.md index 1a8ef83a..9c3e28cb 100644 --- a/content/graphql/dgraph/index.md +++ b/content/graphql/dgraph/index.md @@ -10,7 +10,7 @@ weight = 13 If you have an existing Dgraph instance and want to also expose GraphQL, you need to add a GraphQL schema that maps to your Dgraph schema. You don't need to expose your entire Dgraph schema as GraphQL, but do note that adding a GraphQL schema can alter the Dgraph schema. -Dgraph's native DQL syntax allows type and edge names that aren't valid in GraphQL; so, you'll often need to expose valid GraphQL names. Dgraph permits special characters, including Unicode characters from a variety of languages (see [Predicate name rules]({{< relref "query-language/schema.md#predicate-name-rules">}})). Conversely, the [GraphQL specification on naming](https://spec.graphql.org/June2018/#sec-Names) requires that entity names, including types and fields (predicate), are composed of ASCII characters and generated as follows: `/[_A-Za-z][_0-9A-Za-z]*/`. +Dgraph's native DQL syntax allows type and edge names that aren't valid in GraphQL; so, you'll often need to expose valid GraphQL names. Dgraph permits special characters, including Unicode characters from a variety of languages (see [Predicate name rules]({{< relref "predicate-types.md#predicate-name-rules">}})). Conversely, the [GraphQL specification on naming](https://spec.graphql.org/June2018/#sec-Names) requires that entity names, including types and fields (predicate), are composed of ASCII characters and generated as follows: `/[_A-Za-z][_0-9A-Za-z]*/`. {{% notice "note" %}} Be careful with mapping to an existing Dgraph instance. Updating the GraphQL schema will also update the underlying Dgraph schema. diff --git a/content/mutations/language-rdf-types.md b/content/mutations/language-rdf-types.md index a97ae984..52b9d587 100644 --- a/content/mutations/language-rdf-types.md +++ b/content/mutations/language-rdf-types.md @@ -46,4 +46,4 @@ The supported [RDF datatypes](https://www.w3.org/TR/rdf11-concepts/#section-Data | <http://www.w3.org/2001/XMLSchema#float> | `float` | -See the section on [RDF schema types]({{< relref "query-language/schema.md#rdf-types" >}}) to understand how RDF types affect mutations and storage. +See the section on [RDF schema types]({{< relref "predicate-types.md#rdf-types" >}}) to understand how RDF types affect mutations and storage. diff --git a/content/query-language/count.md b/content/query-language/count.md index c206cfd2..a150fd5e 100644 --- a/content/query-language/count.md +++ b/content/query-language/count.md @@ -28,7 +28,7 @@ Query Example: The number of films acted in by each actor with `Orlando` in thei Count can be used at root and [aliased]({{< relref "query-language/alias.md" >}}). -Query Example: Count of directors who have directed more than five films. When used at the query root, the [count index]({{< relref "query-language/schema.md#count-index" >}}) is required. +Query Example: Count of directors who have directed more than five films. When used at the query root, the [count index]({{< relref "predicate-types.md#count-index" >}}) is required. {{< runnable >}} { diff --git a/content/query-language/facets.md b/content/query-language/facets.md index d42d3860..5f209ad8 100644 --- a/content/query-language/facets.md +++ b/content/query-language/facets.md @@ -120,7 +120,7 @@ All facets on an edge are queried with `@facets`. ## Facets i18n -Facets keys and values can use language-specific characters directly when mutating. But facet keys need to be enclosed in angle brackets `<>` when querying. This is similar to predicates. See [Predicates i18n]({{< relref "query-language/schema.md#predicates-i18n" >}}) for more info. +Facets keys and values can use language-specific characters directly when mutating. But facet keys need to be enclosed in angle brackets `<>` when querying. This is similar to predicates. See [Predicates i18n]({{< relref "predicate-types.md#predicates-i18n" >}}) for more info. {{% notice "note" %}}Dgraph supports [Internationalized Resource Identifiers](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) (IRIs) for facet keys when querying.{{% /notice %}} diff --git a/content/query-language/functions.md b/content/query-language/functions.md index 77dd78a2..f774b20a 100644 --- a/content/query-language/functions.md +++ b/content/query-language/functions.md @@ -12,7 +12,7 @@ Functions allow filtering based on properties of nodes or [variables]({{}}). Since v1.2, comparison functions +be applied on [indexed predicates]({{< relref "predicate-types.md#indexing" >}}). Since v1.2, comparison functions can now be used on [@filter]({{}}) directives even on predicates that have not been indexed. Filtering on non-indexed predicates can be slow for large datasets, as they require @@ -364,7 +364,7 @@ Query Example: Movies with directors with `Steven` in `name` and have directed m -Query Example: A movie in each genre that has over 30000 movies. Because there is no order specified on genres, the order will be by UID. The [count index]({{< relref "query-language/schema.md#count-index">}}) records the number of edges out of nodes and makes such queries more . +Query Example: A movie in each genre that has over 30000 movies. Because there is no order specified on genres, the order will be by UID. The [count index]({{< relref "predicate-types.md#count-index">}}) records the number of edges out of nodes and makes such queries more . {{< runnable >}} { diff --git a/content/query-language/sorting.md b/content/query-language/sorting.md index 577de99d..940f64cf 100644 --- a/content/query-language/sorting.md +++ b/content/query-language/sorting.md @@ -18,7 +18,7 @@ Sortable Types: `int`, `float`, `String`, `dateTime`, `default` Results can be sorted in ascending order (`orderasc`) or descending order (`orderdesc`) by a predicate or variable. -For sorting on predicates with [sortable indices]({{< relref "query-language/schema.md#sortable-indices">}}), Dgraph sorts on the values and with the index in parallel and returns whichever result is computed first. +For sorting on predicates with [sortable indices]({{< relref "predicate-types.md#sortable-indices">}}), Dgraph sorts on the values and with the index in parallel and returns whichever result is computed first. {{% notice "note" %}} Dgraph returns `null` values at the end of the results, irrespective of their sort. This behavior is consistent across indexed and non-indexed sorts.