Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label languages handling #45

Open
vhf opened this issue Nov 26, 2019 · 1 comment
Open

Label languages handling #45

vhf opened this issue Nov 26, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vhf
Copy link
Contributor

vhf commented Nov 26, 2019

As expected, querying a datacube (A) without specifying a language and (B) with specifying "" as language do not behave the same way.

A

  OPTIONAL {
    ?raum (rdfs:label|skos:prefLabel) ?raumLabel.
  }

B

  OPTIONAL {
    ?raum (rdfs:label|skos:prefLabel) ?raumLabel_.
    FILTER((LANG(?raumLabel_)) = ""^^xsd:string)
  }
  BIND(COALESCE(?raumLabel_, ""^^xsd:string) AS ?raumLabel)

At the moment, B is correct but A isn't properly handled and instead outputs the following, which will always evaluate to the empty string as label:

  BIND(COALESCE(""^^xsd:string) AS ?raumLabel)
@vhf vhf added the bug Something isn't working label Nov 26, 2019
@vhf vhf self-assigned this Nov 26, 2019
@vhf
Copy link
Contributor Author

vhf commented Jan 27, 2020

Probably related to this issue is this problematic SPARQL query:

# https://trifid-lindas.test.cluster.ldbar.ch/query
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX dc11: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?value ?label FROM <https://linked.opendata.swiss/graph/blv/animalpest>
WHERE {
  ?observation rdf:type qb:Observation;
    <http://ld.zazuko.com/animalpest/attribute/canton> ?value;
    qb:dataSet <http://ld.zazuko.com/animalpest/dataset>.
  OPTIONAL {
    ?value (rdfs:label|skos:prefLabel) ?label_de.
	# comment next line
    FILTER(LANGMATCHES(LANG(?label_de), "de"^^xsd:string))
  }
  BIND(COALESCE(?label_de, ""^^xsd:string) AS ?label)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant