Dan Brickley wrote:
> On Fri, Apr 16, 2010 at 11:43 PM, Kingsley Idehen
> <[email protected]> wrote:
>   
>> Tom Morris wrote:
>>     
>>> This example query from the DBpedia page returns a list of companies
>>> which all have exactly 151,000 employees:
>>>
>>> http://dbpedia.org/snorql/?query=SELECT+%3Fsubject+%3Femployees+%3Fhomepage+WHERE+{%0D%0A%3Fsubject+rdf:type+%3Chttp://dbpedia.org/class/yago/Company108058098%3E.%0D%0A%3Fsubject+dbpedia2:numEmployees+%3Femployees%0D%0AFILTER+(xsd:integer(%3Femployees)+%3E%3D+50000).%0D%0A%3Fsubject+foaf:homepage+%3Fhomepage.%0D%0A}+ORDER+BY+DESC(xsd:integer(%3Femployees))%0D%0ALIMIT+20%0D%0A
>>>
>>> That seems a rather improbable result.  I'm not a real SPARQL guru,
>>> but I don't see anything obviously wrong with the query.  Is the query
>>> incorrect or is the issue with the database or the server?
>>>
>>> Tom
>>>
>>> ------------------------------------------------------------------------------
>>> Download Intel&#174; Parallel Studio Eval
>>> Try the new software tools for yourself. Speed compiling, find bugs
>>>       
>
>
>   
>> To save time (i.e. decoding the URL), could you please do the following:
>>
>> 1. Go to: http://dbpedia.org/isparql
>> 2. Click on "Advanced Tab"
>> 3. Paste in your query
>> 4. Execute
>> 5. Share the Query Results Link.
>>
>> Clearly our restrictions are in play, hence the recommendation that you
>> page through using OFFSET and LIMIT.
>>     
>
> You can also paste
> http://dbpedia.org/snorql/?query=SELECT+%3Fsubject+%3Femployees+%3Fhomepage+WHERE+{%0D%0A%3Fsubject+rdf:type+%3Chttp://dbpedia.org/class/yago/Company108058098%3E.%0D%0A%3Fsubject+dbpedia2:numEmployees+%3Femployees%0D%0AFILTER+(xsd:integer(%3Femployees)+%3E%3D+50000).%0D%0A%3Fsubject+foaf:homepage+%3Fhomepage.%0D%0A}+ORDER+BY+DESC(xsd:integer(%3Femployees))%0D%0ALIMIT+20%0D%0A
>
> ... into the form at http://meyerweb.com/eric/tools/dencoder/
>
> This gives:
>
> http://dbpedia.org/snorql/?query=SELECT ?subject ?employees ?homepage WHERE {
> ?subject rdf:type <http://dbpedia.org/class/yago/Company108058098>.
> ?subject dbpedia2:numEmployees ?employees
> FILTER (xsd:integer(?employees) >= 50000).
> ?subject foaf:homepage ?homepage.
> } ORDER BY DESC(xsd:integer(?employees))
> LIMIT 20
>
>
> Hope that helps!
>
> Dan
>
>   
Problem:

The Home Page URLs aren't uniform.

I added DISTINCT and removed ?homepage.

So not a bug :-)

Try

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT distinct  ?subject ?employees WHERE {
?subject rdf:type <http://dbpedia.org/class/yago/Company108058098>.
?subject dbpedia2:numEmployees ?employees
FILTER (xsd:integer(?employees) >= 50000).
?subject foaf:homepage ?homepage.
} ORDER BY DESC(xsd:integer(?employees))
LIMIT 20

Links:

1. http://bit.ly/byXSGf -- SPARQL Protocol URL

-- 

Regards,

Kingsley Idehen       
President & CEO 
OpenLink Software     
Web: http://www.openlinksw.com
Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter/Identi.ca: kidehen 






------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to