Skip to content

Commit

Permalink
#175: restore old models - with new 'person2' as experiment for getti…
Browse files Browse the repository at this point in the history
…ng position/organization as objects
  • Loading branch information
Rob Nelson committed Jan 30, 2020
1 parent 8fd749a commit 52b4dbe
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -67,7 +67,7 @@ public class Organization extends AbstractNestedDocument {

private List<OrganizationForTraining> organizationForTraining;

private List<Person> people;
private List<People> people;

private List<HasSubOrganization> hasSubOrganizations;

Expand Down Expand Up @@ -214,11 +214,11 @@ public void setOrganizationForTraining(List<OrganizationForTraining> organizatio
this.organizationForTraining = organizationForTraining;
}

public List<Person> getPeople() {
public List<People> getPeople() {
return people;
}

public void setPeople(List<Person> people) {
public void setPeople(List<People> people) {
this.people = people;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -55,7 +55,7 @@
public class Person extends AbstractNestedDocument {
private static final long serialVersionUID = -3444805L;

private List<Position> positions;
private List<Relationship> positions;

private List<ResearchArea> researchAreas;

Expand Down Expand Up @@ -214,11 +214,11 @@ public Person() {
super();
}

public List<Position> getPositions() {
public List<Relationship> getPositions() {
return positions;
}

public void setPositions(List<Position> positions) {
public void setPositions(List<Relationship> positions) {
this.positions = positions;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
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;

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 = "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<PositionOrganization> organizations;
private String title;

public Position() {
public People() {
super();
}

Expand All @@ -48,11 +45,11 @@ public void setType(String type) {
this.type = type;
}

public List<PositionOrganization> getOrganizations() {
return organizations;
public String getTitle() {
return title;
}

public void setOrganizations(List<PositionOrganization> organizations) {
this.organizations = organizations;
public void setTitle(String title) {
this.title = title;
}
}

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions src/main/resources/graphql/composites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 ) .
Expand Down

0 comments on commit 52b4dbe

Please sign in to comment.