Jürgen Jakobitsch wrote: > hi, you might want to check out > > http://lookup.dbpedia.org/api/search.asmx > > we're doing a well working yui-autocomplete with data from that service. > > wkr turnguard > > ----- Original Message ----- > From: "gianny damour" <[email protected]> > To: [email protected] > Sent: Monday, January 25, 2010 4:32:16 AM > Subject: [Dbpedia-discussion] SPARQL - Auto-completion > > Hi, > > I would like to query DBPedia to build an auto-completion feature and I am > not able to figure out the best way to write the associated SPARQL. > > > Assuming that I would like to auto-complete 'cambri', this query should work: > > > SELECT ?s > WHERE { > ?s rdfs:label ?label > FILTER regex( str(?label), "^cambri", "i" ) > } > ORDER BY ASC(?label) > LIMIT 5 > > > The problem is that it is too slow and timeout. People have been suggesting > to use the > OpenLink Virtuoso built-in-function "contains" as it performs better than > regex filters. > > So, this query is better: > > > SELECT DISTINCT ?s > WHERE { > ?s rdfs:label ?label > FILTER (bif:contains(?label, 'cambrid')) > } > ORDER BY ASC(?label) > LIMIT 5 > > > Unfortunatelly, it is sematically incorrect as I would like to find the > resources starting with 'cambrid' and not > simply containing 'cambrid'. > > > So, I though that combining the filter could do the trick - here, assuming > that > combined filters are evaluated from left to right: > > > SELECT DISTINCT ?s > WHERE { > ?s rdfs:label ?label > FILTER (bif:contains(?label, 'cambrid') && regex( str(?label), "^cambrid", > "i")) > } > ORDER BY ASC(?label) > LIMIT 5 > > > This query returns an empty set. > > Any idea about achieving such an auto-completion. > > > Thanks, > Gianny > Gianny,
Have you looked at: http://dbpedia.org/fct ? There are 3 tabs, with the last two offering different types of auto-completion. You can also read the "About" link re. the service behind this should you want to interact with it via your own code. Kingsley > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Dbpedia-discussion mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Dbpedia-discussion mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion > > -- Regards, Kingsley Idehen President & CEO OpenLink Software Web: http://www.openlinksw.com Weblog: http://www.openlinksw.com/blog/~kidehen Twitter: kidehen ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Dbpedia-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
