- From: Jerven Bolleman <me@jerven.eu>
- Date: Fri, 4 Apr 2014 12:24:56 +0200
- To: Alfredo Serafini <seralf@gmail.com>
- Cc: Wetz Peter <peter.wetz@tuwien.ac.at>, "public-lod@w3.org" <public-lod@w3.org>
Also have a look at the http://www.w3.org/TR/sparql11-query/#func-strstarts function instead of a REGEX. Can give a small perf increase. Regards, Jerven On 04 Apr 2014, at 11:34, Alfredo Serafini <seralf@gmail.com> wrote: > Hi for me seems to work, for example using instead: > > SELECT DISTINCT * WHERE { > ?a a foaf:Agent . > ?a foaf:name ?n . > FILTER regex(?n, '^(.+\\s+)*b', 'i') > } > LIMIT 10 > > I obtain as the first threee results the following ones: > "(Zhou) Bryan Bai" > "A-Reum Bae" > "A. A. (Louis) Beex" > > If you want to work with surname the problem is related to the fact that all the data (name, surname) are in the foaf:name field, so that the only way seems to use a more specific regex, for example excluding the first part which can be something like "A. ", "B. A." or similar... > > > > > 2014-04-04 10:11 GMT+02:00 Wetz Peter <peter.wetz@tuwien.ac.at>: > Dear all! > > > > I would like to use the DBLP Sparql Endpoint at [1] to retrieve publications of authors by REGEX Search. This, however, seems not to work as expected. > > > > This query returns authors starting with an “A”: > > > SELECT DISTINCT * WHERE { > > ?a a foaf:Agent . > > ?a foaf:name ?n . > > FILTER regex(?n, '^a', 'i') > > } > > LIMIT 10 > > > > This query should return authors starting with a “B”: > > > > SELECT DISTINCT * WHERE { > > ?a a foaf:Agent . > > ?a foaf:name ?n . > > FILTER regex(?n, '^b', 'i') > > } > > LIMIT 10 > > > > This does not return any results, and I don’t know why. Actually, it’s not working with any other letter except “A”. What I simply want to do is, to search for authos based on an input string. > > > > Maybe, somone of you can help. > > > > Thanks in advance, > > Peter > > > > [1] http://dblp.l3s.de/d2r/snorql/ > >
Received on Friday, 4 April 2014 10:25:31 UTC