Dear all,
I'm finally getting around to try out Virtuoso. I'm sure many of you know it
allready, but for those who don't, I'm now working for a consultancy in
Norway called Computas, 100% on Semantic Web technologies. Previously, I was
at Opera, and my interest in RDF goes back more than 10 years.
So, to the problem: We are developing a site where SPARQL is used as the
backend query language. One of the features for end users is to search by a
simple freetext string (google type searches). Say that we have the graph
<http://example.org/resource/foobar> dct:title "Foobar" ;
dct:subject <http://example.org/topic/dahut> .
<http://example.org/topic/dahut> skos:prefLabel "Dahut" .
Now, I'd like to DESCRIBE the <http://example.org/resource/foobar> resource,
by freetext matching. The simplest case is straightforward
DESCRIBE ?resource WHERE {
?resource dct:title ?free .
?free bif:contains "Foo*" .
}
The next case is more complex, since there is a single search field, we don't
know which predicate that holds the term we are searching for, and so, we
need to search all literals, e.g.:
DESCRIBE ?resource WHERE {
?resource dct:title ?free ;
dct:subject ?var .
?var skos:prefLabel ?free .
?free bif:contains "Da*" .
}
Note that I'm now searching for the "Da"-prefix, and I suppose that this would
also return a description of <http://example.org/resource/foobar> ?
Now to the real problem:
How about if the end-user searches for "Foo* and Da*"?
In this case, the string will not match any of the literals, but it will match
the combination of the literals, and it is the latter the end user is
interested in.
Up to now, we've been running Jena, and the way we have solved this problem is
to concatenate all literals, create a "sub:literals" property, and then
freetext search this property. It works, but queries that returns a few
hundred entries usually takes around 40 seconds.
Has Virtuoso any solution to this problem?
I think I would prefer a solution that made the SPARQL very simple, like
DESCRIBE ?resource WHERE {
?resource bi:any-contains "Foo* and Da*" .
}
Not that the index not only needs to index the literals linked to the subject
I'm interested in here, but also to literals linked to subjects that is an
object of this resource... Therefore, it would be nice to have the
possibility of defining a pattern for this index.
Kind regards
Kjetil Kjernsmo
--
Senior Knowledge Engineer
Direct: +47 6783 1136 | Mobile: +47 986 48 234
Email: kjetil.kjernsmo@co...
Web: http://www.computas.com/
| SHARE YOUR KNOWLEDGE |
Computas AS Vollsveien 9, PO Box 482, N-1327 Lysaker | Phone:+47 6783 1000 |
Fax:+47 6783 1001
|