year() function in SPARQL

Jéjé

I want to make a query in SPARQL that returns items of the year 2007. I tried this :

    String requete7String = 
            "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "
          + "PREFIX dc: <http://purl.org/dc/elements/1.1/> "
          + "PREFIX rss: <http://purl.org/rss/1.0/> "
          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
          + "SELECT ?item "
          + "FROM <http://www.w3.org/2001/sw/SW-FAQ-feed.rdf> "
          + "WHERE { "
          + "  ?item rdf:type rss:item . "
          + "  ?item dc:date ?dateString ."
          + "  bind(strdt(?dateString, xsd:dateTime) as ?date) "
          + "  FILTER (year(?date) = 2007) "
          + "}";

But it returns nothing. The line FILTER (year(?date) = 2007) doesn't work. However, I saw in SPARQL documentaiton that the function year() takes a dateTime and returns a integer, so can you tell me why it might not work?

AndyS

2007-04-12T00:00+00:00"^^xsd:dateTime isn't a legal xsd:dateTime (the time part should be 00:00:00, not 00:00. Therefore it is not a legal value and year(illegal) is error, and the filter is false.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

year() function in SPARQL

From Dev

What is the lang function in SPARQL?

From Dev

property function extension sparql

From Dev

property function extension sparql

From Dev

Mysql YEAR function not supported?

From Dev

Alternative to Year function in Oracle

From Dev

Calculating a leap year without the leap year function

From Dev

Debugging sparql function return values in dotNetRDF

From Dev

Use COUNT inside a CONSTRUCT function in SPARQL

From Dev

YEAR function is not Working in Symfony 2

From Dev

Get year with custom php function

From Dev

pandas to_datetime function default year

From Dev

Cast function returning year and month only

From Dev

PHP strtotime Function: first day of this year

From Dev

How to use .year inside function in KDB?

From Dev

Loop for atan2 function by year in R

From Dev

excel vba compile error on year function

From Dev

SQL Server 2008 Function for Current Academic Year

From Dev

Leap year function doesn't work

From Dev

R Create function to add water year column

From Dev

Using YEAR function in MAXIFS criteria in excel

From Dev

Google Sheets function "=Year(2001)" returns 1905

From Dev

using current year in string to date function

From Dev

Is there any function for reprent final day of year in mysql

From Dev

SQL Server 2008 Function for Current Academic Year

From Dev

Leap year function doesn't work

From Dev

PHP strtotime Function: first day of this year

From Dev

Time Ago Function with Month and Year Android

From Dev

Create function centuryFromYear($year) in php language?