SPARQL selecione opcional com o idioma
Tenho alguns triplos parecidos com este:
test:thing rdfs:label "Non-Language Label"
test:thing rdfs:label "English Label"@en
test:thing rdfs:label "French Label"@fr
Gostaria de formar uma consulta sparql que me dê o "Non-Language Label" E o "French Label", se houver algu
Tentei isso e não está funcionando:
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'))
}
}
Desde já, obrigado