diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Organization.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Organization.java index 4e17de7d2..378fd8b7b 100644 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Organization.java +++ b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Organization.java @@ -5,7 +5,7 @@ import edu.tamu.scholars.middleware.graphql.model.organization.AwardOrHonorGiven; import edu.tamu.scholars.middleware.graphql.model.organization.AwardOrHonorReceived; import edu.tamu.scholars.middleware.graphql.model.organization.OrganizationForTraining; -import edu.tamu.scholars.middleware.graphql.model.Person; +import edu.tamu.scholars.middleware.graphql.model.organization.People; import edu.tamu.scholars.middleware.graphql.model.organization.HasSubOrganization; import edu.tamu.scholars.middleware.graphql.model.organization.OrganizationWithin; import edu.tamu.scholars.middleware.graphql.model.organization.LeadOrganizationOf; @@ -67,7 +67,7 @@ public class Organization extends AbstractNestedDocument { private List organizationForTraining; - private List people; + private List people; private List hasSubOrganizations; @@ -214,11 +214,11 @@ public void setOrganizationForTraining(List organizatio this.organizationForTraining = organizationForTraining; } - public List getPeople() { + public List getPeople() { return people; } - public void setPeople(List people) { + public void setPeople(List people) { this.people = people; } diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Person.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Person.java index fa2fc2e95..fc43c562f 100644 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Person.java +++ b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Person.java @@ -1,6 +1,6 @@ package edu.tamu.scholars.middleware.graphql.model; -import edu.tamu.scholars.middleware.graphql.model.person.Position; +import edu.tamu.scholars.middleware.graphql.model.Relationship; import edu.tamu.scholars.middleware.graphql.model.person.ResearchArea; import edu.tamu.scholars.middleware.graphql.model.person.GeographicFocus; import edu.tamu.scholars.middleware.graphql.model.person.HeadOf; @@ -55,7 +55,7 @@ public class Person extends AbstractNestedDocument { private static final long serialVersionUID = -3444805L; - private List positions; + private List positions; private List researchAreas; @@ -214,11 +214,11 @@ public Person() { super(); } - public List getPositions() { + public List getPositions() { return positions; } - public void setPositions(List positions) { + public void setPositions(List positions) { this.positions = positions; } diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/Position.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/organization/People.java similarity index 57% rename from src/main/java/edu/tamu/scholars/middleware/graphql/model/person/Position.java rename to src/main/java/edu/tamu/scholars/middleware/graphql/model/organization/People.java index 35d87bf89..1d19f1e71 100644 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/Position.java +++ b/src/main/java/edu/tamu/scholars/middleware/graphql/model/organization/People.java @@ -1,6 +1,4 @@ -package edu.tamu.scholars.middleware.graphql.model.person; - -import edu.tamu.scholars.middleware.graphql.model.person.PositionOrganization; +package edu.tamu.scholars.middleware.graphql.model.organization; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; @@ -8,7 +6,6 @@ import edu.tamu.scholars.middleware.graphql.model.AbstractNestedDocument; import io.leangen.graphql.annotations.types.GraphQLType; import java.lang.String; -import java.util.List; /** * This file is automatically generated on compile. @@ -16,19 +13,19 @@ * Do not modify this file -- YOUR CHANGES WILL BE ERASED! */ @GraphQLType( - name = "PersonPosition" + name = "OrganizationPeople" ) @JsonInclude(NON_EMPTY) -public class Position extends AbstractNestedDocument { - private static final long serialVersionUID = -294827460L; +public class People extends AbstractNestedDocument { + private static final long serialVersionUID = 1885561156L; private String label; private String type; - private List organizations; + private String title; - public Position() { + public People() { super(); } @@ -48,11 +45,11 @@ public void setType(String type) { this.type = type; } - public List getOrganizations() { - return organizations; + public String getTitle() { + return title; } - public void setOrganizations(List organizations) { - this.organizations = organizations; + public void setTitle(String title) { + this.title = title; } } diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganization.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganization.java deleted file mode 100644 index f78965ff2..000000000 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganization.java +++ /dev/null @@ -1,48 +0,0 @@ -package edu.tamu.scholars.middleware.graphql.model.person; - -import edu.tamu.scholars.middleware.graphql.model.person.PositionOrganizationParent; - -import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; - -import com.fasterxml.jackson.annotation.JsonInclude; -import edu.tamu.scholars.middleware.graphql.model.AbstractNestedDocument; -import io.leangen.graphql.annotations.types.GraphQLType; -import java.lang.String; -import java.util.List; - -/** - * This file is automatically generated on compile. - * - * Do not modify this file -- YOUR CHANGES WILL BE ERASED! - */ -@GraphQLType( - name = "PersonPositionOrganization" -) -@JsonInclude(NON_EMPTY) -public class PositionOrganization extends AbstractNestedDocument { - private static final long serialVersionUID = -913043057L; - - private String label; - - private List parent; - - public PositionOrganization() { - super(); - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public List getParent() { - return parent; - } - - public void setParent(List parent) { - this.parent = parent; - } -} diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganizationParent.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganizationParent.java deleted file mode 100644 index 5512c65eb..000000000 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/person/PositionOrganizationParent.java +++ /dev/null @@ -1,35 +0,0 @@ -package edu.tamu.scholars.middleware.graphql.model.person; - -import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; - -import com.fasterxml.jackson.annotation.JsonInclude; -import edu.tamu.scholars.middleware.graphql.model.AbstractNestedDocument; -import io.leangen.graphql.annotations.types.GraphQLType; -import java.lang.String; - -/** - * This file is automatically generated on compile. - * - * Do not modify this file -- YOUR CHANGES WILL BE ERASED! - */ -@GraphQLType( - name = "PersonPositionOrganizationParent" -) -@JsonInclude(NON_EMPTY) -public class PositionOrganizationParent extends AbstractNestedDocument { - private static final long serialVersionUID = -1355915495L; - - private String label; - - public PositionOrganizationParent() { - super(); - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } -} diff --git a/src/main/resources/graphql/composites.yml b/src/main/resources/graphql/composites.yml index d0e4e9a38..4b779a96a 100644 --- a/src/main/resources/graphql/composites.yml +++ b/src/main/resources/graphql/composites.yml @@ -2,12 +2,12 @@ - type: Person references: -# - name: positions -# type: Relationship + - name: positions + type: Relationship - name: publications type: Document -- type: Organization - references: - - name: people - type: Person +#- type: Organization +# references: +# - name: people +# type: Person diff --git a/src/main/resources/templates/sparql/relationship/organization.sparql b/src/main/resources/templates/sparql/relationship/organization.sparql index 9082f7c11..1e54bff9e 100644 --- a/src/main/resources/templates/sparql/relationship/organization.sparql +++ b/src/main/resources/templates/sparql/relationship/organization.sparql @@ -5,7 +5,7 @@ PREFIX rdfs: CONSTRUCT { ?organization rdfs:label ?labelWithIds . } WHERE { - <{{uri}}> vivo:relatedBy ?organization . + <{{uri}}> vivo:relates ?organization . ?organization a foaf:Organization . ?organization rdfs:label ?label . BIND( CONCAT( STR(?label), REPLACE(STR(?organization), "(^.*/)", "::") ) AS ?labelWithIds ) .