"data": {
"q": [
{
"name": "Jethro Tull",
"Released": [
{
"_stp_id": "Album:/m/0_b9kq",
"name": "The Very Best Of"
}
]
}
]
},
My schema is:
type Artist {
Released
<~Member_of>
_stp_id
date
name
length
place
type
}
type Engineer {
Engineered
_stp_id
name
type
}
type Producer {
Produced
_stp_id
name
type
}
type Album {
<~Engineered>
<~Released>
<~On>
_stp_id
date
primary_release
contributor
release_date
name
release_type
type
}
type Member {
Member_of
_stp_id
role
start
name
end
type
}
type Track {
<~Engineered>
<~Produced>
On
_stp_id
date
name
length
place
type
}
_stp_id: string @index(exact) .
_stp_label: string @index(exact) .
Engineered: [uid] @reverse @count .
Produced: [uid] @reverse @count .
Released: [uid] @reverse @count .
Member_of: [uid] @reverse @count .
On: [uid] @reverse @count .
date: string @index(exact) .
primary_release: string @index(exact) .
role: string @index(exact) .
length: float @index(float) .
start: string @index(exact) .
release_type: string @index(exact) .
type: string @index(exact) .
contributor: string @index(exact) .
release_date: string @index(exact) .
name: string @index(exact) .
end: string @index(exact) .
place: string @index(exact) .
That query is not the same as what I have tried (including what you suggested above) since there is no equivalent of “c2: c as sum(val(x))” that I see. Also, the original question (that I posted today) was how to get the degree of a node using expand. Is it possible?
Degree is a common concept in graph theory (Degree (graph theory) - Wikipedia). Basically the total number of connections for a specific node (there are also incoming and outgoing variants).
There are no differences. The query does not necessarily have to be the same, to demonstrate a bug. The query below contains aggregation and works the same way.
{
var(func: eq(count(director.film), 7), first:10) {
director.film {
<~director.film> {
x as count(director.film)
}
c2: c as sum(val(x))
}
}
me() {
sum(val(c))
}
}
Is there some way to count the number of nodes(of any type) connected to a certain node by now?Is it possible to find all the nodes connected to a certain node without specifying type infomation?
Not sure what you mean, you can do this using count Query Language - Query language - do you mean “by now” as the current time?
I’m sorry I didn’t express it clearly.I saw your post at Apr 2 that there is no way to get the “degree” of a specific node, i just want to know if it is supported now after four months.
Again, I didn’t get it. You can find any node without specifying the type.
BTW, please, open new topics instead of commenting on old ones. You can just reference it by link.
I thought my question was highly correlated with this old topic,so I chose to comment instead of opening a new topic.Very sorry if that commenting still goes against community rules.
It could if we see that is something practical proofed for GraphDBs. Not everything in the Graph Theory is useful in GraphDBs. Algorithm about relations are generally useful. But others are useful just in math context. Dealing with numbers and complex equations. Not a DB/business model, you can use math to plan a business model, but no a DB fundamentally speaking.
If you show me what you wanna get from it in a clear way. I could try to validate the possibility. And, if the case, have an argumentation to add a feature request. I can help you there, but first I need to understand the need. What you wanna achieve, with examples.
But nothing is guarantee tho.
np, that’s not the problem and it is not a rule. Sometimes people don’t wanna get emails from another question in your old question you know? (except when it’s a discussion thread) We like good news, not parallel discussions. So, it is totally okay to create a new topic and use this one as your reference. We gonna read it (the content of the link) to understand your context again.