The SPARQL function langMatches can be used to compare the language tags of RDF literals in SPARQL queries. The simple equality operator, =, can be used to compare exact string matches, but will not correctly consider regional variants. For instance, the four possible values of ?str in:
values ...