# Which literals have xsd:string as a datatype

PREFIX :        <http://example/> 
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?x
{ ?x :p ?v . 
  FILTER( datatype(?v) = rdf:langString ) 
}
