SPARQL select opcional con idioma
Tengo algunos triples que se ven así:
test:thing rdfs:label "Non-Language Label"
test:thing rdfs:label "English Label"@en
test:thing rdfs:label "French Label"@fr
Me gustaría formar una consulta sparql que me proporcione la "Etiqueta no lingüística" Y la "Etiqueta francesa", si existe alguna.
Intenté esto y no funciona:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label ?preferredLabel
WHERE {
test:thing rdfs:label ?label
OPTIONAL {
test:thing rdfs:label ?preferredLabel .
FILTER (regex(str(?preferredLabel), '(^|\\\\W)fr', 'i'))
}
}
¡Gracias por adelantado