Skip to content

Commit

Permalink
Preparing changes of uid syntax* association. And fixed a writing err…
Browse files Browse the repository at this point in the history
…or in the docs. (hypermodeinc#3002)

* Fixed a writing error in docs

* Preparing changes of uid syntax * association. And fixed a writing error in the docs.

Rectifying changes of uid syntax in favor of hypermodeinc#2895

Some predicates need to be revised if they even need the change. According to its purpose (like "rated" is it a list or a single 1 to 1?). As far as I can analyze, it is okay.
  • Loading branch information
MichelDiz authored and danielmai committed Mar 1, 2019
1 parent e34f6a0 commit 80557ab
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion contrib/integration/testtxn/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func TestFriendList(t *testing.T) {

op = &api.Operation{}
op.Schema = `
friend: uid @reverse .`
friend: [uid] @reverse .`
if err := s.dg.Alter(context.Background(), op); err != nil {
log.Fatal(err)
}
Expand Down
34 changes: 17 additions & 17 deletions dgraph/cmd/bulk/speed_tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ echo " 1 million data set "
echo "========================="

run_test '
director.film: uid @reverse @count .
genre: uid @reverse .
director.film: [uid] @reverse @count .
genre: [uid] @reverse .
initial_release_date: dateTime @index(year) .
name: string @index(term) .
starring: uid @count .
starring: [uid] @count .
' 1million.rdf.gz

echo "========================="
echo " 21 million data set "
echo "========================="

run_test '
director.film : uid @reverse @count .
actor.film : uid @count .
genre : uid @reverse @count .
director.film : [uid] @reverse @count .
actor.film : [uid] @count .
genre : [uid] @reverse @count .
initial_release_date : datetime @index(year) .
rating : uid @reverse .
country : uid @reverse .
rating : [uid] @reverse .
country : [uid] @reverse .
loc : geo @index(geo) .
name : string @index(hash, fulltext, trigram) .
starring : uid @count .
starring : [uid] @count .
_share_hash_ : string @index(exact) .
' 21million.rdf.gz

Expand All @@ -82,18 +82,18 @@ Text: string @index(fulltext) .
Tag.Text: string @index(hash) .
Type: string @index(exact) .
ViewCount: int @index(int) .
Vote: uid @reverse .
Title: uid @reverse .
Vote: [uid] @reverse .
Title: [uid] @reverse .
Body: uid @reverse .
Post: uid @reverse .
PostCount: int @index(int) .
Tags: uid @reverse .
Tags: [uid] @reverse .
Timestamp: datetime .
GitHubID: string @index(hash) .
Has.Answer: uid @reverse @count .
Has.Answer: [uid] @reverse @count .
Chosen.Answer: uid @count .
Comment: uid @reverse .
Upvote: uid @reverse .
Downvote: uid @reverse .
Tag: uid @reverse .
Comment: [uid] @reverse .
Upvote: [uid] @reverse .
Downvote: [uid] @reverse .
Tag: [uid] @reverse .
' comments.rdf.gz,posts.rdf.gz,tags.rdf.gz,users.rdf.gz,votes.rdf.gz
2 changes: 1 addition & 1 deletion dgraph/cmd/bulk/systest/suite02/schema.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
friend: uid @count @reverse .
friend: [uid] @count @reverse .
name: string @index(exact) .
2 changes: 1 addition & 1 deletion posting/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const mutatedSchemaVal = `
name:string @index(term) .
name2:string .
dob:dateTime @index(year) .
friend:uid @reverse .
friend:[uid] @reverse .
`

// TODO(Txn): We can't read index key on disk if it was written in same txn.
Expand Down
2 changes: 1 addition & 1 deletion schema/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ var schemaIndexVal5 = `
age : int @index(int) .
name : string @index(exact) @count .
address : string @index(term) .
friend : uid @reverse @count .
friend : [uid] @reverse @count .
`

func TestSchemaIndexCustom(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion systest/bulk_live_cases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestFacets(t *testing.T) {
func TestCountIndex(t *testing.T) {
s := newSuite(t, `
name: string @index(exact) .
friend: uid @count @reverse .
friend: [uid] @count @reverse .
`, `
_:alice <friend> _:bob .
_:alice <friend> _:carol .
Expand Down
2 changes: 1 addition & 1 deletion systest/mutations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ func HasReverseEdge(t *testing.T, c *dgo.Dgraph) {

check(t, c.Alter(ctx, &api.Operation{
Schema: `
follow: uid @reverse .
follow: [uid] @reverse .
`,
}))
txn := c.NewTxn()
Expand Down
2 changes: 1 addition & 1 deletion wiki/content/mutations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ While Robin Wright might get UID `0x321` and triples
An appropriate schema might be as follows.
```
xid: string @index(exact) .
<http://schema.org/type>: uid @reverse .
<http://schema.org/type>: [uid] @reverse .
```

Query Example: All people.
Expand Down
4 changes: 2 additions & 2 deletions wiki/content/query-language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ index for a predicate it is mandatory to specify the type of the index. For exam
name: string @index(exact, fulltext) @count .
multiname: string @lang .
age: int @index(int) .
friend: uid @count .
friend: [uid] @count .
dob: dateTime .
location: geo @index(geo) .
occupations: [string] @index(term) .
Expand Down Expand Up @@ -2329,7 +2329,7 @@ First we add some schema.
```sh
curl localhost:8080/alter -XPOST -d $'
name: string @index(exact, term) .
rated: uid @reverse @count .
rated: [uid] @reverse @count .
' | python -m json.tool | less

```
Expand Down

0 comments on commit 80557ab

Please sign in to comment.