Skip to content

Sarql query - How to deal with available languages #22

Description

The available languages for a property vary from object to object. For instance, the following query will work if we ask for "FR" but won't work if we ask for "EN" (the item labels are available in french and english, but the classification label exists only in english):

 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
 PREFIX xkos:<http://rdf-vocabulary.ddialliance.org/xkos#>
 SELECT ?label ?clLabel ?parentLabel {
    <http://stamina-project.org/codes/cpfr21/categorie/47.00.1> skos:prefLabel ?label ;
                                                                skos:inScheme ?cl .
    ?cl skos:prefLabel ?clLabel .

    <http://stamina-project.org/codes/cpfr21/categorie/47.00.1> skos:broader ?parent .
      ?parent skos:prefLabel ?parentLabel .

    FILTER (langMatches(lang(?label), "FR") && langMatches(lang(?parentLabel), "FR") && langMatches(lang(?clLabel), "FR"))
  }

Note: this is a simplified version of itemDetails query.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions