diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java index bd6283c4..217aa51a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java @@ -60,7 +60,14 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme conf.setN3Required( Arrays.asList( n3ForNewRole, roleLabelAssertion) ); - conf.setN3Optional( Arrays.asList( n3ForNewPresentation, presTypeAssertion, n3ForExistingPresentation, n3ForNewConference, n3ForExistingConference, n3ForStart, n3ForEnd ) ); + conf.setN3Optional( Arrays.asList( n3ForNewPresentation, + n3ForExistingPresentation, + n3ForNewConferenceNewPres, + n3ForNewConferenceExistingPres, + n3ForExistingConferenceNewPres, + n3ForExistingConferenceExistingPres, + n3ForStart, + n3ForEnd ) ); conf.addNewResource("presentation", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newConference", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -175,26 +182,35 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme final static String n3ForNewPresentation = "?role <" + roleRealizedInPred + "> ?presentation . \n" + "?presentation <" + realizedRolePred + "> ?role . \n" + - "?presentation <" + label + "> ?presentationLabel ."; + "?presentation <" + label + "> ?presentationLabel . \n" + + "?presentation a ?presentationType ."; final static String n3ForExistingPresentation = "?role <" + roleRealizedInPred + "> ?existingPresentation . \n" + - "?existingPresentation <" + realizedRolePred + "> ?role . "; - - final static String presTypeAssertion = - "?presentation a ?presentationType ."; - - final static String n3ForNewConference = + "?existingPresentation <" + realizedRolePred + "> ?role . \n" + + "?existingPresentation a ?presentationType ."; + + final static String n3ForNewConferenceNewPres = "?presentation <" + eventWithinPred + "> ?newConference . \n" + "?newConference <" + includesEventPred + "> ?presentation . \n" + "?newConference a <" + conferenceClass + "> . \n" + "?newConference <" + label + "> ?conferenceLabel ."; + + final static String n3ForNewConferenceExistingPres = + "?existingPresentation <" + eventWithinPred + "> ?newConference . \n" + + "?newConference <" + includesEventPred + "> ?existingPresentation . \n" + + "?newConference a <" + conferenceClass + "> . \n" + + "?newConference <" + label + "> ?conferenceLabel ."; - final static String n3ForExistingConference = - "?existingConference a <" + conferenceClass + "> . \n" + + final static String n3ForExistingConferenceNewPres = "?existingConference <" + includesEventPred + "> ?presentation . \n" + - "?presentation <" + eventWithinPred + "> ?existingConference . "; + "?presentation <" + eventWithinPred + "> ?existingConference . \n" + + "?presentation <" + label + "> ?presentationLabel . "; + final static String n3ForExistingConferenceExistingPres = + "?existingConference <" + includesEventPred + "> ?existingPresentation . \n" + + "?existingPresentation <" + eventWithinPred + "> ?existingConference . "; + final static String n3ForStart = "?role <" + roleToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java index cb8cd8ba..9222d257 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java @@ -142,20 +142,34 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement /***N3 strings both required and optional***/ private List generateN3Optional() { - return list(getN3ForNewCollection(), + return list(getN3ForNewPub(), + getN3ForExistingPub(), + getN3ForNewCollection(), getN3ForNewBook(), getN3ForNewConference(), getN3ForNewEvent(), getN3ForNewEditor(), getN3ForNewPublisher(), + getN3ForNewCollectionNewPub(), + getN3ForNewBookNewPub(), + getN3ForNewConferenceNewPub(), + getN3ForNewEventNewPub(), + getN3ForNewEditorNewPub(), + getN3ForNewPublisherNewPub(), getN3ForCollection(), getN3ForBook(), getN3ForConference(), getN3ForEvent(), getN3ForEditor(), + getN3ForPublisher(), + getN3ForCollectionNewPub(), + getN3ForBookNewPub(), + getN3ForConferenceNewPub(), + getN3ForEventNewPub(), + getN3ForEditorNewPub(), + getN3ForPublisherNewPub(), getN3FirstNameAssertion(), getN3LastNameAssertion(), - getN3ForPublisher(), getN3ForLocaleAssertion(), getN3ForVolumeAssertion(), getN3ForNumberAssertion(), @@ -168,10 +182,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private List generateN3Required() { - return list(getAuthorshipN3(), - getN3ForNewPub(), - getN3NewPubNameAssertion(), - getN3NewPubTypeAssertion() + return list(getAuthorshipN3() ); } @@ -182,27 +193,26 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?person core:authorInAuthorship ?authorshipUri ."; } + private String getN3ForNewPub() { + return "@prefix core: <" + vivoCore + "> ." + + "?newPublication a ?pubType ." + + "?newPublication <" + label + "> ?title ." + + "?authorshipUri core:linkedInformationResource ?newPublication ." + + "?newPublication core:informationResourceInAuthorship ?authorshipUri ."; + } + private String getN3ForExistingPub() { return "@prefix core: <" + vivoCore + "> ." + "?authorshipUri core:linkedInformationResource ?pubUri ." + "?pubUri core:informationResourceInAuthorship ?authorshipUri ."; } - private String getN3ForNewPub() { - return "@prefix core: <" + vivoCore + "> ." + - "?pubUri a ?pubType ;" + - "<" + label + "> ?title ." + - "?authorshipUri core:linkedInformationResource ?pubUri ." + - "?pubUri core:informationResourceInAuthorship ?authorshipUri ."; - } - - private String getN3NewPubNameAssertion() { - return "?pubUri <" + label + "> ?title ."; - } - - private String getN3NewPubTypeAssertion() { - return "?pubUri a ?pubType . "; - + private String getN3ForNewCollectionNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:hasPublicationVenue ?newCollection . \n" + + "?newCollection a <" + collectionClass + "> . \n" + + "?newCollection vivo:publicationVenueFor ?newPublication . \n" + + "?newCollection <" + label + "> ?collection ."; } private String getN3ForNewCollection() { @@ -213,6 +223,12 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?newCollection <" + label + "> ?collection ."; } + private String getN3ForCollectionNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:hasPublicationVenue ?collectionUri . \n" + + "?collectionUri vivo:publicationVenueFor ?newPublication . "; + } + private String getN3ForCollection() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:hasPublicationVenue ?collectionUri . \n" + @@ -233,6 +249,20 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?bookUri vivo:publicationVenueFor ?pubUri . "; } + private String getN3ForNewBookNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:hasPublicationVenue ?newBook . \n" + + "?newBook a <" + bookClass + "> . \n" + + "?newBook vivo:publicationVenueFor ?newPublication . \n " + + "?newBook <" + label + "> ?book ."; + } + + private String getN3ForBookNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:hasPublicationVenue ?bookUri . \n" + + "?bookUri vivo:publicationVenueFor ?newPublication . "; + } + private String getN3ForNewConference() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri <" + presentedAtPred + "> ?newConference . \n" + @@ -247,6 +277,20 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?conferenceUri vivo:includesEvent ?pubUri . "; } + private String getN3ForNewConferenceNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication <" + presentedAtPred + "> ?newConference . \n" + + "?newConference a <" + conferenceClass + "> . \n" + + "?newConference vivo:includesEvent ?newPublication . \n" + + "?newConference <" + label + "> ?conference ."; + } + + private String getN3ForConferenceNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication <" + presentedAtPred + "> ?conferenceUri . \n" + + "?conferenceUri vivo:includesEvent ?newPublication . "; + } + private String getN3ForNewEvent() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:proceedingsOf ?newEvent . \n" + @@ -261,6 +305,20 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?eventUri vivo:hasProceedings ?pubUri . "; } + private String getN3ForNewEventNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:proceedingsOf ?newEvent . \n" + + "?newEvent a <" + conferenceClass + "> . \n" + + "?newEvent vivo:hasProceedings ?newPublication . \n" + + "?newEvent <" + label + "> ?event ."; + } + + private String getN3ForEventNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:proceedingsOf ?eventUri . \n" + + "?eventUri vivo:hasProceedings ?newPublication . "; + } + private String getN3ForNewEditor() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:editor ?newEditor . \n" + @@ -275,14 +333,18 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?editorUri vivo:editorOf ?pubUri . "; } - private String getN3FirstNameAssertion() { - return "@prefix foaf: <" + foaf + "> . \n" + - "?newEditor foaf:firstName ?firstName ."; + private String getN3ForNewEditorNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:editor ?newEditor . \n" + + "?newEditor a <" + editorClass + "> . \n" + + "?newEditor vivo:editorOf ?newPublication . \n" + + "?newEditor <" + label + "> ?editor ."; } - private String getN3LastNameAssertion() { - return "@prefix foaf: <" + foaf + "> . \n" + - "?newEditor foaf:lastName ?lastName ."; + private String getN3ForEditorNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:editor ?editorUri . \n" + + "?editorUri vivo:editorOf ?newPublication . "; } private String getN3ForNewPublisher() { @@ -299,39 +361,63 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?publisherUri vivo:publisherOf ?pubUri . "; } + private String getN3ForNewPublisherNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:publisher ?newPublisher . \n" + + "?newPublisher a <" + publisherClass + "> . \n" + + "?newPublisher vivo:publisherOf ?newPublication . \n" + + "?newPublisher <" + label + "> ?publisher ."; + } + + private String getN3ForPublisherNewPub() { + return "@prefix vivo: <" + vivoCore + "> . \n" + + "?newPublication vivo:publisher ?publisherUri . \n" + + "?publisherUri vivo:publisherOf ?newPublication . "; + } + + private String getN3FirstNameAssertion() { + return "@prefix foaf: <" + foaf + "> . \n" + + "?newEditor foaf:firstName ?firstName ."; + } + + private String getN3LastNameAssertion() { + return "@prefix foaf: <" + foaf + "> . \n" + + "?newEditor foaf:lastName ?lastName ."; + } + private String getN3ForLocaleAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + localePred + "> ?locale . "; + "?newPublication <" + localePred + "> ?locale . "; } private String getN3ForVolumeAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + volumePred + "> ?volume . "; + "?newPublication <" + volumePred + "> ?volume . "; } private String getN3ForNumberAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + numberPred + "> ?number . "; + "?newPublication <" + numberPred + "> ?number . "; } private String getN3ForIssueAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + issuePred + "> ?issue . "; + "?newPublication <" + issuePred + "> ?issue . "; } private String getN3ForStartPageAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + startPagePred + "> ?startPage . "; + "?newPublication <" + startPagePred + "> ?startPage . "; } private String getN3ForEndPageAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + endPagePred + ">?endPage . "; + "?newPublication <" + endPagePred + ">?endPage . "; } private String getN3ForDateTimeAssertion() { return "@prefix vivo: <" + vivoCore + "> . \n" + - "?pubUri <" + dateTimePred + "> ?dateTimeNode . \n" + + "?newPublication <" + dateTimePred + "> ?dateTimeNode . \n" + "?dateTimeNode a <" + dateTimeValueType + "> . \n" + "?dateTimeNode <" + dateTimeValue + "> ?dateTime-value . \n" + "?dateTimeNode <" + dateTimePrecision + "> ?dateTime-precision . "; @@ -343,7 +429,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement HashMap newResources = new HashMap(); newResources.put("authorshipUri", DEFAULT_NS_TOKEN); - newResources.put("pubUri", DEFAULT_NS_TOKEN); + newResources.put("newPublication", DEFAULT_NS_TOKEN); newResources.put("newCollection", DEFAULT_NS_TOKEN); newResources.put("newBook", DEFAULT_NS_TOKEN); newResources.put("newConference", DEFAULT_NS_TOKEN); @@ -371,6 +457,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement List urisOnForm = new ArrayList(); //add role activity and roleActivityType to uris on form urisOnForm.add("pubType"); + urisOnForm.add("pubUri"); urisOnForm.add("collectionUri"); urisOnForm.add("bookUri"); urisOnForm.add("conferenceUri"); @@ -472,8 +559,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setPubUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("pubUri")); - //Bdc34: What is this for? I'm sure that this will break autocomplete - //setObjectClassUri(personClass)); } private void setCollectionLabelField(EditConfigurationVTwo editConfiguration) { @@ -495,8 +580,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setCollectionUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("collectionUri")); - //Bdc34: What is this for? I'm sure that commenting this out will break autocomplete - //setObjectClassUri(collectionClass)); } private void setBookLabelField(EditConfigurationVTwo editConfiguration) { @@ -518,8 +601,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setBookUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("bookUri")); - //Bdc34: What is this for? I'm sure that commenting this out will break autocomplete - //setObjectClassUri(bookClass)); } private void setConferenceLabelField(EditConfigurationVTwo editConfiguration) { @@ -541,8 +622,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setConferenceUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("conferenceUri")); - //Bdc34: What is this for? I'm sure that commenting this out will break autocomplete - //setObjectClassUri(conferenceClass)); } private void setEventLabelField(EditConfigurationVTwo editConfiguration) { @@ -580,7 +659,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setEventUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("eventUri")); - //setObjectClassUri(conferenceClass)); } private void setEditorLabelField(EditConfigurationVTwo editConfiguration) { @@ -602,8 +680,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setEditorUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("editorUri")); - //Bdc34: What is this for? I'm sure that commenting this out will break autocomplete - //setObjectClassUri(editorClass)); } private void setPublisherLabelField(EditConfigurationVTwo editConfiguration) { @@ -625,8 +701,6 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private void setPublisherUriField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("publisherUri")); - //Bdc34: What is this for? I'm sure that commenting this out will break autocomplete - //setObjectClassUri(publisherClass)); } private void setLocaleField(EditConfigurationVTwo editConfiguration) { diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index a18f8adc..e5ef393c 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -154,7 +154,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura editConfiguration.setN3Optional( list( getN3ForNewRoleActivity(), getN3ForExistingRoleActivity(), - getN3ForActivityType(), +// getN3ForActivityType(), getN3RoleLabelAssertion(), getN3ForStart(), getN3ForEnd() )); @@ -206,26 +206,24 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura List n3ForNewRoleActivity = new ArrayList(); n3ForNewRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?roleActivity .\n"+ "?roleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + - "?roleActivity <" + RDFS.label.getURI() + "> ?activityLabel ."); + "?roleActivity <" + RDFS.label.getURI() + "> ?activityLabel . \n" + + "?roleActivity a ?roleActivityType ."); return n3ForNewRoleActivity; } private List getN3ForExistingRoleActivity() { List n3ForExistingRoleActivity = new ArrayList(); n3ForExistingRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?existingRoleActivity .\n"+ - "?existingRoleActivity " + getActivityToRolePlaceholder() + " ?role . "); + "?existingRoleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + + "?existingRoleActivity a ?roleActivityType ."); return n3ForExistingRoleActivity; } - private String getN3ForActivityType() { - return "?roleActivity a ?roleActivityType ."; - } private String getN3RoleLabelAssertion() { return "?role <" + RDFS.label.getURI() + "> ?roleLabel ."; } - //Method b/c used in two locations, n3 optional and n3 assertions private List getN3ForStart() { List n3ForStart = new ArrayList(); n3ForStart.add("?role <" + RoleToIntervalURI + "> ?intervalNode ." + diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java index 41a90a5b..e8ea57a2 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java @@ -113,62 +113,51 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator private static final String N3_NEW_POSITION = "" + "@prefix core: . \n" + "@prefix rdfs: . \n" - + "\n" // + "?organization core:organizationForPosition ?position . \n" - + "\n" // - + "?position a core:Position , ?positionType ; \n" - + " rdfs:label ?positionTitle ; \n" - + " core:positionInOrganization ?organization ; "; + + "?position a core:Position . \n" + + "?position a ?positionType . \n" + + "?position rdfs:label ?positionTitle . \n" + + "?position core:positionInOrganization ?organization . "; private static final String N3_NEW_PERSON = "" + "@prefix core: . \n" + "@prefix rdfs: . \n" + "@prefix foaf: . \n" - + "\n" // - + "?position core:positionForPerson ?person . \n" // + + "?position core:positionForPerson ?person . \n" + "?person core:personInPosition ?position . \n" + "?person a foaf:Person . \n" - + "?person rdfs:label ?personLabel"; + + "?person rdfs:label ?personLabel . "; private static final String N3_NEW_FIRST_NAME = "" + "@prefix foaf: . \n" - + "\n" // + "?person foaf:firstName ?firstName ."; private static final String N3_NEW_LAST_NAME = "" + "@prefix foaf: . \n" - + "\n" // + "?person foaf:lastName ?lastName ."; private static final String N3_EXISTING_PERSON = "" + "@prefix core: . \n" - + "\n" // - + "?position core:positionForPerson ?existingPerson . \n" // - + "?existingPerson core:personInPosition ?position . "; + + "?position core:positionForPerson ?existingPerson . \n" + + "?existingPerson core:personInPosition ?position . \n"; private static final String N3_NEW_START_NODE = "" + "@prefix core: . \n" - + "\n" // + "?position core:dateTimeInterval ?intervalNode . \n" - + "\n" // - + "?intervalNode a core:DateTimeInterval ; \n" - + " core:start ?startNode . \n " - + "\n" // - + "?startNode a core:DateTimeValue ; \n" - + " core:dateTime ?startField-value ; \n" - + " core:dateTimePrecision ?startField-precision . "; + + "?intervalNode a core:DateTimeInterval . \n" + + "?intervalNode core:start ?startNode . \n " + + "?startNode a core:DateTimeValue . \n" + + "?startNode core:dateTime ?startField-value. \n" + + "?startNode core:dateTimePrecision ?startField-precision . "; private static final String N3_NEW_END_NODE = "" + "@prefix core: . \n" - + "\n" // + "?position core:dateTimeInterval ?intervalNode . \n" - + "\n" // - + "?intervalNode a core:DateTimeInterval ; \n" - + " core:end ?endNode . \n " - + "\n" // - + "?endNode a core:DateTimeValue ; \n" - + " core:dateTime ?endField-value ; \n" - + " core:dateTimePrecision ?endField-precision . "; + + "?intervalNode a core:DateTimeInterval . \n" + + "?intervalNode core:end ?endNode . \n " + + "?endNode a core:DateTimeValue . \n" + + "?endNode core:dateTime ?endField-value . \n" + + "?endNode core:dateTimePrecision ?endField-precision . "; @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, @@ -197,8 +186,6 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator conf.setUrisOnform(Arrays.asList("existingPerson", "position", "positionType")); conf.addSparqlForExistingUris("positionType", QUERY_EXISTING_POSITION_TYPE); - conf.addSparqlForExistingUris("person", QUERY_EXISTING_PERSON); - conf.addSparqlForExistingUris("intervalNode", QUERY_EXISTING_INTERVAL_NODE); conf.addSparqlForExistingUris("startNode", QUERY_EXISTING_START_NODE); diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java index e5175a49..c009bea1 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java @@ -214,7 +214,8 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements final static String n3ForExistingOrgNewAwardAssertion = "?award <" + awardConferredByPred +"> ?existingOrg . \n" + - "?existingOrg <" + awardConferredPred + "> ?award . "; + "?existingOrg <" + awardConferredPred + "> ?award . \n" + + "?award <"+ label + "> ?awardLabel ."; final static String n3ForExistingOrgExistingAwardAssertion = "?existingAward <" + awardConferredByPred +"> ?existingOrg . \n" + @@ -223,7 +224,8 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements final static String n3ForNewOrgNewAwardAssertion = "?newOrg a <" + orgClass + "> . \n" + "?award <" + awardConferredByPred +"> ?newOrg . \n" + - "?newOrg <" + awardConferredPred + "> ?award . \n" + + "?newOrg <" + awardConferredPred + "> ?award . \n" + + "?award <"+ label + "> ?awardLabel . \n" + "?newOrg <"+ label + "> ?orgLabel ."; final static String n3ForNewOrgExistingAwardAssertion = diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java index aa7ed956..1e58cfb2 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java @@ -90,7 +90,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); conf.setN3Optional(Arrays.asList( - n3ForNewOrg, n3ForExistingOrg, orgTypeAssertion, majorFieldAssertion, degreeAssertion, + n3ForNewOrg, n3ForExistingOrg, majorFieldAssertion, degreeAssertion, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -210,15 +210,14 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements final static String n3ForNewOrg = "?edTraining <"+ trainingAtOrg +"> ?newOrg . \n" + - "?newOrg ?inverseTrainingAtOrg ?edTraining .\n" + - "?newOrg <"+ label +"> ?orgLabel ."; + "?newOrg ?inverseTrainingAtOrg ?edTraining . \n" + + "?newOrg <"+ label +"> ?orgLabel . \n" + + "?newOrg a ?orgType ."; final static String n3ForExistingOrg = "?edTraining <"+ trainingAtOrg +"> ?existingOrg . \n" + - "?existingOrg ?inverseTrainingAtOrg ?edTraining . "; - - final static String orgTypeAssertion = - "?newOrg a ?orgType ."; + "?existingOrg ?inverseTrainingAtOrg ?edTraining . \n" + + "?existingOrg a ?orgType . "; final static String degreeAssertion = "?edTraining <"+ degreeEarned +"> ?degree .\n"+ diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java index d6f60d4e..7cce9269 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java @@ -76,7 +76,7 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme conf.setN3Required( Arrays.asList( n3ForNewPosition, positionTitleAssertion, positionTypeAssertion ) ); - conf.setN3Optional( Arrays.asList( n3ForNewOrg, n3ForExistingOrg, orgTypeAssertion, n3ForStart, n3ForEnd ) ); + conf.setN3Optional( Arrays.asList( n3ForNewOrg, n3ForExistingOrg, n3ForStart, n3ForEnd ) ); conf.addNewResource("position", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newOrg", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -181,15 +181,14 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme final static String n3ForNewOrg = "?position <" + positionInOrgPred + "> ?newOrg . \n" + "?newOrg <" + orgForPositionPred + "> ?position . \n" + - "?newOrg <" + label + "> ?orgLabel ."; + "?newOrg <" + label + "> ?orgLabel . \n" + + "?newOrg a ?orgType ."; final static String n3ForExistingOrg = "?position <" + positionInOrgPred + "> ?existingOrg . \n" + - "?existingOrg <" + orgForPositionPred + "> ?position . " ; - - final static String orgTypeAssertion = - "?newOrg a ?orgType ."; - + "?existingOrg <" + orgForPositionPred + "> ?position . \n" + + "?existingOrg a ?orgType ."; + final static String n3ForStart = "?position <" + positionToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" +