Skip to content
This repository was archived by the owner on Aug 25, 2022. It is now read-only.
This repository was archived by the owner on Aug 25, 2022. It is now read-only.

Upgrade the taxonomy term loading #90

Open
@idimopoulos

Description

@idimopoulos

The \Drupal\rdf_taxonomy\TermRdfStorage::loadTree method is using the following hardcoded query to load the terms:

SELECT DISTINCT ?tid ?label ?parent
WHERE {
  ?tid ?relation <$concept_schema> .
  ?tid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
  ?tid <http://www.w3.org/2004/02/skos/core#prefLabel> ?label .
  FILTER (?relation IN (<http://www.w3.org/2004/02/skos/core#inScheme>, <http://www.w3.org/2004/02/skos/core#topConceptOf>) ) .
  FILTER (lang(?label) = 'en') .
  OPTIONAL {?tid <http://www.w3.org/2004/02/skos/core#broaderTransitive> ?parent }
}
ORDER BY (STR(?label))

Now that the mapping entities are in place, the predicate (the ?relation variable) can be predictable and the rest of the properties are not restricted. The terms don't need to use the http://www.w3.org/2004/02/skos/core#broaderTransitive to designate the parent.

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