Resolved: SPARQL Filter Date VALUES

Question:

I have created an RDF dataset in protege having dates of type “datetime” (I have not found option of creating simple dates)
I have the following query:
SELECT ?date
 WHERE {
   ?p ex:date ?date. 
   VALUES ?date {  2022-07-27T00:00:00  } 
} 
And I am getting the following error:
Undefined namespace prefix at 'T00' before ':00'
Is there a way to use VALUES to filter dates? I tried to use string as the type of the dates in protege’ but I am still cannot filter dates using ‘VALUES’ in the SPARQL query.
Could you help me, please?

Answer:

The problem solved after putting the literal in double quotes and also adding the datatype I needed as follows:
SELECT ?date
 WHERE {
   ?p ex:date ?date. 
   VALUES ?date {   "2022-07-27"^^<w3.org/2001/XMLSchema#dateTime>  } 
} 

If you have better answer, please add a comment about this, thank you!

If you like this answer, you can give me a coffee by <a href=”https://violencegloss.com/mkw7pgdwwr?key=2a96ade6f3760c7e63343a320febb78e”>click here</a>

Source: Stackoverflow.com