I have some triples that look like this:
test:thing rdfs:label "Non-Language Label"
test:thing rdfs:label "English Label"@en
test:thing rdfs:label "French Label"@fr
I'd like to form a sparql query that gives me the "Non-Language Label" AND the "French Label", if any exists.
I tried this and it's not working:
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'))
}
}
Thanks in advance!