Skip to content

Commit

Permalink
aggregatedVia must be indexed, code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
GordeaS authored and GordeaS committed Mar 28, 2024
1 parent d90b752 commit 6cbd2ae
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,47 @@ public class Agent extends Entity {

public Agent(Agent copy) {
super(copy);
if (copy.getDate() != null) this.date = new ArrayList<>(copy.getDate());
if (copy.getBegin() != null) this.begin = new ArrayList<>(copy.getBegin());
if (copy.getEnd() != null) this.end = new ArrayList<>(copy.getEnd());
if (copy.getDateOfBirth() != null) this.dateOfBirth = new ArrayList<>(copy.getDateOfBirth());
if (copy.getDateOfDeath() != null) this.dateOfDeath = new ArrayList<>(copy.getDateOfDeath());
if (copy.getWasPresentAt() != null) this.wasPresentAt = new ArrayList<>(copy.getWasPresentAt());
if (copy.getHasMet() != null) this.hasMet = new ArrayList<>(copy.getHasMet());
if (copy.getName() != null) this.name = new HashMap<>(copy.getName());
if (copy.getBiographicalInformation() != null)
if (copy.getDate() != null) {
this.date = new ArrayList<>(copy.getDate());
}
if (copy.getBegin() != null) {
this.begin = new ArrayList<>(copy.getBegin());
}
if (copy.getEnd() != null) {
this.end = new ArrayList<>(copy.getEnd());
}
if (copy.getDateOfBirth() != null) {
this.dateOfBirth = new ArrayList<>(copy.getDateOfBirth());
}
if (copy.getDateOfDeath() != null) {
this.dateOfDeath = new ArrayList<>(copy.getDateOfDeath());
}
if (copy.getWasPresentAt() != null) {
this.wasPresentAt = new ArrayList<>(copy.getWasPresentAt());
}
if (copy.getHasMet() != null) {
this.hasMet = new ArrayList<>(copy.getHasMet());
}
if (copy.getName() != null) {
this.name = new HashMap<>(copy.getName());
}
if (copy.getBiographicalInformation() != null) {
this.biographicalInformation = new HashMap<>(copy.getBiographicalInformation());
}
if (copy.getProfessionOrOccupation() != null)
this.professionOrOccupation = new ArrayList<>(copy.getProfessionOrOccupation());
if (copy.getPlaceOfBirth() != null) this.placeOfBirth = new ArrayList<>(copy.getPlaceOfBirth());
if (copy.getPlaceOfDeath() != null) this.placeOfDeath = new ArrayList<>(copy.getPlaceOfDeath());
if (copy.getPlaceOfBirth() != null) {
this.placeOfBirth = new ArrayList<>(copy.getPlaceOfBirth());
}
if (copy.getPlaceOfDeath() != null) {
this.placeOfDeath = new ArrayList<>(copy.getPlaceOfDeath());
}
this.dateOfEstablishment = copy.getDateOfEstablishment();
this.dateOfTermination = copy.getDateOfTermination();
this.gender = copy.getGender();
if (copy.getSameReferenceLinks() != null) this.sameAs = (new ArrayList<>(copy.getSameReferenceLinks()));
if (copy.getSameReferenceLinks() != null) {
this.sameAs = (new ArrayList<>(copy.getSameReferenceLinks()));
}
}

public Agent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static eu.europeana.entitymanagement.vocabulary.WebEntityFields.PREF_LABEL;
import static eu.europeana.entitymanagement.vocabulary.WebEntityFields.SAME_AS;
import static eu.europeana.entitymanagement.vocabulary.WebEntityFields.TYPE;
import static eu.europeana.entitymanagement.vocabulary.WebEntityFields.IS_AGGREGATED_BY;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -58,7 +59,8 @@
AGGREGATES_FROM,
AGGREGATED_VIA,
IDENTIFIER,
SAME_AS
SAME_AS,
IS_AGGREGATED_BY
})
public class Organization extends Entity {

Expand All @@ -84,7 +86,8 @@ public class Organization extends Entity {

private Address hasAddress;
private List<String> sameAs;
@Transient private List<String> aggregatesFrom;
@Transient
private List<String> aggregatesFrom;
private List<String> aggregatedVia;
private List<String> language;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public enum EntityFieldsTypes {
hiddenLabel(
EntityFieldsTypes.FIELD_TYPE_KEYWORD, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
sameAs(EntityFieldsTypes.FIELD_TYPE_URI, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
aggregatesFrom(EntityFieldsTypes.FIELD_TYPE_URI, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
aggregatedVia(EntityFieldsTypes.FIELD_TYPE_URI, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
language(
EntityFieldsTypes.FIELD_TYPE_TEXT, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),

Expand Down Expand Up @@ -114,6 +112,10 @@ public enum EntityFieldsTypes {
EntityFieldsTypes.FIELD_TYPE_KEYWORD, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
mbox(EntityFieldsTypes.FIELD_TYPE_EMAIL, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
hasAddress(EntityFieldsTypes.FIELD_TYPE_ADDRESS, false, EntityFieldsTypes.FIELD_CARDINALITY_0_1),
//note: SG - aggregatesFrom is not stored, we should probably remove it from here
// aggregatesFrom(EntityFieldsTypes.FIELD_TYPE_URI, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),
aggregatedVia(EntityFieldsTypes.FIELD_TYPE_URI, false, EntityFieldsTypes.FIELD_CARDINALITY_0_INFINITE),


// Address-specific fields
streetAddress(EntityFieldsTypes.FIELD_TYPE_TEXT, false, EntityFieldsTypes.FIELD_CARDINALITY_0_1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<copyField source="owl_sameAs" dest="coref" />
<copyField source="skos_exactMatch" dest="coref" />

<field name="edm_aggregatedVia" type="string" indexed="false"
<field name="edm_aggregatedVia" type="string" indexed="yes"
stored="true" multiValued="true" />

<field name="foaf_depiction" type="string" indexed="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -102,9 +103,7 @@ public List<EntityRecord> retrieveMultipleByEntityIds(List<String> entityIds,
setAggregatesFromForOrganizations(record.getEntity());
}
}

return resp;

return resp;
}

public List<EntityRecord> retrieveMultipleByEntityIdsOrCoreference(List<String> entityIds) {
Expand Down

0 comments on commit 6cbd2ae

Please sign in to comment.