Skip to content

Commit

Permalink
Exclude properties ending with 'alternateNames.size'
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Mar 7, 2023
1 parent 2954d4e commit a309070
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ public void unregisterEntity( String prefix, Class<?> entityClass ) {
throw new IllegalArgumentException( "A non-empty prefix must end with a '.' character." );
}
if ( entityByPrefix.remove( prefix, entityClass ) ) {
if ( !filterableProperties.removeIf( s -> s.startsWith( prefix ) ) ) {
if ( filterableProperties.removeIf( s -> s.startsWith( prefix ) ) ) {
// remove entities registered under sub-prefixes
entityByPrefix.keySet().removeIf( p -> p.startsWith( prefix ) );
} else {
log.warn( String.format( "While unregistering %s %s, no properties were removed. Is it possible that a parent prefix was already removed?",
entityClass.getName(), summarizePrefix( prefix ) ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,8 @@ private Query finishFilteringQuery( String queryString, @Nullable Filters filter
protected void configureFilterableProperties( FilterablePropertiesConfigurer configurer ) {
super.configureFilterableProperties( configurer );
configurer.registerProperty( "taxon" );
configurer.unregisterProperty( "alternateNames.size" );
// this is not useful, unless we add an alias to the alternate names
configurer.unregisterProperties( p -> p.endsWith( "alternateNames.size" ) );
// because the ArrayDesign is the root property, and we allow at most 3 level, some of the recursive properties
// (i.e. referring to another AD) will properties in a bunch of useless prefix such as mergedInto.mergedInto. To
// disallow this, we remove those properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,9 @@ protected void configureFilterableProperties( FilterablePropertiesConfigurer con
configurer.registerEntity( "primaryPublication.pubAccession.", DatabaseEntry.class, 2 );
configurer.unregisterProperty( "primaryPublication.pubAccession.Uri" );

// this is not useful, unless we add an alias to the alternate names
configurer.unregisterProperties( p -> p.endsWith( "alternateNames.size" ) );

// attached terms
configurer.registerAlias( "characteristics.", CHARACTERISTIC_ALIAS, Characteristic.class, null, 1 );
configurer.unregisterProperty( "characteristics.originalValue" );
Expand Down

0 comments on commit a309070

Please sign in to comment.