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

Upgrade the taxonomy term loading #90

Open
idimopoulos opened this issue Mar 23, 2019 · 0 comments
Open

Upgrade the taxonomy term loading #90

idimopoulos opened this issue Mar 23, 2019 · 0 comments

Comments

@idimopoulos
Copy link
Contributor

idimopoulos commented Mar 23, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant