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 ------------------------------------------------------------------------------ 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
