From 7545270bd48c0075c6ec56ee5a255a87c4aec0e8 Mon Sep 17 00:00:00 2001 From: DiegoPino Date: Tue, 30 Dec 2014 17:56:07 -0300 Subject: [PATCH 1/3] Restored isPartOf, order by, added comp. predicate --- includes/breadcrumb.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index e75a0fdd..76d1cb28 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -12,7 +12,7 @@ * * Each link in the bread-crumbs represents a member of the given objects * ancestry which is identified by any of the following RELS-EXT terms - * (isMemberOf,isMemberOfCollection,isPartOf). + * (isMemberOf,isMemberOfCollection,isPartOf,isConstituentOf). * * @param AbstractObject $object * An object whose ancestry will be mapped to bread-crumbs. @@ -84,13 +84,14 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository, SELECT DISTINCT ?object ?label FROM <#ri> WHERE { - ?collection_predicate ?object; + ?parentship_predicate ?object; ?label . ?object . !optionals !filters } + !order EOQ; $query_optionals = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_optionals', 'view'); @@ -98,10 +99,15 @@ EOQ; $filter_map = function ($filter) { return "FILTER($filter)"; }; - $query_filters[] = "sameTerm(?collection_predicate, ) || sameTerm(?collection_predicate, )"; + $compound_object_predicate = variable_get('islandora_compound_object_relationship', 'isConstituentOf'); + $parentship_predicate_filters = "sameTerm(?parentship_predicate, ) || sameTerm(?parentship_predicate, )"; + $parentship_predicate_filters .= " || sameTerm(?parentship_predicate, ) || sameTerm(?parentship_predicate, )"; + $query_filters[] = $parentship_predicate_filters; + $query_order = "ORDER BY DESC(?label)"; $query = format_string($query, array( '!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '', '!filters' => implode(' ', array_map($filter_map, $query_filters)), + '!order' => $query_order, )); $query = format_string($query, array( '!pid' => $pid, From d5660bd0a0b36a29341cfdb21515d8a2d16d92bd Mon Sep 17 00:00:00 2001 From: DiegoPino Date: Thu, 26 Feb 2015 12:21:25 -0300 Subject: [PATCH 2/3] Restored predicate var, removed ext. mod. var get as defined by committers call Feb. 19, 2015 --- includes/breadcrumb.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index 76d1cb28..fb1054fc 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -84,7 +84,7 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository, SELECT DISTINCT ?object ?label FROM <#ri> WHERE { - ?parentship_predicate ?object; + ?collection_predicate ?object; ?label . ?object . @@ -99,10 +99,9 @@ EOQ; $filter_map = function ($filter) { return "FILTER($filter)"; }; - $compound_object_predicate = variable_get('islandora_compound_object_relationship', 'isConstituentOf'); - $parentship_predicate_filters = "sameTerm(?parentship_predicate, ) || sameTerm(?parentship_predicate, )"; - $parentship_predicate_filters .= " || sameTerm(?parentship_predicate, ) || sameTerm(?parentship_predicate, )"; - $query_filters[] = $parentship_predicate_filters; + $collection_predicate_filters = "sameTerm(?collection_predicate, )"; + $collection_predicate_filters .= " || sameTerm(?collection_predicate, ) || sameTerm(?collection_predicate, )"; + $query_filters[] = $collection_predicate_filters; $query_order = "ORDER BY DESC(?label)"; $query = format_string($query, array( '!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '', From a07f6b144b8a20aee9b665a98e20cd662390a9b1 Mon Sep 17 00:00:00 2001 From: DiegoPino Date: Thu, 26 Feb 2015 12:27:15 -0300 Subject: [PATCH 3/3] Removed comment in ref. to removed code flushing all reference to isConstituentOf --- includes/breadcrumb.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index fb1054fc..e3eb2782 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -12,7 +12,7 @@ * * Each link in the bread-crumbs represents a member of the given objects * ancestry which is identified by any of the following RELS-EXT terms - * (isMemberOf,isMemberOfCollection,isPartOf,isConstituentOf). + * (isMemberOf,isMemberOfCollection,isPartOf). * * @param AbstractObject $object * An object whose ancestry will be mapped to bread-crumbs.