I’m a beginner with Dgraph. With Dgraph, I want to implement this graph
https://en.wikipedia.org/wiki/PageRank#/media/File:PageRanks-Example.jpg
Here is the Dgraph schema I considered. Is it correct?
# Define Types
type Page {
url: string
pr: float
link: [Page]
}
# Define Directives and index
url: string @index(term) .
link: [uid] @count .
And below the data. Is that right?
Thanks for anybody who response.
Cheers.
{
set {
_:A <url> "http://www.example.com/A" .
_:A <dgraph.type> "Page" .
_:A <pr> "3.3" .
_:B <url> "http://www.example.com/B" .
_:B <dgraph.type> "Page" .
_:B <pr> "38.4" .
_:B <link> _:C .
_:C <url> "http://www.example.com/C" .
_:C <dgraph.type> "Page" .
_:C <pr> "34.3" .
_:C <link> _:B .
_:D <url> "http://www.example.com/D" .
_:D <dgraph.type> "Page" .
_:D <pr> "3.9" .
_:D <link> _:A .
_:D <link> _:B .
_:E <url> "http://www.example.com/E" .
_:E <dgraph.type> "Page" .
_:E <pr> "8.1" .
_:E <link> _:B .
_:E <link> _:D .
_:E <link> _:F .
_:F <url> "http://www.example.com/F" .
_:F <dgraph.type> "Page" .
_:F <pr> "3.9" .
_:F <link> _:B .
_:F <link> _:E .
_:G <url> "http://www.example.com/G" .
_:G <dgraph.type> "Page" .
_:G <pr> "1.6" .
_:G <link> _:B .
_:G <link> _:E .
_:H <url> "http://www.example.com/H" .
_:H <dgraph.type> "Page" .
_:H <pr> "1.6" .
_:H <link> _:B .
_:H <link> _:E .
_:I <url> "http://www.example.com/I" .
_:I <dgraph.type> "Page" .
_:I <pr> "1.6" .
_:I <link> _:B .
_:I <link> _:E .
_:J <url> "http://www.example.com/J" .
_:J <dgraph.type> "Page" .
_:J <pr> "1.6" .
_:J <link> _:E .
_:K <url> "http://www.example.com/K" .
_:K <dgraph.type> "Page" .
_:K <pr> "1.6" .
_:K <link> _:E .
}
}