What I’m trying to do
I want to translate this dataview code into the new bases syntax
table WITHOUT ID file.link AS "Note", length(file.inlinks) * 4 + length(file.outlinks) as "Total", length(file.inlinks) as "In", length(file.outlinks) as "Out"
from ""
where length(file.inlinks) * 4 + length(file.outlinks) > 0
sort length(file.inlinks) * 4 + length(file.outlinks) desc
limit 25
This code gives me the top 25 notes which have the highest total link score.
Whereas the total link score = sum of inlinks * 4 + sum of outlinks
.
So basically it displays the top 25 notes with the most in- and outlinks.
Things I have tried
Using the list.length()
function in conjuction with file.backlinks
and file.links
.
list.length(file.backlinks)
list.length(file.links)
In both cases no value is displayed inside the base.
Using just file.backlinks
and file.links
works, but only provides me with a combined list.
file.backlinks
file.links
file.backlinks + file.links
Yet, what I want is the number (length) of links and backlinks (aka outlinks and inlinks).
Something like:
list.length(file.backlinks) * 4 + list.length(file.links)
Maybe the problem is that the list.length()
function only works with an ordered list of elements such as [1, 2, 3]
according to the offical documentation. What file.backlinks
and file.links
gives me is an unordered list (I would assume).
Somebody has any idea how to approach this?