On Wednesday, April 09, 2014 12:35:42 PM Walter Travassos wrote: > > Recentelly I discoverd the functions on ARQ but I ´m having a little > dificult to use these functions. I´m trying to query the DBpedia using de > function afn:namespaces to find the namespaces of some resources. Here is my > code:
> String query = > > "PREFIX afn: > <http://jena.hpl.hp.com/ARQ/function#>"+ > > "select distinct ?s ?p ?namespace " + > > "where {?s ?p ?o ." + > > "filter (isURI(?s)) " + > > "filter (isURI(?o))" + > > "filter (afn:namespace(?s) = (afn:namespace(?o)) )} > limit 10"; Handy tip: put newlines (\n) on each line of your query so that if there's a syntax error the line numbers help. Note that this query crawls over the entire content of dbpedia. > But I always recieve the error 500. Server internal error. I expect it ran out of space or time trying to fetch every triple in the data. Note that the DISTINCT will force it to scan the data even though there's a LIMIT -- the LIMIT applies to the distinct results, not the pre-distinct results. If I understand correctly. (You should be able tow rite a LIMITed sub-query to get a few results and then apply the DISTINCT in an outer query.) Chris -- "People are part of the design. It's dangerous to forget that." /Star Cops/ Epimorphics Ltd, http://www.epimorphics.com Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT Epimorphics Ltd. is a limited company registered in England (number 7016688)
