Skip to content

Instantly share code, notes, and snippets.

@MichelDiz
Last active November 19, 2019 04:03
Show Gist options
  • Save MichelDiz/d1c5bc6e159bf63924c3726afd6310c6 to your computer and use it in GitHub Desktop.
Save MichelDiz/d1c5bc6e159bf63924c3726afd6310c6 to your computer and use it in GitHub Desktop.
{
"set": [{
"uid": "_:DA-Mavericks",
"name": "Dallas Mavericks",
"dgraph.type": "Team"
}, {
"uid": "_:BO-Celtics",
"name": "Boston Celtics",
"dgraph.type": "Team"
}, {
"uid": "_:DE-Pistons",
"name": "Detroit Pistons",
"dgraph.type": "Team"
}, {
"uid": "_:LA-Lakers",
"name": "Los Angeles Lakers",
"dgraph.type": "Team"
},
{
"name": "Marcus",
"dgraph.type": "Player",
"Seasons": [{
"firstSeason": "true",
"start": "2018",
"to": "present",
"by_the": {
"uid": "_:LA-Lakers"
},
"Season_Statistics": "Here you can link to some Statistics for this season []",
"dgraph.type": "Season"
}]
},
{
"name": "Lucas",
"dgraph.type": "Player",
"Seasons": [{
"firstSeason": "true",
"start": "2010",
"to": "2019",
"by_the": {
"uid": "_:DE-Pistons"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
}, {
"firstSeason": "false",
"start": "2019",
"to": "present",
"by_the": {
"uid": "_:LA-Lakers"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
}]
},
{
"name": "Tom",
"dgraph.type": "Player",
"Seasons": [{
"firstSeason": "true",
"start": "2008",
"to": "2016",
"by_the": {
"uid": "_:BO-Celtics"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
},
{
"firstSeason": "false",
"start": "2016",
"to": "2019",
"by_the": {
"uid": "_:LA-Lakers"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
},
{
"firstSeason": "false",
"start": "2019",
"to": "present",
"by_the": {
"uid": "_:DA-Mavericks"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
}
]
}, {
"name": "Patrick",
"dgraph.type": "Player",
"Seasons": [{
"firstSeason": "true",
"start": "2011",
"to": "present",
"by_the": {
"uid": "_:BO-Celtics"
},
"Season_Statistics": "Link here to some Statistics []",
"dgraph.type": "Season"
}]
}
]
}
{
query(func: type(Player)) {
uid
name
Seasons (orderasc: start) {
firstSeason
start
to
by_the {
name
}
Season_Statistics
}
}
}
type Team {
name: string
}
type Player {
name: string
Seasons: [uid]
}
type Season {
firstSeason: bool
start: datetime
to: string
by_the: [uid]
Season_Statistics: string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment