You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wiki/content/query-language/index.md
+65-2Lines changed: 65 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1997,9 +1997,48 @@ If data exists and new indices are specified in a schema mutation, any index not
1997
1997
1998
1998
Reverse edges are also computed if specified by a schema mutation.
1999
1999
2000
-
{{% notice "note" %}} If your predicate is a URI or has special characters, then you should wrap
2001
-
it with angular brackets while doing the schema mutation. E.g. `<first:name>`{{% /notice %}}
2000
+
### Predicates i18n
2002
2001
2002
+
If your predicate is a URI or has laguange-specific vocabs, then enclose
2003
+
it with angle brackets `<>` when executing the schema mutation.
2004
+
2005
+
{{% notice "note" %}}Dgraph supports [Internationalized Resource Identifier](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) (IRI) for predicate names and values.{{% /notice %}}
2006
+
2007
+
Schema syntax:
2008
+
```
2009
+
<职业>: string @index(exact) .
2010
+
<年龄>: int @index(int) .
2011
+
<地点>: geo @index(geo) .
2012
+
<公司>: string .
2013
+
```
2014
+
2015
+
This syntax allows for internationalized predicate, but fulltext indexing still defaults to English.
2016
+
To use the right tokenizer for your language, you need to use the `@lang` directive and enter values using your
2017
+
language tag.
2018
+
2019
+
Schema:
2020
+
```
2021
+
<公司>: string @index(fulltext) @lang .
2022
+
```
2023
+
Mutation:
2024
+
```
2025
+
{
2026
+
set {
2027
+
_:a <公司> "Dgraph Labs Inc"@en
2028
+
_:b <公司> "夏新科技有限责任公司"@zh
2029
+
}
2030
+
}
2031
+
```
2032
+
Query:
2033
+
```
2034
+
{
2035
+
query {
2036
+
q (func: alloftext(<公司>@., <夏新科技有限责任公司>)) {
2037
+
_predicate_
2038
+
}
2039
+
}
2040
+
}
2041
+
```
2003
2042
2004
2043
### Upsert directive
2005
2044
@@ -2344,6 +2383,30 @@ All facets on an edge are queried with `@facets`.
2344
2383
}
2345
2384
{{</ runnable >}}
2346
2385
2386
+
### Facets i18n
2387
+
2388
+
Facets keys and values can use language vocabs directly when mutating. But facet keys need to be enclosed in angle brackets `<>` when querying. This is similar to predicates. See [Predicates i18n](#predicates-i18n) for more info.
2389
+
2390
+
{{% notice "note" %}}Dgraph supports [Internationalized Resource Identifier](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) (IRI) for facet keys when querying.{{% /notice %}}
0 commit comments