Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions controller/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ public function vocabularyInformation($request)
'uri' => '@id',
'type' => '@type',
'conceptschemes' => 'onki:hasConceptScheme',
'mainConceptScheme' => array(
'@id' => 'onki:mainConceptScheme',
'@type' => '@id'
),
'id' => 'onki:vocabularyIdentifier',
'defaultLanguage' => 'onki:defaultLanguage',
'languages' => 'onki:language',
Expand All @@ -241,6 +245,7 @@ public function vocabularyInformation($request)
'defaultLanguage' => $vocab->getConfig()->getDefaultLanguage(),
'languages' => array_values($vocab->getConfig()->getLanguages()),
'conceptschemes' => $conceptschemes,
'mainConceptScheme' => $vocab->getConfig()->getMainConceptSchemeURI()
);

if ($vocab->getConfig()->getTypes($request->getLang())) {
Expand Down
9 changes: 5 additions & 4 deletions resource/js/hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,12 @@ function getTreeConfiguration() {
req_kind: $.ajaxQ.requestKind.SIDEBAR_PRIVILEGED,
success: function (response) {
schemeObjects = schemeRoot(response.conceptschemes);
// if there are multiple concept schemes display those at the top level
if (schemeObjects.length > 1 && node.id === '#' && $('#vocab-info').length) {
// if there are multiple concept schemes and none of them is the main concept scheme,
// display them all at the top level
if (schemeObjects.length > 1 && node.id === '#' && $('#vocab-info').length && response.mainConceptScheme === null) {
return cb(schemeObjects);
}
// if there was only one concept scheme display it's top concepts at the top level
}
// if there was only one concept scheme (possibly main) display its top concepts at the top level
else if(node.id === '#' && $('#vocab-info').length) {
$.ajax({
data: $.param({'lang': clang}),
Expand Down
3 changes: 3 additions & 0 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,9 @@
"$ref": "#/definitions/ConceptScheme"
}
},
"mainConceptScheme": {
"type": "string"
},
"type": {
"description": "Optional vocabulary classification e.g. 'http://publications.europa.eu/resource/authority/dataset-type/ONTOLOGY'",
"type": "array",
Expand Down