@@ -469,29 +469,35 @@ private String process(String field, String value, String label, int i, int size
469
469
} else if (Arrays .asList ("dateOfBirth" , "dateOfDeath" ).contains (field )) {
470
470
result = germanDate (value );
471
471
}
472
- else if (value .startsWith ("http" ) && !value .contains (" " )) {
472
+ else if (value .startsWith ("http" )) {
473
+ String url = value ;
474
+ String rest = "" ;
475
+ if (value .contains (" " )) {
476
+ url = value .substring (0 , value .indexOf (' ' ));
477
+ rest = value .substring (value .indexOf (' ' ) + 1 , value .length ());
478
+ }
473
479
List <String > facets = Arrays .asList (HomeController .AGGREGATIONS );
474
480
boolean labelBasedFacet = facets .contains (field + ".label" );
475
481
boolean qBasedSearch = facets .stream ().noneMatch (s -> s .startsWith (field ));
476
482
boolean plainUriField = field .equals ("source" ) || field .equals ("publication" );
477
483
String searchField = (field + (plainUriField ? "" : ".id" )).replace ("source" ,
478
484
"describedBy.source" );
479
- label = plainUriField ? labelFor (value ) : label ;
485
+ label = plainUriField ? labelFor (url ) : label ;
480
486
String search = controllers .routes .HomeController
481
- .search (qBasedSearch ? searchField + ":\" " + value + "\" " : "" , "" , "" , "" , "" , "" ,
487
+ .search (qBasedSearch ? searchField + ":\" " + url + "\" " : "" , "" , "" , "" , "" , "" ,
482
488
labelBasedFacet ? field + ".label:\" " + label + "\" "
483
- : searchField + ":\" " + value + "\" " , "" , 0 , 10 , "html" )
489
+ : searchField + ":\" " + url + "\" " , "" , 0 , 10 , "html" )
484
490
.toString ();
485
491
String searchLink = String .format (
486
492
"<a id='%s-%s' title='Weitere Einträge mit %s \" %s\" suchen' href='%s'>%s</a>" , //
487
493
field , i , GndOntology .label (field ), label , search , label );
488
494
String entityLink = String .format (
489
495
"<a title='Linked-Data-Quelle zu \" %s\" anzeigen' href='%s'>"
490
496
+ "<i class='octicon octicon-link text-muted' aria-hidden='true'></i></a>" ,
491
- label , value );
497
+ label , url );
492
498
boolean linkableEntity = field .equals ("relatedPerson" ) || plainUriField
493
- || (field .startsWith ("place" ) && value .contains ("spatial" ));
494
- result = searchLink + " " + (linkableEntity ? entityLink : "" );
499
+ || (field .startsWith ("place" ) && url .contains ("spatial" ));
500
+ result = searchLink + " " + (linkableEntity ? entityLink : "" ) + " " + rest ;
495
501
} else if (field .endsWith ("AsLiteral" )) {
496
502
String search = controllers .routes .HomeController
497
503
.search ("" , "" , "" , "" , "" , "" , field + ":\" " + value + "\" " , "" , 0 , 10 , "html" )
0 commit comments