Hi,

On 09/15/2012 08:02 PM, Jürgen Jakobitsch wrote:
> hi,
>          
> inspired by this page [1] i tried to sparql
> for people who managed to die on their birthday.
>          
> with this query
>          
> PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
> SELECT *
> WHERE {
>   ?s<http://dbpedia.org/property/birthDate>  ?bd
>   FILTER(datatype(?bd)=xsd:date).
>          
>    ?s<http://dbpedia.org/property/deathDate>  ?dd
>    FILTER(datatype(?dd)=xsd:date).
>          
>    FILTER(MONTH(?bd)=MONTH(?dd) && DAY(?bd)=DAY(?dd)) .
> } LIMIT 10
>          
> i get this error [2] at dbpedia's sparqlEndpoint,
> i also tried different birthDate properties that are available but the
> result stays the same.
> when i look at a resource's page it says the all these dates are of type
> xsd:date (example :http://dbpedia.org/page/Le_Corbusier)
>          
> any pointer appreciated..
> wkr turnguard
>          
>          
> [1]http://www.aboutthisday.com
> [2] Virtuoso 22007 Error DT001: Function month needs a datetime, date or
> time as argument 1, not an arg of type rdf (246)

the following one should work:

PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?bd ?dd
WHERE {
  ?s <http://dbpedia.org/property/birthDate> ?bd
  FILTER(datatype(?bd)=xsd:date).

  ?s <http://dbpedia.org/property/deathDate> ?dd
  FILTER(datatype(?dd)=xsd:date).

  FILTER (bif:substring(STR(?bd), 6, 2) = bif:substring(STR(?dd), 6, 2) 
&& bif:substring(STR(?bd), 9, 2) = bif:substring(STR(?dd), 9, 4) ).

} LIMIT 100


-- 
Kind Regards
Mohamed Morsey
Department of Computer Science
University of Leipzig


------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to