Hi Nathan,

I combined your suggestion about summing scores using aggregation function
and Orri Erling's ideas from this
post<http://www.openlinksw.com/weblog/oerling/index.vspx?page=&id=1570>and
got very simple basis from my search engine:

 SELECT ?eventUri
      WHERE
        {
          ?eventUri ?propertyUri ?value .
          ?value  bif:contains  "mathematics"
            OPTION ( SCORE ?valueScore)
        }
      GROUP BY ?eventUri
      ORDER BY DESC (sum(?valueScore))

It is simple, but it works :)

The first improvement I would like to do is to change sum by custom
aggregation function (to consider weights or any other logic). Orri Erling's
article describes similar function but it's source code is unfortunately not
published.

Regards,
Alexander

2010/3/1 Nathan <[email protected]>

> :) glad it's helping! here are some links I've found useful on the
> subject(s)
>
> inference rules and reasoning in virtuoso:
> http://docs.openlinksw.com/virtuoso/rdfsparqlrule.html
>
> sql transitivity docs, virtuoso being what it is these are also good for
> sparql of course - just specify in and out via filter as you are doing:
> http://docs.openlinksw.com/virtuoso/transitivityinsQL.html
>
> a blog from Orri on the subject of SQL transitivity that relates:
> http://www.openlinksw.com/weblog/oerling/?id=1433
>
> some tutorials demoing transitivity:
>
> http://virtuoso.openlinksw.com/presentations/SPARQL_Tutorials/SPARQL_Tutorials_Part_3/SPARQL_Tutorials_Part_3.html#
>
> I've had masses of "fun" with virtuoso and the extra options :) it's
> amazing what you can!
>
> many regards,
>
> nathan
>
> Alexander Sidorov wrote:
> > P. S. At the moment I'm trying to combine all these approaches and
> integrate
> > them into my search engine :)
> >
> > 2010/2/28 Nathan <[email protected]>
> >
> >> Nathan wrote:
> >>> SELECT DISTINCT ?s (sum(?oscore)) as ?finalWeight WHERE {
> >>> { select ?s (xsd:integer( ?oscore * 1.4 )) as ?weight where {
> >>>  ?s <predicate1> ?o . ?o bif:contains '"search text"' option(score
> >> ?oscore)
> >>> } } UNION {
> >>> { select ?s (xsd:integer( ?oscore * 1.8 )) as ?weight where {
> >>>  ?s <predicate2> ?o . ?o bif:contains '"search text"' option(score
> >> ?oscore)
> >>> }
> >>> } GROUP BY ?s
> >>> ORDER BY desc(?finalWeight)
> >>>
> >> correction, that first line should be:
> >>
> >> SELECT DISTINCT ?s (sum(?weight)) as ?finalWeight WHERE {
> >>
> >> also realised I forgot to point out the two different modifiers, 1.8 and
> >> 1.4 which does the weighting!
> >>
> >> regards
> >>
> >
>
>

Reply via email to