Hi all,

I'm trying to perform a dot product between two values, and sum them up.
Here's the query:

select ?v ( sum(?s1 * ?s2)  AS ?ss)
where {
 { <http://onescreen.com/video#2389800> <
http://onescreen.com/video_freebase#/american_football> ?s1 . ?v <
http://onescreen.com/video_freebase#/american_football>  ?s2 }
 UNION
 { <http://onescreen.com/video#2389800> <
http://onescreen.com/video_freebase#/american_football/football_player> ?s1
. ?v <http://onescreen.com/video_freebase#/american_football/football_player>
 ?s2 }
} group by ?v order by DESC (?ss) limit 100


However, instead of sum(?s1 * ?s2) , I'd like to have something like
sum(?s1 * min(?s1*?s2) ) , to multiple ?s2 but not more than ?s1. and I
reached syntax error, as min function meant to be used to aggregate across
columns within one variable.

so, my question is, is this calculation possible to achieve easily from
sparql?  sum(?s1 * min(?s1*?s2) ) ? How should I make this happen?


Thank you.

Yuhan

Reply via email to