From 87092cec9cc810934bef21ef9db11be0479f44c7 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 3 May 2019 10:51:00 -0600 Subject: [PATCH] [VIVO-1690] - Remove trailing whitespace throughout project (#126) * Remove trailing whitespace throughout project Resolves: https://jira.duraspace.org/browse/VIVO-1690 ** Along with: https://github.com/vivo-project/Vitro/pull/117 --- .../service/impl/AgrovocService.java | 794 ++-- .../service/impl/GemetService.java | 720 +-- .../semservices/service/impl/LCSHService.java | 34 +- .../semservices/service/impl/UMLSService.java | 458 +- .../controller/AboutQrCodesController.java | 6 +- .../controller/ExportQrCodeController.java | 20 +- .../controller/ajax/GeoFocusMapLocations.java | 28 +- .../ajax/GeoFocusResearcherCount.java | 14 +- .../ajax/HomePageAjaxController.java | 2 +- .../webapp/controller/ajax/QrCodeDetails.java | 14 +- .../InstitutionalInternalClassController.java | 516 +-- .../ManageGrantsForIndividualController.java | 24 +- ...ManagePeopleForOrganizationController.java | 16 +- ...gePublicationsForIndividualController.java | 16 +- .../harvester/CsvFileHarvestJob.java | 58 +- .../harvester/FileHarvestController.java | 30 +- .../controller/harvester/FileHarvestJob.java | 18 +- .../controller/harvester/Harvester.java | 24 +- .../AjaxVisualizationController.java | 106 +- .../DataVisualizationController.java | 72 +- .../ShortURLVisualizationController.java | 152 +- .../StandardVisualizationController.java | 92 +- .../VisualizationFrameworkConstants.java | 282 +- .../visualization/VisualizationInjector.java | 36 +- .../VisualizationsDependencyInjector.java | 30 +- .../AutocompleteRequiredInputValidator.java | 16 +- .../n3editing/FirstAndLastNameValidator.java | 24 +- .../n3editing/N3TransitionToV2Mapping.java | 14 +- .../PersonHasPublicationValidator.java | 24 +- .../PublicationHasAuthorValidator.java | 24 +- .../AddAssociatedConceptGenerator.java | 1138 ++--- .../AddAttendeeRoleToPersonGenerator.java | 134 +- ...AuthorsToInformationResourceGenerator.java | 220 +- .../AddClinicalRoleToPersonGenerator.java | 24 +- ...ConceptThroughObjectPropertyGenerator.java | 38 +- .../AddEditWebpageFormGenerator.java | 110 +- .../AddEditorRoleToPersonGenerator.java | 28 +- ...EditorsToInformationResourceGenerator.java | 172 +- .../AddEditorshipToPersonGenerator.java | 108 +- .../AddFullNameToPersonGenerator.java | 72 +- .../AddGrantRoleToPersonGenerator.java | 368 +- .../AddHeadOfRoleToPersonGenerator.java | 108 +- .../AddMemberRoleToPersonGenerator.java | 20 +- .../AddOrcidIdToPersonGenerator.java | 30 +- .../AddOrganizerRoleToPersonGenerator.java | 12 +- ...OutreachProviderRoleToPersonGenerator.java | 12 +- .../AddPresenterRoleToPersonGenerator.java | 172 +- .../AddPublicationToPersonGenerator.java | 142 +- .../AddResearcherRoleToPersonGenerator.java | 20 +- .../AddReviewerRoleToPersonGenerator.java | 26 +- .../AddRoleToPersonTwoStageGenerator.java | 554 +-- ...dServiceProviderRoleToPersonGenerator.java | 16 +- .../AddTeacherRoleToPersonGenerator.java | 110 +- .../AddUserDefinedConceptGenerator.java | 622 +-- ...AutocompleteDataPropertyFormGenerator.java | 134 +- .../GrantAdministeredByGenerator.java | 54 +- .../GrantHasContributorGenerator.java | 76 +- .../ManageLabelsForPersonGenerator.java | 186 +- .../ManageWebpagesForIndividualGenerator.java | 28 +- ...OrganizationAdministersGrantGenerator.java | 54 +- .../OrganizationForTrainingGenerator.java | 146 +- ...ganizationHasPositionHistoryGenerator.java | 10 +- ...PersonHasAdviseeRelationshipGenerator.java | 168 +- ...PersonHasAdvisorRelationshipGenerator.java | 170 +- .../PersonHasAwardOrHonorGenerator.java | 154 +- .../PersonHasEducationalTraining.java | 154 +- .../generators/PersonHasEmailGenerator.java | 58 +- .../PersonHasIssuedCredentialGenerator.java | 130 +- .../PersonHasPositionHistoryGenerator.java | 182 +- .../PersonHasPreferredTitleGenerator.java | 48 +- .../ProjectHasParticipantGenerator.java | 74 +- .../SubjectHasMailingAddressGenerator.java | 84 +- .../SubjectHasPhoneFaxNumberGenerator.java | 70 +- ...aultAddMissingIndividualFormGenerator.java | 48 +- .../generators/VIVOManageLabelsGenerator.java | 18 +- .../VIVONewIndividualFormGenerator.java | 66 +- .../generators/VivoBaseGenerator.java | 14 +- .../AddAssociatedConceptsPreprocessor.java | 1750 ++++---- .../ConceptSemanticTypesPreprocessor.java | 58 +- .../ManageLabelsForPersonPreprocessor.java | 38 +- .../RoleToActivityPredicatePreprocessor.java | 68 +- .../RoleToPredicatePreprocessor.java | 166 +- .../ProcessInternalClassDataGetterN3.java | 450 +- .../documentBuilding/CalculateParameters.java | 88 +- .../extensions/LabelsAcrossContextNodes.java | 16 +- .../webapp/servlet/ConceptSearchServlet.java | 182 +- .../ConceptSearchServiceUtils.java | 202 +- .../VocabSourceDescription.java | 64 +- .../dataGetter/InternalClassesDataGetter.java | 268 +- .../ProcessInternalClasses.java | 162 +- .../VIVOMenuManagementDataUtils.java | 118 +- .../CoAuthorshipGraphMLWriter.java | 664 +-- .../coauthorship/CoAuthorshipQueryRunner.java | 10 +- .../CoAuthorshipRequestHandler.java | 176 +- .../CoAuthorshipVisCodeGenerator.java | 508 +-- .../collaborationutils/CoAuthorshipData.java | 114 +- .../CoInvestigationData.java | 114 +- .../CollaborationComparator.java | 44 +- .../collaborationutils/CollaborationData.java | 146 +- .../CollaboratorComparator.java | 42 +- .../constants/MapOfScienceConstants.java | 2290 +++++----- .../constants/QueryConstants.java | 120 +- .../constants/QueryFieldLabels.java | 70 +- .../visualization/constants/VOConstants.java | 88 +- .../visualization/constants/VisConstants.java | 42 +- .../CoPIGrantCountConstructQueryRunner.java | 10 +- .../CoPIGrantCountQueryRunner.java | 62 +- .../CoPIGrantCountRequestHandler.java | 184 +- .../CoPIGraphMLWriter.java | 48 +- .../CoPIVisCodeGenerator.java | 84 +- .../DocumentFieldNotFoundException.java | 42 +- ...alConstructedModelIdentifierException.java | 42 +- .../MalformedQueryParametersException.java | 42 +- ...pOfScienceVisualizationRequestHandler.java | 1334 +++--- .../ModelConstructorRequestHandler.java | 10 +- .../ModelConstructorUtilities.java | 62 +- .../PersonToGrantsModelConstructor.java | 46 +- .../factory/ModelFactoryInterface.java | 2 +- .../PersonGrantCountQueryRunner.java | 6 +- .../PersonGrantCountRequestHandler.java | 88 +- .../PersonGrantCountVisCodeGenerator.java | 36 +- .../PersonLevelRequestHandler.java | 112 +- .../PersonPublicationCountQueryRunner.java | 6 +- .../PersonPublicationCountRequestHandler.java | 590 +-- ...ersonPublicationCountVisCodeGenerator.java | 466 +- .../OrganizationUtilityFunctions.java | 56 +- ...poralGrantVisualizationRequestHandler.java | 626 +-- ...ublicationVisualizationRequestHandler.java | 632 +-- .../tools/ToolsRequestHandler.java | 8 +- .../utilities/UtilitiesRequestHandler.java | 170 +- .../visualization/valueobjects/Activity.java | 28 +- .../valueobjects/Collaboration.java | 306 +- .../valueobjects/Collaborator.java | 300 +- .../valueobjects/ConstructedModel.java | 4 +- .../valueobjects/ConstructedModelTracker.java | 22 +- .../visualization/valueobjects/Entity.java | 22 +- .../valueobjects/GenericQueryMap.java | 82 +- .../valueobjects/Individual.java | 64 +- .../valueobjects/MapOfScienceActivity.java | 2 +- .../valueobjects/SparklineData.java | 334 +- .../visualization/valueobjects/SubEntity.java | 18 +- .../YearToEntityCountDataElement.java | 6 +- .../valueobjects/json/JsonObject.java | 8 +- .../valueobjects/json/MapOfScience.java | 4 +- .../valueobjects/json/SubjectEntityJSON.java | 4 +- .../visutils/AllPropertiesQueryRunner.java | 20 +- .../visutils/CachedModelConstructor.java | 6 +- .../visutils/GenericQueryRunner.java | 38 +- .../visutils/GenericQueryRunnerOnModel.java | 36 +- .../visutils/ModelConstructor.java | 4 +- .../visualization/visutils/PDFDocument.java | 108 +- .../visualization/visutils/QueryRunner.java | 22 +- .../visutils/UniqueIDGenerator.java | 32 +- .../visutils/UtilityFunctions.java | 156 +- .../visutils/VisualizationRequestHandler.java | 96 +- .../VIVOIndividualTemplateModel.java | 54 +- .../individuallist/VIVOListedIndividual.java | 6 +- .../VIVOIndividualSearchResult.java | 10 +- .../policy/AdvisingRelationshipChecker.java | 2 +- .../vivo/auth/policy/CourseChecker.java | 2 +- .../vivo/auth/policy/GrantChecker.java | 4 +- .../auth/policy/InfoContentEntityChecker.java | 8 +- .../vivo/auth/policy/PresentationChecker.java | 2 +- .../auth/policy/ProjectOrServiceChecker.java | 2 +- .../policy/SelfEditorRelationshipPolicy.java | 286 +- .../mannlib/vivo/orcid/OrcidContextSetup.java | 4 +- .../mannlib/vivo/orcid/OrcidIdDataGetter.java | 6 +- .../OrcidAuthAuthenticateHandler.java | 2 +- .../OrcidAuthExternalIdsHandler.java | 2 +- .../controller/OrcidCallbackHandler.java | 4 +- .../controller/OrcidConfirmationState.java | 4 +- .../orcid/controller/OrcidDefaultHandler.java | 6 +- .../OrcidIntegrationController.java | 6 +- .../plugin/DCCreatorForDocuments.java | 6 +- .../reasoner/plugin/DCTitleForDocuments.java | 6 +- .../org/vivoweb/webapp/util/ModelUtils.java | 34 +- .../LabelsAcrossContextNodesTest.java | 20 +- .../SelfEditorRelationshipPolicyTest.java | 896 ++-- .../SelfEditorRelationshipPolicyTest.n3 | 330 +- api/src/test/resources/log4j.properties | 20 +- .../config/example.applicationSetup.n3 | 38 +- .../config/example.runtime.properties | 96 +- .../rdf/abox/filegraph/academicDegree.rdf | 6 +- .../rdf/abox/filegraph/us-states.rdf | 2 +- .../rdf/abox/filegraph/validation.n3 | 2 +- .../firsttime/classgroups.rdf | 2 +- .../firsttime/initialSiteConfig.rdf | 2 +- .../firsttime/propertygroups.rdf | 2 +- .../display/everytime/homePageDataGetters.n3 | 10 +- .../display/everytime/localeSelectionGUI.n3 | 6 +- .../everytime/n3ModelChangePreprocessors.n3 | 12 +- .../everytime/orcidInterfaceDataGetters.n3 | 6 +- .../searchIndexerConfigurationVivo.n3 | 26 +- .../everytime/vivoConceptDataGetters.n3 | 22 +- .../display/everytime/vivoListViewConfig.rdf | 18 +- .../everytime/vivoOrganizationDataGetters.n3 | 32 +- .../display/everytime/vivoQrCodeDataGetter.n3 | 14 +- .../display/everytime/vivoSearchProhibited.n3 | 10 +- .../rdf/display/firsttime/PropertyConfig.n3 | 50 +- .../display/firsttime/PropertyConfigSupp.n3 | 2 +- .../rdf/display/firsttime/aboutPage.n3 | 2 +- .../resources/rdf/display/firsttime/menu.n3 | 42 +- .../rdf/tbox/filegraph/ontologies.owl | 6 +- .../resources/rdf/tbox/filegraph/vivo.owl | 1804 ++++---- .../rdf/tbox/firsttime/vitroAnnotations.n3 | 80 +- .../firsttime/initialSiteConfig.rdf | 2 +- .../WEB-INF/classes/log4j.properties | 10 +- .../src/main/webapp/local/css/local.css | 2 +- legacy/config/licenser/licenser.properties | 68 +- legacy/example.build.properties | 112 +- .../rdf/display/firsttime/aboutPage_es_GO.n3 | 2 +- .../es_GO/rdf/display/firsttime/menu_es_GO.n3 | 2 +- .../freemarker/aboutMapOfScience_es_GO.ftl | 104 +- .../freemarker/mapOfScienceTooltips_es_GO.ftl | 2 +- .../themes/wilma/i18n/all_es_GO.properties | 44 +- .../image_file_query.sparql | 2 +- .../example.acceptance_tests.properties | 60 +- .../suites/MultiLabels/TestMultipleLabels.n3 | 48 +- .../ProcessRDFData/ontology_v2.0_Lite.rdf | 2 +- .../suites/SearchBoost/BoostClass.n3 | 4 +- .../SearchExclusion/TestSearchExclusion.n3 | 14 +- .../suites/ShortViews/shortview_config.n3 | 22 +- .../suites/ShortViews/view-browse-faculty.ftl | 2 +- .../SparqlQueryApi/EnableSparqlQueryApi.n3 | 4 +- .../SparqlUpdateApi/EnableSparqlUpdateApi.n3 | 4 +- selenium/test-output/testng.css | 18 +- selenium/test-user-model.owl | 18 +- .../webapp/WEB-INF/applicationContext.xml | 2 +- .../ontologies/update15to16/askUpdated.sparql | 4 +- .../ontologies/update15to16/diff.tab.txt | 2 +- ...opolitical-ver1.1-11-18-11-annotations.rdf | 2 +- .../isDefinedBy-1.5-annotations.rdf | 2 +- .../oldAnnotations/vitro-0.7-annotations.rdf | 2 +- .../vivo-core-1.5-annotations.rdf | 2 +- .../geopolitical.tbox.ver1.1-11-18-11.owl | 2 +- .../oldVersion/isDefinedBy-1.5.owl | 2 +- .../update15to16/oldVersion/vivo-bibo-1.5.owl | 2 +- .../oldVersion/vivo-fabio-1.5.owl | 4 +- .../additions/AdviseeRole.sparql | 4 +- .../additions/AdvisorRole.sparql | 4 +- .../additions/Editorship.sparql | 10 +- .../additions/LeaderRole.sparql | 8 +- .../additions/MemberRole.sparql | 8 +- .../sparqlConstructs/additions/concept.sparql | 4 +- .../additions/grant-pre.sparql | 6 +- .../additions/grantAdmin.sparql | 8 +- .../sparqlConstructs/additions/orcid.sparql | 6 +- .../additions/post/Grant.sparql | 6 +- .../additions/post/awardConferred.sparql | 4 +- .../additions/post/awardedDegree.sparql | 8 +- .../post/contributingAdvising.sparql | 4 +- .../additions/vcard1-0.sparql | 14 +- .../additions/vcard1-1.sparql | 12 +- .../additions/vcard1-2.sparql | 16 +- .../additions/vcard1-3.sparql | 16 +- .../sparqlConstructs/additions/vcard22.sparql | 8 +- .../sparqlConstructs/additions/vcard2a.sparql | 8 +- .../sparqlConstructs/additions/vcard2b.sparql | 8 +- .../sparqlConstructs/additions/vcard2c.sparql | 10 +- .../sparqlConstructs/additions/vcard2d.sparql | 10 +- .../sparqlConstructs/additions/vcard2e.sparql | 10 +- .../sparqlConstructs/additions/vcard2f.sparql | 10 +- .../sparqlConstructs/additions/vcard2g.sparql | 10 +- .../sparqlConstructs/additions/vcard2h.sparql | 10 +- .../sparqlConstructs/additions/vcard2i.sparql | 10 +- .../sparqlConstructs/additions/vcard2j.sparql | 10 +- .../sparqlConstructs/additions/vcard3.sparql | 8 +- .../sparqlConstructs/additions/vcard4.sparql | 10 +- .../sparqlConstructs/additions/vcard5.sparql | 8 +- .../sparqlConstructs/additions/vcard6.sparql | 8 +- .../sparqlConstructs/additions/vcard7.sparql | 10 +- .../sparqlConstructs/additions/vcard8.sparql | 16 +- .../sparqlConstructs/additions/vcard9.sparql | 8 +- .../deletions/AdvisingRelationshipDel.sparql | 8 +- .../deletions/AdvisingRelationshipDel2.sparql | 4 +- .../deletions/EditorshipDel.sparql | 6 +- .../deletions/conceptDel.sparql | 4 +- .../deletions/grant-pre-del.sparql | 6 +- .../deletions/orcidDel.sparql | 6 +- .../deletions/post/awardConferredDel.sparql | 4 +- .../deletions/post/awardedDegreeDel.sparql | 4 +- .../deletions/vcardDel.sparql | 60 +- .../ontologies/update15to16/success.n3 | 2 +- .../ontologies/update16to17/askUpdated.sparql | 4 +- .../oldAnnotations/additionalHiding.n3 | 20 +- .../oldAnnotations/initialTBoxAnnotations.n3 | 18 +- .../update16to17/oldVersion/empty.owl | 2 +- .../ontologies/update16to17/success.n3 | 2 +- .../ontologies/update17to18/askUpdated.sparql | 4 +- .../oldAnnotations/additionalHiding.n3 | 20 +- .../oldAnnotations/initialTBoxAnnotations.n3 | 18 +- .../update17to18/oldVersion/empty.owl | 2 +- .../ontologies/update17to18/success.n3 | 2 +- .../WEB-INF/resources/startup_listeners.txt | 184 +- .../rich-export/address/address.sparql | 2 +- .../address/locationOfAddress.sparql | 2 +- .../rich-export/advising/advisee.sparql | 2 +- .../advising/adviseesDegreeAlt.sparql | 2 +- .../advising/adviseesEducationEndDate.sparql | 2 +- .../adviseesEducationalInsitituionAlt.sparql | 2 +- .../advising/associatedDegree.sparql | 2 +- .../associatedEducationalTraining.sparql | 2 +- .../associatedEducationalTrainingAlt.sparql | 2 +- .../WEB-INF/rich-export/award/award.sparql | 4 +- .../award/conferringOrganization.sparql | 4 +- .../award/sponsoringOrganization.sparql | 4 +- .../rich-export/credential/credential.sparql | 6 +- .../credentialGoverningAuthority.sparql | 6 +- .../credential/eligibleForCredential.sparql | 4 +- .../credential/issuedCredential.sparql | 6 +- .../issuedCredentialExpirationDate.sparql | 6 +- .../issuedCredentialIssueDate.sparql | 6 +- .../issuedCredentialSubjectArea.sparql | 6 +- .../educationalTraining.sparql | 6 +- .../educationalTrainingDegree.sparql | 6 +- .../educationalTrainingEndDate.sparql | 6 +- .../educationalTrainingLocation.sparql | 6 +- .../educationalTrainingOrganization.sparql | 6 +- .../educationalTrainingStartDate.sparql | 6 +- .../rich-export/funding/grantAwardedBy.sparql | 10 +- .../WEB-INF/rich-export/funding/grants.sparql | 8 +- .../membership/memberRoleIn.sparql | 2 +- .../outreach/outreachRoleIn.sparql | 2 +- .../rich-export/patent/assignee.sparql | 8 +- .../rich-export/patent/inventors.sparql | 8 +- .../WEB-INF/rich-export/patent/patent.sparql | 4 +- .../rich-export/patent/patentFiledDate.sparql | 2 +- .../patent/patentIssuedDate.sparql | 2 +- .../position/locationForPosition.sparql | 6 +- .../position/organizationForPosition.sparql | 6 +- .../subOrganizationForPosition.sparql | 6 +- .../superOrganizationForPosition.sparql | 6 +- .../presentation/meetingName.sparql | 2 +- .../presentation/presenterRoleIn.sparql | 6 +- .../publication/associatedJournal.sparql | 8 +- .../rich-export/publication/authors.sparql | 6 +- .../publication/presentedAtEvent.sparql | 4 +- .../presentedAtEventEndDate.sparql | 4 +- .../presentedAtEventLocation.sparql | 4 +- .../presentedAtEventStartDate.sparql | 4 +- .../publication/publication.sparql | 4 +- .../publication/publicationDate.sparql | 4 +- .../publicationPartOfInfoResource.sparql | 4 +- .../publicationReproducedIn.sparql | 8 +- .../publication/publicationStatus.sparql | 4 +- .../publication/publicationURL.sparql | 4 +- .../publication/publisher_variant1.sparql | 10 +- .../publication/publisher_variant2.sparql | 10 +- .../rich-export/teaching/teacherRoleIn.sparql | 2 +- .../main/webapp/WEB-INF/springmvc-beans.xml | 2 +- .../visualizations-beans-injection-fm.xml | 282 +- webapp/src/main/webapp/WEB-INF/web.xml | 10 +- .../config/listViewConfig-additionalEmail.xml | 8 +- .../config/listViewConfig-adviseeIn.xml | 2 +- .../listViewConfig-dateTimeInterval.xml | 2 +- .../config/listViewConfig-dateTimeValue.xml | 14 +- .../webapp/config/listViewConfig-default.xml | 6 +- .../config/listViewConfig-degreeEarned.xml | 12 +- .../main/webapp/config/listViewConfig-doi.xml | 8 +- .../listViewConfig-fauxPropertyDefault.xml | 6 +- .../config/listViewConfig-faxNumber.xml | 6 +- .../webapp/config/listViewConfig-fullName.xml | 6 +- .../listViewConfig-grantAdministeredBy.xml | 2 +- .../listViewConfig-hasAssociatedConcept.xml | 68 +- .../config/listViewConfig-hasAttendeeRole.xml | 2 +- ...wConfig-hasCoPrincipalInvestigatorRole.xml | 2 +- .../config/listViewConfig-hasEditorRole.xml | 12 +- .../listViewConfig-hasInvestigatorRole.xml | 2 +- .../listViewConfig-hasPresenterRole.xml | 12 +- ...iewConfig-hasPrincipalInvestigatorRole.xml | 2 +- .../config/listViewConfig-hasReviewerRole.xml | 14 +- .../webapp/config/listViewConfig-hasRole.xml | 22 +- ...Config-informationResourceInEditorship.xml | 10 +- .../listViewConfig-issuedCredential.xml | 4 +- .../config/listViewConfig-mailingAddress.xml | 12 +- .../webapp/config/listViewConfig-orcidId.xml | 6 +- ...iewConfig-organizationAdministersGrant.xml | 2 +- ...listViewConfig-organizationAwardsGrant.xml | 2 +- ...listViewConfig-organizationForTraining.xml | 18 +- .../config/listViewConfig-preferredTitle.xml | 10 +- .../config/listViewConfig-primaryEmail.xml | 8 +- .../config/listViewConfig-rangeUnion.xml | 6 +- .../config/listViewConfig-relatedRole.xml | 18 +- .../config/listViewConfig-researchAreaOf.xml | 20 +- .../listViewConfig-roleContributesTo.xml | 26 +- .../config/listViewConfig-roleRealizedIn.xml | 16 +- .../webapp/config/listViewConfig-scopusId.xml | 14 +- .../config/listViewConfig-telephoneNumber.xml | 8 +- .../webapp/config/listViewConfig-webpage.xml | 18 +- webapp/src/main/webapp/css/home-page-maps.css | 2 +- .../individual/individual-2column-view.css | 90 +- .../css/individual/individual-quick-view.css | 40 +- .../webapp/css/individual/individual-vivo.css | 20 +- .../webapp/css/jquery_plugins/ui.notify.css | 106 +- .../css/visualization/capabilitymap/graph.css | 4 +- .../css/visualization/coauthorship/style.css | 502 +-- .../visualization/entitycomparison/layout.css | 22 +- .../css/visualization/mapofscience/layout.css | 46 +- .../css/visualization/personlevel/page.css | 46 +- .../css/visualization/visualization.css | 6 +- .../src/main/webapp/i18n/vivo_all.properties | 1624 +++---- .../placeholders/placeholders.properties | 2 +- webapp/src/main/webapp/js/d3.min.js | 2 +- webapp/src/main/webapp/js/homePageMaps.js | 112 +- webapp/src/main/webapp/js/homePageUtils.js | 52 +- .../individual/individualProfilePageType.js | 28 +- .../js/individual/individualQtipBubble.js | 6 +- .../webapp/js/individual/individualUtils.js | 32 +- .../datatable/1.10.12/dataTables.bootstrap.js | 4 +- .../1.10.12/dataTables.bootstrap4.js | 4 +- .../datatable/1.10.12/dataTables.material.js | 4 +- .../1.10.12/dataTables.semanticui.js | 4 +- .../datatable/1.10.12/dataTables.uikit.js | 4 +- .../datatable/1.10.12/jquery.dataTables.js | 3920 ++++++++--------- .../webapp/js/jquery_plugins/jquery.notify.js | 34 +- .../js/jquery_plugins/jquery.truncator.js | 8 +- webapp/src/main/webapp/js/latLongJson.js | 2 +- .../webapp/js/leaflet/dist/leaflet-src.js | 2 +- .../main/webapp/js/leaflet/dist/leaflet.css | 914 ++-- .../webapp/js/leaflet/dist/leaflet.ie.css | 114 +- .../js/menupage/processDataGetterUtils.js | 80 +- .../processInternalClassDataGetterContent.js | 164 +- .../visualization/capabilitymap/d3v3.min.js | 2 +- .../visualization/capabilitymap/graph_new.js | 90 +- .../visualization/capabilitymap/jsr_class.js | 26 +- .../coPIship/coPIship-person-level.js | 50 +- .../visualization/coauthorship/AC_OETags.js | 30 +- .../coauthorship/coauthorship-personlevel.js | 46 +- .../js/visualization/dataTables.helper.js | 24 +- .../entitycomparison/constants.js | 26 +- .../entitycomparison/gui-event-manager.js | 428 +- .../jquery_plugins/datatable/demo_table.css | 10 +- .../jquery_plugins/flot/excanvas.js | 12 +- .../flot/jquery.colorhelpers.js | 26 +- .../flot/jquery.flot.crosshair.js | 20 +- .../jquery_plugins/flot/jquery.flot.image.js | 30 +- .../jquery_plugins/flot/jquery.flot.js | 4 +- .../flot/jquery.flot.navigate.js | 48 +- .../flot/jquery.flot.selection.js | 6 +- .../jquery_plugins/flot/jquery.flot.stack.js | 28 +- .../flot/jquery.flot.threshold.js | 14 +- .../jquery_plugins/flot/r293/excanvas.js | 12 +- .../jquery_plugins/flot/r293/jquery.flot.js | 314 +- .../jquery_plugins/jgrowl/jquery.jgrowl.css | 4 +- .../jquery_plugins/jgrowl/jquery.jgrowl.js | 42 +- .../jquery_plugins/jquery-jangle.js | 2 +- .../jquery_plugins/jquery.AutoEllipsis.js | 194 +- .../js/visualization/entitycomparison/util.js | 492 +-- .../mapofscience/ClassExtendUtils.js | 128 +- .../mapofscience/ColorStrategy.js | 102 +- .../mapofscience/ComparisonDataTableWidget.js | 534 +-- .../mapofscience/ComparisonScimapWidget.js | 534 +-- .../mapofscience/ControlPanel.js | 336 +- .../mapofscience/CustomMarker.js | 130 +- .../mapofscience/CustomScimaps.js | 162 +- .../mapofscience/DataTableWidget.js | 118 +- .../mapofscience/DownloadManager.js | 98 +- .../mapofscience/EntityTablesWidget.js | 98 +- .../mapofscience/ErrorDisplayWidget.js | 82 +- .../js/visualization/mapofscience/GMapAPI.js | 4 +- .../mapofscience/InitializeMap.js | 38 +- .../js/visualization/mapofscience/Marker.js | 120 +- .../mapofscience/MarkerManager.js | 22 +- .../visualization/mapofscience/NumberUtils.js | 30 +- .../js/visualization/mapofscience/Polygon.js | 10 +- .../mapofscience/ScimapWidget.js | 60 +- .../mapofscience/SimpleDataTableWidget.js | 332 +- .../visualization/mapofscience/SizeCoding.js | 158 +- .../js/visualization/mapofscience/Tooltip.js | 200 +- .../mapofscience/VisCommonControl.js | 16 +- .../mapofscience/VisModeControllers.js | 16 +- .../visualization/personlevel/person-level.js | 92 +- .../main/webapp/js/visualization/sparkline.js | 10 +- .../visualization-helper-functions.js | 22 +- .../freemarker/body/harvester/fileharvest.ftl | 102 +- .../individual--foaf-organization.ftl | 4 +- .../individual--foaf-person-2column.ftl | 36 +- .../individual--foaf-person-quickview.ftl | 34 +- .../individual/individual--foaf-person.ftl | 30 +- .../body/individual/individual-openSocial.ftl | 4 +- .../freemarker/body/individual/individual.ftl | 8 +- .../manageLabelsForIndividualAddForm.ftl | 22 +- .../freemarker/body/menupage/publications.ftl | 8 +- .../freemarker/body/orcid/orcidConfirm.ftl | 22 +- .../individual-affiliated-departments.ftl | 4 +- .../individual-affiliated-dept-details.ftl | 2 +- ...individual-affiliated-res-area-details.ftl | 2 +- .../individual-affiliated-research-areas.ftl | 6 +- .../individual-contactInfo-2column.ftl | 18 +- .../individual/individual-contactInfo.ftl | 12 +- .../individual-dept-active-grants.ftl | 2 +- .../individual-dept-res-area-details.ftl | 2 +- .../individual/individual-geographicFocus.ftl | 8 +- .../individual/individual-iconControls.ftl | 8 +- .../individual/individual-orcidInterface.ftl | 12 +- .../individual/individual-overview.ftl | 2 +- .../individual/individual-positions.ftl | 4 +- .../individual/individual-qrCodeGenerator.ftl | 10 +- .../individual/individual-researchAreas.ftl | 10 +- .../individual-visualizationFoafPerson.ftl | 38 +- .../individual-visualizationQuickView.ftl | 18 +- .../individual-vocabularyService.ftl | 10 +- .../individual/individual-webpage.ftl | 4 +- .../individual/propStatement-adviseeIn.ftl | 8 +- .../individual/propStatement-advisorIn.ftl | 6 +- .../propStatement-authorInAuthorship.ftl | 6 +- .../individual/propStatement-awardOrHonor.ftl | 8 +- .../propStatement-awardOrHonorGiven.ftl | 10 +- .../propStatement-dateTimeInterval.ftl | 6 +- .../propStatement-dateTimeValue.ftl | 6 +- .../individual/propStatement-default.ftl | 8 +- .../individual/propStatement-degreeEarned.ftl | 8 +- .../partials/individual/propStatement-doi.ftl | 6 +- .../individual/propStatement-editorship.ftl | 8 +- .../propStatement-educationalTraining.ftl | 10 +- .../individual/propStatement-emailAddress.ftl | 10 +- .../individual/propStatement-fullName.ftl | 10 +- .../propStatement-grantAdministeredBy.ftl | 8 +- .../propStatement-hasAssociatedConcept.ftl | 36 +- .../propStatement-hasAttendeeRole.ftl | 10 +- .../propStatement-hasEditReviewRole.ftl | 4 +- .../propStatement-hasInvestigatorRole.ftl | 14 +- .../propStatement-hasPresenterRole.ftl | 10 +- .../individual/propStatement-hasRole.ftl | 12 +- ...tement-informationResourceInAuthorship.ftl | 4 +- ...tement-informationResourceInEditorship.ftl | 4 +- .../propStatement-issuedCredential.ftl | 10 +- .../propStatement-mailingAddress.ftl | 22 +- .../individual/propStatement-orcidId.ftl | 6 +- ...Statement-organizationAdministersGrant.ftl | 8 +- .../propStatement-organizationAwardsGrant.ftl | 8 +- .../propStatement-organizationForPosition.ftl | 6 +- .../propStatement-organizationForTraining.ftl | 6 +- .../propStatement-personInPosition.ftl | 8 +- .../propStatement-phoneFaxNumber.ftl | 10 +- .../propStatement-preferredTitle.ftl | 8 +- .../propStatement-publicationVenueFor.ftl | 8 +- .../individual/propStatement-publisherOf.ftl | 8 +- .../individual/propStatement-relatedRole.ftl | 10 +- .../propStatement-researchAreaOf.ftl | 4 +- .../individual/propStatement-scopusId.ftl | 6 +- .../propStatement-webpage-quickview.ftl | 24 +- .../individual/propStatement-webpage.ftl | 8 +- .../body/search/search-csvResults.ftl | 2 +- .../body/search/search-xmlResults.ftl | 10 +- .../edit/forms/addAssociatedConcept.ftl | 46 +- .../edit/forms/addAttendeeRoleToPerson.ftl | 64 +- .../forms/addAuthorsToInformationResource.ftl | 26 +- .../edit/forms/addClinicalRoleToPerson.ftl | 2 +- ...nceptThroughObjectPropertyAutoComplete.ftl | 32 +- ...dConceptThroughObjectPropertyCreateNew.ftl | 26 +- .../addConceptThroughObjectPropertyForm.ftl | 8 +- .../edit/forms/addEditWebpageForm.ftl | 22 +- .../edit/forms/addEditorRoleToPerson.ftl | 66 +- .../forms/addEditorsToInformationResource.ftl | 22 +- .../edit/forms/addEditorshipToPerson.ftl | 36 +- .../edit/forms/addFullNameToPerson.ftl | 18 +- .../edit/forms/addGrantRoleToPerson.ftl | 18 +- .../edit/forms/addHeadOfRoleToPerson.ftl | 62 +- .../edit/forms/addMemberRoleToPerson.ftl | 2 +- .../edit/forms/addOrcidIdToPerson.ftl | 16 +- .../edit/forms/addPresenterRoleToPerson.ftl | 406 +- .../edit/forms/addPublicationToPerson.ftl | 46 +- .../edit/forms/addResearcherRoleToPerson.ftl | 68 +- .../edit/forms/addRoleToPersonTwoStage.ftl | 32 +- .../edit/forms/addTeacherRoleToPerson.ftl | 70 +- .../edit/forms/addUserDefinedConcept.ftl | 156 +- .../edit/forms/autoCompleteDataPropForm.ftl | 174 +- .../freemarker/edit/forms/css/addConcept.css | 10 +- .../edit/forms/css/autocomplete.css | 2 +- .../edit/forms/css/manageDragDropList.css | 6 +- .../edit/forms/dateTimeValueForm.ftl | 18 +- .../forms/defaultAddMissingIndividualForm.ftl | 12 +- .../edit/forms/grantAdministeredBy.ftl | 18 +- .../edit/forms/grantHasContributor.ftl | 32 +- .../forms/institutionalInternalClassForm.ftl | 28 +- .../js/addAuthorsToInformationResource.js | 326 +- .../freemarker/edit/forms/js/addConcept.js | 98 +- .../js/addEditorsToInformationResource.js | 292 +- .../edit/forms/js/addOrcidIdToPersonUtils.js | 20 +- .../edit/forms/js/adviseeRelationshipUtils.js | 42 +- .../edit/forms/js/advisorRelationshipUtils.js | 42 +- .../edit/forms/js/awardReceiptUtils.js | 26 +- .../js/customFormWithDataAutocomplete.js | 884 ++-- .../defaultAddMissingIndividualFormUtils.js | 16 +- .../edit/forms/js/educationalTrainingUtils.js | 14 +- .../edit/forms/js/grantHasContributorUtils.js | 30 +- .../edit/forms/js/issuedCredentialUtils.js | 18 +- .../edit/forms/js/mailingAddressUtils.js | 24 +- .../edit/forms/js/manageHideShowStatus.js | 38 +- .../forms/js/manageWebpagesForIndividual.js | 128 +- .../edit/forms/js/newIndividualFormUtils.js | 16 +- .../edit/forms/js/orgHasPositionUtils.js | 30 +- .../forms/js/organizationForTrainingUtils.js | 38 +- .../forms/js/projectHasParticipantUtils.js | 30 +- .../edit/forms/js/publicationToPersonUtils.js | 106 +- .../edit/forms/manageGrantsForIndividual.ftl | 14 +- .../forms/managePeopleForOrganization.ftl | 14 +- .../forms/managePublicationsForIndividual.ftl | 14 +- .../forms/manageWebpagesForIndividual.ftl | 26 +- .../menuManagement--classIntersections.ftl | 30 +- .../edit/forms/newIndividualForm.ftl | 14 +- .../forms/organizationAdministersGrant.ftl | 18 +- .../edit/forms/organizationForTraining.ftl | 64 +- .../forms/organizationHasPositionHistory.ftl | 40 +- ...geManagement--browseClassGroupsScripts.ftl | 10 +- .../pageManagement--classIntersections.ftl | 32 +- .../pageManagement--customDataScript.ftl | 40 +- .../forms/personHasAdviseeRelationship.ftl | 52 +- .../forms/personHasAdvisorRelationship.ftl | 50 +- .../edit/forms/personHasAwardOrHonor.ftl | 30 +- .../forms/personHasEducationalTraining.ftl | 86 +- .../edit/forms/personHasEmailAddress.ftl | 16 +- .../edit/forms/personHasIssuedCredential.ftl | 54 +- .../edit/forms/personHasPositionHistory.ftl | 46 +- .../edit/forms/personHasPreferredTitle.ftl | 16 +- .../edit/forms/projectHasParticipant.ftl | 28 +- .../edit/forms/subjectHasMailingAddress.ftl | 24 +- .../edit/forms/subjectHasPhoneFaxNumber.ftl | 16 +- .../freemarker/lib/lib-home-page.ftl | 20 +- .../freemarker/lib/lib-microformats.ftl | 2 +- .../freemarker/lib/lib-vivo-form.ftl | 4 +- .../freemarker/lib/lib-vivo-properties.ftl | 6 +- .../coAuthorshipDynamicActivator.ftl | 10 +- .../coAuthorshipSparklineContent.ftl | 154 +- .../copi/coInvestigationDynamicActivator.ftl | 2 +- .../copi/coInvestigationSparklineContent.ftl | 170 +- .../entitycomparison/entityComparisonBody.ftl | 64 +- .../entityComparisonErrorCommonBody.ftl | 6 +- .../entityComparisonOnGrantsStandalone.ftl | 10 +- ...tityComparisonOnPublicationsStandalone.ftl | 10 +- .../entityComparisonSetup.ftl | 30 +- .../personGrantCountDynamicActivator.ftl | 2 +- .../grant/personGrantSparklineContent.ftl | 176 +- .../mapOfScience/aboutMapOfScience.ftl | 54 +- .../mapOfScience/mapOfScienceSetup.ftl | 12 +- .../mapOfScience/mapOfScienceStandalone.ftl | 20 +- .../mapOfScience/mapOfScienceTooltips.ftl | 32 +- .../regenerateConstructedModels.ftl | 16 +- .../personlevel/coAuthorPersonLevelD3.ftl | 58 +- .../personlevel/coPIPersonLevelD3.ftl | 56 +- ...personPublicationCountDynamicActivator.ftl | 38 +- .../personPublicationCountNoSparkline.ftl | 46 +- .../personPublicationSparklineContent.ftl | 138 +- .../freemarker/visualization/tools.ftl | 2 +- .../visualization/visualizationError.ftl | 16 +- .../bootstrap/css/bootstrap-theme.min.css | 2 +- .../bootstrap/css/bootstrap.min.css | 2 +- .../tenderfoot/bootstrap/js/bootstrap.min.js | 2 +- .../themes/tenderfoot/bootstrap/js/npm.js | 2 +- .../tenderfoot/css/navbar-breakpoint.css | 2 +- .../themes/tenderfoot/css/page-browse.css | 2 +- .../themes/tenderfoot/css/page-individual.css | 2 +- .../webapp/themes/tenderfoot/css/reset.css | 226 +- .../webapp/themes/tenderfoot/css/screen.css | 68 +- .../themes/tenderfoot/css/tenderfoot.css | 728 +-- .../themes/tenderfoot/i18n/all.properties | 2 +- .../individual/individual--foaf-person.ftl | 378 +- .../templates/body/individual/scratch.ftl | 66 +- .../individual/individual-positions.ftl | 4 +- .../individual-visualizationFoafPerson.ftl | 8 +- .../tenderfoot/templates/page/page-home.ftl | 298 +- .../themes/tenderfoot/templates/page/page.ftl | 76 +- .../templates/page/partials/footer.ftl | 82 +- .../templates/page/partials/head.ftl | 68 +- .../templates/page/partials/headScripts.ftl | 72 +- .../templates/page/partials/identity.ftl | 110 +- .../templates/page/partials/menu.ftl | 68 +- .../templates/page/partials/search.ftl | 34 +- .../themes/wilma/css/openSocial/gadgets.css | 234 +- .../main/webapp/themes/wilma/css/reset.css | 28 +- .../main/webapp/themes/wilma/css/screen.css | 14 +- .../main/webapp/themes/wilma/css/wilma.css | 122 +- .../webapp/themes/wilma/i18n/all.properties | 2 +- .../webapp/themes/wilma/templates/footer.ftl | 6 +- .../themes/wilma/templates/gadgetDetails.ftl | 4 +- .../themes/wilma/templates/gadgetLogin.ftl | 6 +- .../wilma/templates/googleAnalytics.ftl | 26 +- .../webapp/themes/wilma/templates/head.ftl | 8 +- .../themes/wilma/templates/identity.ftl | 12 +- .../templates/individual--foaf-person.ftl | 54 +- .../webapp/themes/wilma/templates/menu.ftl | 4 +- .../themes/wilma/templates/page-home.ftl | 36 +- .../webapp/themes/wilma/templates/page.ftl | 10 +- .../webapp/themes/wilma/templates/search.ftl | 4 +- 685 files changed, 26805 insertions(+), 26805 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java index e6ebe67a..0a61876d 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java @@ -1,397 +1,397 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.semservices.service.impl; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringWriter; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import edu.cornell.mannlib.semservices.bo.Concept; -import edu.cornell.mannlib.semservices.service.ExternalConceptService; -import edu.cornell.mannlib.semservices.util.SKOSUtils; -import edu.cornell.mannlib.semservices.util.XMLUtils; -import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; -import edu.cornell.mannlib.vitro.webapp.web.URLEncoder; - -public class AgrovocService implements ExternalConceptService { - - protected final Log logger = LogFactory.getLog(getClass()); - private final String schemeUri = "http://aims.fao.org/aos/agrovoc/agrovocScheme"; - private final String ontologyName = "agrovoc"; - private final String format = "SKOS"; - private final String lang = "en"; - private final String searchMode = "starts with";//Used to be Exact Match, or exact word or starts with - protected final String dbpedia_endpoint = " http://dbpedia.org/sparql"; - // URL to get all the information for a concept - - protected final String conceptSkosMosBase = "http://agrovoc.uniroma2.it/agrovoc/rest/v1/"; - protected final String conceptsSkosMosSearch = conceptSkosMosBase + "search?"; - protected final String conceptSkosMosURL = conceptSkosMosBase + "data?"; - @Override - public List getConcepts(String term) throws Exception { - List conceptList = new ArrayList<>(); - - //For the RDF webservices mechanism, utilize the following - /* - String result = getTermExpansion(this.ontologyName, term, - this.searchMode, this.format, this.lang); - - // return empty conceptList if conceptUri is empty - if (StringUtils.isEmpty(result)) { - return conceptList; - } - - // Get the list of the concept URIs in the RDF - List conceptUris = getConceptURIsListFromRDF(result); - */ - - //For the SKOSMos search mechanism, utilize this instead - String result = getSKOSMosSearchResults(term, this.lang); - List conceptUris = getConceptURIsListFromSkosMosResult(result); - if (conceptUris.size() == 0) - return conceptList; - int conceptCounter = 0; - - HashSet encounteredURI = new HashSet<>(); - - // Loop through each of these URIs and load using the SKOSManager - for (String conceptUri : conceptUris) { - conceptCounter++; - if (StringUtils.isEmpty(conceptUri)) { - // If the conceptURI is empty, keep going - continue; - } - if(encounteredURI.contains(conceptUri)) { - //If we have already encountered this concept URI, do not redisplay or reprocess - continue; - } - encounteredURI.add(conceptUri); - - // Test and see if the URI is valid - URI uri = null; - try { - uri = new URI(conceptUri); - } catch (URISyntaxException e) { - logger.error("Error occurred with creating the URI ", e); - continue; - } - // Returns concept information in the format specified, which is - // currently XML - // Utilizing Agrovoc's getConceptInfo returns alternate and - // preferred labels but - // none of the exact match or close match descriptions - String bestMatch = "false"; - //Assume the first result is considered the 'best match' - //Although that is not something we are actually retrieving from the service itself explicitly - if(conceptCounter == 1) { - bestMatch = "true"; - } - Concept c = this.createConcept(bestMatch, conceptUri); - if (c != null) { - // Get definition from dbpedia references stored in the close - // Match list - List closeMatches = c.getCloseMatchURIList(); - for (String closeMatch : closeMatches) { - - if (closeMatch.startsWith("http://dbpedia.org")) { - try { - String description = getDbpediaDescription(closeMatch); - c.setDefinition(description); - } catch (Exception ex) { - logger.error("An error occurred in the process of retrieving dbpedia description", ex); - } - } - } - conceptList.add(c); - } - } - - return conceptList; - } - - - - - - - public List processResults(String term) throws Exception { - return getConcepts(term); - } - - public Concept createConcept(String bestMatch, String skosConceptURI) { - - Concept concept = new Concept(); - concept.setUri(skosConceptURI); - concept.setConceptId(stripConceptId(skosConceptURI)); - concept.setBestMatch(bestMatch); - concept.setDefinedBy(schemeUri); - concept.setSchemeURI(this.schemeUri); - concept.setType(""); - - String encodedURI = URLEncoder.encode(skosConceptURI); - String encodedFormat = URLEncoder.encode("application/rdf+xml"); - String url = conceptSkosMosURL + "uri=" + encodedURI + "&format=" - + encodedFormat; - - // Utilize the XML directly instead of the SKOS API - try { - - concept = SKOSUtils - .createConceptUsingXMLFromURL(concept, url, "en", false); - - } catch (Exception ex) { - logger.debug("Error occurred for creating concept " - + skosConceptURI, ex); - return null; - } - - return concept; - } - - public List getConceptsByURIWithSparql(String uri) - throws Exception { - // deprecating this method...just return an empty list - List conceptList = new ArrayList<>(); - return conceptList; - } - - protected String getAgrovocTermCode(String rdf) throws Exception { - String termcode = ""; - try { - Document doc = XMLUtils.parse(rdf); - NodeList nodes = doc.getElementsByTagName("hasCodeAgrovoc"); - if (nodes.item(0) != null) { - Node node = nodes.item(0); - termcode = node.getTextContent(); - } - - } catch (SAXException | IOException | ParserConfigurationException e) { - // e.printStackTrace(); - throw e; - } - return termcode; - } - - protected String getConceptURIFromRDF(String rdf) { - String conceptUri = ""; - try { - Document doc = XMLUtils.parse(rdf); - NodeList nodes = doc.getElementsByTagName("skos:Concept"); - Node node = nodes.item(0); - - NamedNodeMap attrs = node.getAttributes(); - Attr idAttr = (Attr) attrs.getNamedItem("rdf:about"); - conceptUri = idAttr.getTextContent(); - } catch (IOException | ParserConfigurationException | SAXException e) { - e.printStackTrace(); - System.err.println("rdf: " + rdf); - } - return conceptUri; - - } - - // When utilizing the getTermExpansion method, will get a list of URIs back - // and not just one URI - protected List getConceptURIsListFromRDF(String rdf) { - List conceptUris = new ArrayList<>(); - try { - Document doc = XMLUtils.parse(rdf); - NodeList nodes = doc.getElementsByTagName("skos:Concept"); - int numberNodes = nodes.getLength(); - int n; - for (n = 0; n < numberNodes; n++) { - Node node = nodes.item(n); - NamedNodeMap attrs = node.getAttributes(); - Attr idAttr = (Attr) attrs.getNamedItem("rdf:about"); - String conceptUri = idAttr.getTextContent(); - conceptUris.add(conceptUri); - } - - - } catch (IOException | ParserConfigurationException | SAXException e) { - e.printStackTrace(); - System.err.println("rdf: " + rdf); - } - return conceptUris; - - } - - protected String getDbpediaDescription(String uri) throws Exception { - String descriptionSource = " (Source: DBpedia)"; - String description = ""; - String qs = "" - + "PREFIX rdfs: \n" - + "PREFIX rdf: \n" - + "PREFIX foaf: \n" - + "PREFIX dbpedia-owl: \n" - + "SELECT DISTINCT ?description WHERE { \n" + "<" + uri - + "> rdfs:comment ?description . \n" - + "FILTER (LANG(?description)='en' ) \n" + "}"; - // System.out.println(qs); - List resultList = new ArrayList<>(); - QueryExecution qexec = null; - try { - - Query query = QueryFactory.create(qs); - qexec = QueryExecutionFactory.sparqlService(this.dbpedia_endpoint, query); - qexec.setTimeout(5000, TimeUnit.MILLISECONDS); - resultList = new ArrayList<>(); - ResultSet resultSet = qexec.execSelect(); - int resultSetSize = 0; - while (resultSet.hasNext()) { - resultSetSize++; - QuerySolution solution = resultSet.nextSolution(); - Iterator varnames = solution.varNames(); - HashMap hm = new HashMap<>(); - while (varnames.hasNext()) { - String name = (String) varnames.next(); - RDFNode rdfnode = solution.get(name); - // logger.info("rdf node name, type: "+ name - // +", "+getRDFNodeType(rdfnode)); - if (rdfnode.isLiteral()) { - Literal literal = rdfnode.asLiteral(); - String nodeval = literal.getString(); - hm.put(name, nodeval); - } else if (rdfnode.isResource()) { - Resource resource = rdfnode.asResource(); - String nodeval = resource.toString(); - hm.put(name, nodeval); - } - } - resultList.add(hm); - } - description = ""; - for (HashMap map : resultList) { - if (map.containsKey("description")) { - description = (String) map.get("description"); - } - } - } catch (Exception ex) { - throw ex; - } - // Adding source so it is clear that this description comes from DBPedia - return description + descriptionSource; - } - - /** - * @param uri The URI - */ - protected String stripConceptId(String uri) { - String conceptId = ""; - int lastslash = uri.lastIndexOf('/'); - conceptId = uri.substring(lastslash + 1, uri.length()); - return conceptId; - } - - /** - * @param str The String - */ - protected String extractConceptId(String str) { - try { - return str.substring(1, str.length() - 1); - } catch (Exception ex) { - return ""; - } - } - - /** - * The code here utilizes the SKOSMOS REST API for Agrovoc - * This returns JSON LD so we would parse JSON instead of RDF - * The code above can still be utilized if we need to employ the web services directly - */ - //Get search results for a particular term and language code - private String getSKOSMosSearchResults(String term, String lang) { - String urlEncodedTerm = URLEncoder.encode(term); - //Utilize 'starts with' using the * operator at the end - String searchUrlString = this.conceptsSkosMosSearch + "query=" + urlEncodedTerm + "*" + "&lang=" + lang; - URL searchURL = null; - try { - searchURL = new URL(searchUrlString); - } catch (Exception e) { - logger.error("Exception occurred in instantiating URL for " - + searchUrlString, e); - // If the url is having trouble, just return null for the concept - return null; - } - - String results = null; - try { - - StringWriter sw = new StringWriter(); - - BufferedReader in = new BufferedReader(new InputStreamReader( - searchURL.openStream())); - String inputLine; - while ((inputLine = in.readLine()) != null) { - sw.write(inputLine); - } - in.close(); - - results = sw.toString(); - logger.debug(results); - } catch (Exception ex) { - logger.error("Error occurred in getting concept from the URL " - + searchUrlString, ex); - return null; - } - return results; - - } - - //JSON-LD array - private List getConceptURIsListFromSkosMosResult(String results) { - List conceptURIs = new ArrayList<>(); - ObjectNode json = (ObjectNode) JacksonUtils.parseJson(results); - //Format should be: { ..."results":["uri":uri...] - if (json.has("results")) { - ArrayNode jsonArray = (ArrayNode) json.get("results"); - int numberResults = jsonArray.size(); - int i; - for(i = 0; i < numberResults; i++) { - ObjectNode jsonObject = (ObjectNode) jsonArray.get(i); - if(jsonObject.has("uri")) { - conceptURIs.add(jsonObject.get("uri").asText()); - } - } - } - return conceptURIs; - } - - - - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.semservices.service.impl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.StringWriter; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.jena.query.Query; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QueryFactory; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import edu.cornell.mannlib.semservices.bo.Concept; +import edu.cornell.mannlib.semservices.service.ExternalConceptService; +import edu.cornell.mannlib.semservices.util.SKOSUtils; +import edu.cornell.mannlib.semservices.util.XMLUtils; +import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; +import edu.cornell.mannlib.vitro.webapp.web.URLEncoder; + +public class AgrovocService implements ExternalConceptService { + + protected final Log logger = LogFactory.getLog(getClass()); + private final String schemeUri = "http://aims.fao.org/aos/agrovoc/agrovocScheme"; + private final String ontologyName = "agrovoc"; + private final String format = "SKOS"; + private final String lang = "en"; + private final String searchMode = "starts with";//Used to be Exact Match, or exact word or starts with + protected final String dbpedia_endpoint = " http://dbpedia.org/sparql"; + // URL to get all the information for a concept + + protected final String conceptSkosMosBase = "http://agrovoc.uniroma2.it/agrovoc/rest/v1/"; + protected final String conceptsSkosMosSearch = conceptSkosMosBase + "search?"; + protected final String conceptSkosMosURL = conceptSkosMosBase + "data?"; + @Override + public List getConcepts(String term) throws Exception { + List conceptList = new ArrayList<>(); + + //For the RDF webservices mechanism, utilize the following + /* + String result = getTermExpansion(this.ontologyName, term, + this.searchMode, this.format, this.lang); + + // return empty conceptList if conceptUri is empty + if (StringUtils.isEmpty(result)) { + return conceptList; + } + + // Get the list of the concept URIs in the RDF + List conceptUris = getConceptURIsListFromRDF(result); + */ + + //For the SKOSMos search mechanism, utilize this instead + String result = getSKOSMosSearchResults(term, this.lang); + List conceptUris = getConceptURIsListFromSkosMosResult(result); + if (conceptUris.size() == 0) + return conceptList; + int conceptCounter = 0; + + HashSet encounteredURI = new HashSet<>(); + + // Loop through each of these URIs and load using the SKOSManager + for (String conceptUri : conceptUris) { + conceptCounter++; + if (StringUtils.isEmpty(conceptUri)) { + // If the conceptURI is empty, keep going + continue; + } + if(encounteredURI.contains(conceptUri)) { + //If we have already encountered this concept URI, do not redisplay or reprocess + continue; + } + encounteredURI.add(conceptUri); + + // Test and see if the URI is valid + URI uri = null; + try { + uri = new URI(conceptUri); + } catch (URISyntaxException e) { + logger.error("Error occurred with creating the URI ", e); + continue; + } + // Returns concept information in the format specified, which is + // currently XML + // Utilizing Agrovoc's getConceptInfo returns alternate and + // preferred labels but + // none of the exact match or close match descriptions + String bestMatch = "false"; + //Assume the first result is considered the 'best match' + //Although that is not something we are actually retrieving from the service itself explicitly + if(conceptCounter == 1) { + bestMatch = "true"; + } + Concept c = this.createConcept(bestMatch, conceptUri); + if (c != null) { + // Get definition from dbpedia references stored in the close + // Match list + List closeMatches = c.getCloseMatchURIList(); + for (String closeMatch : closeMatches) { + + if (closeMatch.startsWith("http://dbpedia.org")) { + try { + String description = getDbpediaDescription(closeMatch); + c.setDefinition(description); + } catch (Exception ex) { + logger.error("An error occurred in the process of retrieving dbpedia description", ex); + } + } + } + conceptList.add(c); + } + } + + return conceptList; + } + + + + + + + public List processResults(String term) throws Exception { + return getConcepts(term); + } + + public Concept createConcept(String bestMatch, String skosConceptURI) { + + Concept concept = new Concept(); + concept.setUri(skosConceptURI); + concept.setConceptId(stripConceptId(skosConceptURI)); + concept.setBestMatch(bestMatch); + concept.setDefinedBy(schemeUri); + concept.setSchemeURI(this.schemeUri); + concept.setType(""); + + String encodedURI = URLEncoder.encode(skosConceptURI); + String encodedFormat = URLEncoder.encode("application/rdf+xml"); + String url = conceptSkosMosURL + "uri=" + encodedURI + "&format=" + + encodedFormat; + + // Utilize the XML directly instead of the SKOS API + try { + + concept = SKOSUtils + .createConceptUsingXMLFromURL(concept, url, "en", false); + + } catch (Exception ex) { + logger.debug("Error occurred for creating concept " + + skosConceptURI, ex); + return null; + } + + return concept; + } + + public List getConceptsByURIWithSparql(String uri) + throws Exception { + // deprecating this method...just return an empty list + List conceptList = new ArrayList<>(); + return conceptList; + } + + protected String getAgrovocTermCode(String rdf) throws Exception { + String termcode = ""; + try { + Document doc = XMLUtils.parse(rdf); + NodeList nodes = doc.getElementsByTagName("hasCodeAgrovoc"); + if (nodes.item(0) != null) { + Node node = nodes.item(0); + termcode = node.getTextContent(); + } + + } catch (SAXException | IOException | ParserConfigurationException e) { + // e.printStackTrace(); + throw e; + } + return termcode; + } + + protected String getConceptURIFromRDF(String rdf) { + String conceptUri = ""; + try { + Document doc = XMLUtils.parse(rdf); + NodeList nodes = doc.getElementsByTagName("skos:Concept"); + Node node = nodes.item(0); + + NamedNodeMap attrs = node.getAttributes(); + Attr idAttr = (Attr) attrs.getNamedItem("rdf:about"); + conceptUri = idAttr.getTextContent(); + } catch (IOException | ParserConfigurationException | SAXException e) { + e.printStackTrace(); + System.err.println("rdf: " + rdf); + } + return conceptUri; + + } + + // When utilizing the getTermExpansion method, will get a list of URIs back + // and not just one URI + protected List getConceptURIsListFromRDF(String rdf) { + List conceptUris = new ArrayList<>(); + try { + Document doc = XMLUtils.parse(rdf); + NodeList nodes = doc.getElementsByTagName("skos:Concept"); + int numberNodes = nodes.getLength(); + int n; + for (n = 0; n < numberNodes; n++) { + Node node = nodes.item(n); + NamedNodeMap attrs = node.getAttributes(); + Attr idAttr = (Attr) attrs.getNamedItem("rdf:about"); + String conceptUri = idAttr.getTextContent(); + conceptUris.add(conceptUri); + } + + + } catch (IOException | ParserConfigurationException | SAXException e) { + e.printStackTrace(); + System.err.println("rdf: " + rdf); + } + return conceptUris; + + } + + protected String getDbpediaDescription(String uri) throws Exception { + String descriptionSource = " (Source: DBpedia)"; + String description = ""; + String qs = "" + + "PREFIX rdfs: \n" + + "PREFIX rdf: \n" + + "PREFIX foaf: \n" + + "PREFIX dbpedia-owl: \n" + + "SELECT DISTINCT ?description WHERE { \n" + "<" + uri + + "> rdfs:comment ?description . \n" + + "FILTER (LANG(?description)='en' ) \n" + "}"; + // System.out.println(qs); + List resultList = new ArrayList<>(); + QueryExecution qexec = null; + try { + + Query query = QueryFactory.create(qs); + qexec = QueryExecutionFactory.sparqlService(this.dbpedia_endpoint, query); + qexec.setTimeout(5000, TimeUnit.MILLISECONDS); + resultList = new ArrayList<>(); + ResultSet resultSet = qexec.execSelect(); + int resultSetSize = 0; + while (resultSet.hasNext()) { + resultSetSize++; + QuerySolution solution = resultSet.nextSolution(); + Iterator varnames = solution.varNames(); + HashMap hm = new HashMap<>(); + while (varnames.hasNext()) { + String name = (String) varnames.next(); + RDFNode rdfnode = solution.get(name); + // logger.info("rdf node name, type: "+ name + // +", "+getRDFNodeType(rdfnode)); + if (rdfnode.isLiteral()) { + Literal literal = rdfnode.asLiteral(); + String nodeval = literal.getString(); + hm.put(name, nodeval); + } else if (rdfnode.isResource()) { + Resource resource = rdfnode.asResource(); + String nodeval = resource.toString(); + hm.put(name, nodeval); + } + } + resultList.add(hm); + } + description = ""; + for (HashMap map : resultList) { + if (map.containsKey("description")) { + description = (String) map.get("description"); + } + } + } catch (Exception ex) { + throw ex; + } + // Adding source so it is clear that this description comes from DBPedia + return description + descriptionSource; + } + + /** + * @param uri The URI + */ + protected String stripConceptId(String uri) { + String conceptId = ""; + int lastslash = uri.lastIndexOf('/'); + conceptId = uri.substring(lastslash + 1, uri.length()); + return conceptId; + } + + /** + * @param str The String + */ + protected String extractConceptId(String str) { + try { + return str.substring(1, str.length() - 1); + } catch (Exception ex) { + return ""; + } + } + + /** + * The code here utilizes the SKOSMOS REST API for Agrovoc + * This returns JSON LD so we would parse JSON instead of RDF + * The code above can still be utilized if we need to employ the web services directly + */ + //Get search results for a particular term and language code + private String getSKOSMosSearchResults(String term, String lang) { + String urlEncodedTerm = URLEncoder.encode(term); + //Utilize 'starts with' using the * operator at the end + String searchUrlString = this.conceptsSkosMosSearch + "query=" + urlEncodedTerm + "*" + "&lang=" + lang; + URL searchURL = null; + try { + searchURL = new URL(searchUrlString); + } catch (Exception e) { + logger.error("Exception occurred in instantiating URL for " + + searchUrlString, e); + // If the url is having trouble, just return null for the concept + return null; + } + + String results = null; + try { + + StringWriter sw = new StringWriter(); + + BufferedReader in = new BufferedReader(new InputStreamReader( + searchURL.openStream())); + String inputLine; + while ((inputLine = in.readLine()) != null) { + sw.write(inputLine); + } + in.close(); + + results = sw.toString(); + logger.debug(results); + } catch (Exception ex) { + logger.error("Error occurred in getting concept from the URL " + + searchUrlString, ex); + return null; + } + return results; + + } + + //JSON-LD array + private List getConceptURIsListFromSkosMosResult(String results) { + List conceptURIs = new ArrayList<>(); + ObjectNode json = (ObjectNode) JacksonUtils.parseJson(results); + //Format should be: { ..."results":["uri":uri...] + if (json.has("results")) { + ArrayNode jsonArray = (ArrayNode) json.get("results"); + int numberResults = jsonArray.size(); + int i; + for(i = 0; i < numberResults; i++) { + ObjectNode jsonObject = (ObjectNode) jsonArray.get(i); + if(jsonObject.has("uri")) { + conceptURIs.add(jsonObject.get("uri").asText()); + } + } + } + return conceptURIs; + } + + + + +} diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java index 5c6999b0..7f95be2f 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java @@ -1,360 +1,360 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.semservices.service.impl; - - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.StringWriter; -import java.net.URL; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import edu.cornell.mannlib.semservices.bo.Concept; -import edu.cornell.mannlib.semservices.exceptions.ConceptsNotFoundException; -import edu.cornell.mannlib.semservices.service.ExternalConceptService; -import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; - -public class GemetService implements ExternalConceptService { - protected final Log logger = LogFactory.getLog(getClass()); - private final String GemetWS_address = "https://www.eionet.europa.eu/gemet/"; - private final String narrowerUri = "http://www.w3.org/2004/02/skos/core%23narrower"; - private final String broaderUri = "http://www.w3.org/2004/02/skos/core%23broader"; - private final String relatedUri = "http://www.w3.org/2004/02/skos/core%23related"; - private final String definitionUri = "http://www.w3.org/2004/02/skos/core%23definition"; - private final String prefLabelUri = "http://www.w3.org/2004/02/skos/core%23prefLabel"; - private final String scopeNoteUri = "http://www.w3.org/2004/02/skos/core%23scopeNote"; - private final String altLabelUri = "http://www.w3.org/2004/02/skos/core%23altLabel"; - private final String exampleUri = "http://www.w3.org/2004/02/skos/core%23example"; - private final String acronymLabelUri = "http://www.w3.org/2004/02/skos/core%23acronymLabel"; - private final String endpoint = "http://cr.eionet.europa.eu/sparql"; - private final String schemeURI = "http://www.eionet.europa.eu/gemet/gemetThesaurus"; - - - @Override - public List getConcepts(String term) throws Exception { - List conceptList = new ArrayList(); - try { - String results = getConceptsMatchingKeyword(term); - //System.out.println(results); - conceptList = processOutput(results); - - } catch (Exception ex) { - return new ArrayList(); - //ex.printStackTrace(); - //throw ex; - } - return conceptList; - } - - public List processResults(String term) throws Exception { - List conceptList = new ArrayList(); - try { - String results = getConceptsMatchingKeyword(term); - conceptList = processOutput(results); - } catch (Exception ex) { - //ex.printStackTrace(); - throw ex; - } - return conceptList; - - } - - public List getConceptsByURIWithSparql(String uri) - throws Exception { - // deprecating this method...just return an empty list - List conceptList = new ArrayList(); - return conceptList; - } - - /** - * @param results Results to process - */ - private List processOutput(String results) throws Exception { - - List conceptList = new ArrayList(); - - try { - ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(results); - if (jsonArray.size() == 0) { - throw new ConceptsNotFoundException(); - } - - for (int i = 0; i < jsonArray.size(); i++) { - Concept concept = new Concept(); - concept.setDefinedBy(schemeURI); - concept.setBestMatch("true"); - ObjectNode json = (ObjectNode) jsonArray.get(i); - String uri = getJsonValue(json, "uri"); - - concept.setUri(uri); - concept.setConceptId(stripConceptId(uri)); - concept.setSchemeURI(schemeURI); - concept.setType(""); - if (json.has("preferredLabel")) { - ObjectNode preferredLabelObj = (ObjectNode) json.get("preferredLabel"); - if (preferredLabelObj.has("string")) { - concept.setLabel(getJsonValue(preferredLabelObj, - "string")); - } - } - if (json.has("definition")) { - ObjectNode definitionObj = (ObjectNode) json.get("definition"); - if (definitionObj.has("string")) { - concept.setDefinition(getJsonValue(definitionObj, - "string")); - } - } - - String narrower = getRelatedConcepts(uri, "narrower"); - List narrowerURIList = getRelatedUris(narrower); - concept.setNarrowerURIList(narrowerURIList); - - String broader = getRelatedConcepts(uri, "broader"); - List broaderURIList = getRelatedUris(broader); - concept.setBroaderURIList(broaderURIList); - - /*String related = getRelatedConcepts(uri, "related"); - List relatedURIList = getRelatedUris(related); - for (String s: relatedURIList) { - System.out.println("related uri: "+s); - }*/ - //String altLabels = getAllTranslationsForConcept(uri, "nonPreferredLabels"); - - conceptList.add(concept); - - } - - } catch (Exception ex ) { - //ex.printStackTrace(); - logger.error("Could not get concepts", ex); - throw ex; - } - return conceptList; - - } - - /** - * Get a string from a json object or an empty string if there is no value for the given key - * @param obj JSON Object - * @param key Key to retrieve - */ - protected String getJsonValue(ObjectNode obj, String key) { - if (obj.has(key)) { - return obj.get(key).asText(); - } else { - return ""; - } - } - - - /** - * @param concept_uri Concept URI - * @throws Exception - */ - protected String getAvailableLangs(String concept_uri) throws Exception { - String result = ""; - String serviceUrl = GemetWS_address + "getAvailableLanguages" + - "?concept_uri=" + concept_uri; - try { - result = getGemetResults(serviceUrl); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - return result; - } - - /** - * @param concept_uri concept URI - * @throws Exception - */ - protected String getConcept(String concept_uri) throws Exception { - String result = ""; - String serviceUrl = GemetWS_address + "getConcept" + - "?concept_uri=" + concept_uri + - "&language=en"; - try { - result = getGemetResults(serviceUrl); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - return result; - } - - /** - * @param concept_uri Concept URI - * @param property Property - * @throws Exception - */ - protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception { - String result = ""; - String property_uri = ""; - switch (property) { - case "definition": - property_uri = definitionUri; - break; - case "preferredLabel": - property_uri = prefLabelUri; - break; - case "scopeNote": - property_uri = scopeNoteUri; - break; - case "nonPreferredLabels": - property_uri = altLabelUri; - break; - case "example": - property_uri = exampleUri; - break; - case "acronymLabel": - property_uri = acronymLabelUri; - break; - } - - String serviceUrl = GemetWS_address + "getAllTranslationsForConcept" + - "?concept_uri=" + concept_uri + - "&property_uri=" + property_uri + - "&language=en"; - try { - result = getGemetResults(serviceUrl); - List props = getPropertyFromJson(result); - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - return result; - } - - - /** - * @param concept_uri Concept URI - * @param relation Relations - * @throws Exception - */ - protected String getRelatedConcepts(String concept_uri, String relation) throws Exception { - String result = ""; - String relation_uri = ""; - switch (relation) { - case "broader": - relation_uri = broaderUri; - break; - case "narrower": - relation_uri = narrowerUri; - break; - case "related": - relation_uri = relatedUri; - break; - } - String serviceUrl = GemetWS_address + "getRelatedConcepts" + - "?concept_uri=" + concept_uri + - "&relation_uri=" + relation_uri + - "&language=en"; - try { - result = getGemetResults(serviceUrl); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - return result; - } - - - - /** - * @param keyword Keyword - * @throws Exception - */ - protected String getConceptsMatchingKeyword(String keyword) throws Exception { - String result = ""; - String encodedKeyword = URLEncoder.encode(keyword, "UTF-8"); - String serviceUrl = GemetWS_address + "getConceptsMatchingKeyword" + - "?keyword=" + encodedKeyword + - "&search_mode=0" + - "&thesaurus_uri=http://www.eionet.europa.eu/gemet/concept/" + - "&language=en"; - try { - result = getGemetResults(serviceUrl); - } catch (Exception ex) { - throw ex; - } - return result; - - } - - /** - * @param url URI - */ - protected String getGemetResults(String url) throws Exception { - String results = ""; - //System.out.println("url: "+url); - try { - - StringWriter sw = new StringWriter(); - URL serviceUrl = new URL(url); - - BufferedReader in = new BufferedReader(new InputStreamReader(serviceUrl.openStream())); - String inputLine; - while ((inputLine = in.readLine()) != null) { - sw.write(inputLine); - } - in.close(); - - results = sw.toString(); - - } catch (Exception ex) { - logger.error("error occurred in servlet", ex); - ex.printStackTrace(); - throw ex; - } - return results; - } - - - protected List getRelatedUris(String json) { - List uriList = new ArrayList(); - String uri = ""; - ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(json); - if (jsonArray.size() == 0) { - return new ArrayList(); - } - for (int i = 0; i < jsonArray.size(); i++) { - ObjectNode jsonObj = (ObjectNode) jsonArray.get(i); - uri = getJsonValue(jsonObj, "uri"); - uriList.add(uri); - } - - return uriList; - - } - - protected List getPropertyFromJson(String json) { - List props = new ArrayList(); - ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(json); - if (jsonArray.size() == 0) { - return new ArrayList(); - } - for (int i = 0; i < jsonArray.size(); i++) { - System.out.println((jsonArray.get(i)).toString()); - } - return props; - } - - protected String stripConceptId(String uri) { - String conceptId = ""; - int lastslash = uri.lastIndexOf('/'); - conceptId = uri.substring(lastslash + 1, uri.length()); - return conceptId; - } - - - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.semservices.service.impl; + + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.StringWriter; +import java.net.URL; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import edu.cornell.mannlib.semservices.bo.Concept; +import edu.cornell.mannlib.semservices.exceptions.ConceptsNotFoundException; +import edu.cornell.mannlib.semservices.service.ExternalConceptService; +import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; + +public class GemetService implements ExternalConceptService { + protected final Log logger = LogFactory.getLog(getClass()); + private final String GemetWS_address = "https://www.eionet.europa.eu/gemet/"; + private final String narrowerUri = "http://www.w3.org/2004/02/skos/core%23narrower"; + private final String broaderUri = "http://www.w3.org/2004/02/skos/core%23broader"; + private final String relatedUri = "http://www.w3.org/2004/02/skos/core%23related"; + private final String definitionUri = "http://www.w3.org/2004/02/skos/core%23definition"; + private final String prefLabelUri = "http://www.w3.org/2004/02/skos/core%23prefLabel"; + private final String scopeNoteUri = "http://www.w3.org/2004/02/skos/core%23scopeNote"; + private final String altLabelUri = "http://www.w3.org/2004/02/skos/core%23altLabel"; + private final String exampleUri = "http://www.w3.org/2004/02/skos/core%23example"; + private final String acronymLabelUri = "http://www.w3.org/2004/02/skos/core%23acronymLabel"; + private final String endpoint = "http://cr.eionet.europa.eu/sparql"; + private final String schemeURI = "http://www.eionet.europa.eu/gemet/gemetThesaurus"; + + + @Override + public List getConcepts(String term) throws Exception { + List conceptList = new ArrayList(); + try { + String results = getConceptsMatchingKeyword(term); + //System.out.println(results); + conceptList = processOutput(results); + + } catch (Exception ex) { + return new ArrayList(); + //ex.printStackTrace(); + //throw ex; + } + return conceptList; + } + + public List processResults(String term) throws Exception { + List conceptList = new ArrayList(); + try { + String results = getConceptsMatchingKeyword(term); + conceptList = processOutput(results); + } catch (Exception ex) { + //ex.printStackTrace(); + throw ex; + } + return conceptList; + + } + + public List getConceptsByURIWithSparql(String uri) + throws Exception { + // deprecating this method...just return an empty list + List conceptList = new ArrayList(); + return conceptList; + } + + /** + * @param results Results to process + */ + private List processOutput(String results) throws Exception { + + List conceptList = new ArrayList(); + + try { + ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(results); + if (jsonArray.size() == 0) { + throw new ConceptsNotFoundException(); + } + + for (int i = 0; i < jsonArray.size(); i++) { + Concept concept = new Concept(); + concept.setDefinedBy(schemeURI); + concept.setBestMatch("true"); + ObjectNode json = (ObjectNode) jsonArray.get(i); + String uri = getJsonValue(json, "uri"); + + concept.setUri(uri); + concept.setConceptId(stripConceptId(uri)); + concept.setSchemeURI(schemeURI); + concept.setType(""); + if (json.has("preferredLabel")) { + ObjectNode preferredLabelObj = (ObjectNode) json.get("preferredLabel"); + if (preferredLabelObj.has("string")) { + concept.setLabel(getJsonValue(preferredLabelObj, + "string")); + } + } + if (json.has("definition")) { + ObjectNode definitionObj = (ObjectNode) json.get("definition"); + if (definitionObj.has("string")) { + concept.setDefinition(getJsonValue(definitionObj, + "string")); + } + } + + String narrower = getRelatedConcepts(uri, "narrower"); + List narrowerURIList = getRelatedUris(narrower); + concept.setNarrowerURIList(narrowerURIList); + + String broader = getRelatedConcepts(uri, "broader"); + List broaderURIList = getRelatedUris(broader); + concept.setBroaderURIList(broaderURIList); + + /*String related = getRelatedConcepts(uri, "related"); + List relatedURIList = getRelatedUris(related); + for (String s: relatedURIList) { + System.out.println("related uri: "+s); + }*/ + //String altLabels = getAllTranslationsForConcept(uri, "nonPreferredLabels"); + + conceptList.add(concept); + + } + + } catch (Exception ex ) { + //ex.printStackTrace(); + logger.error("Could not get concepts", ex); + throw ex; + } + return conceptList; + + } + + /** + * Get a string from a json object or an empty string if there is no value for the given key + * @param obj JSON Object + * @param key Key to retrieve + */ + protected String getJsonValue(ObjectNode obj, String key) { + if (obj.has(key)) { + return obj.get(key).asText(); + } else { + return ""; + } + } + + + /** + * @param concept_uri Concept URI + * @throws Exception + */ + protected String getAvailableLangs(String concept_uri) throws Exception { + String result = ""; + String serviceUrl = GemetWS_address + "getAvailableLanguages" + + "?concept_uri=" + concept_uri; + try { + result = getGemetResults(serviceUrl); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + return result; + } + + /** + * @param concept_uri concept URI + * @throws Exception + */ + protected String getConcept(String concept_uri) throws Exception { + String result = ""; + String serviceUrl = GemetWS_address + "getConcept" + + "?concept_uri=" + concept_uri + + "&language=en"; + try { + result = getGemetResults(serviceUrl); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + return result; + } + + /** + * @param concept_uri Concept URI + * @param property Property + * @throws Exception + */ + protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception { + String result = ""; + String property_uri = ""; + switch (property) { + case "definition": + property_uri = definitionUri; + break; + case "preferredLabel": + property_uri = prefLabelUri; + break; + case "scopeNote": + property_uri = scopeNoteUri; + break; + case "nonPreferredLabels": + property_uri = altLabelUri; + break; + case "example": + property_uri = exampleUri; + break; + case "acronymLabel": + property_uri = acronymLabelUri; + break; + } + + String serviceUrl = GemetWS_address + "getAllTranslationsForConcept" + + "?concept_uri=" + concept_uri + + "&property_uri=" + property_uri + + "&language=en"; + try { + result = getGemetResults(serviceUrl); + List props = getPropertyFromJson(result); + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + return result; + } + + + /** + * @param concept_uri Concept URI + * @param relation Relations + * @throws Exception + */ + protected String getRelatedConcepts(String concept_uri, String relation) throws Exception { + String result = ""; + String relation_uri = ""; + switch (relation) { + case "broader": + relation_uri = broaderUri; + break; + case "narrower": + relation_uri = narrowerUri; + break; + case "related": + relation_uri = relatedUri; + break; + } + String serviceUrl = GemetWS_address + "getRelatedConcepts" + + "?concept_uri=" + concept_uri + + "&relation_uri=" + relation_uri + + "&language=en"; + try { + result = getGemetResults(serviceUrl); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + return result; + } + + + + /** + * @param keyword Keyword + * @throws Exception + */ + protected String getConceptsMatchingKeyword(String keyword) throws Exception { + String result = ""; + String encodedKeyword = URLEncoder.encode(keyword, "UTF-8"); + String serviceUrl = GemetWS_address + "getConceptsMatchingKeyword" + + "?keyword=" + encodedKeyword + + "&search_mode=0" + + "&thesaurus_uri=http://www.eionet.europa.eu/gemet/concept/" + + "&language=en"; + try { + result = getGemetResults(serviceUrl); + } catch (Exception ex) { + throw ex; + } + return result; + + } + + /** + * @param url URI + */ + protected String getGemetResults(String url) throws Exception { + String results = ""; + //System.out.println("url: "+url); + try { + + StringWriter sw = new StringWriter(); + URL serviceUrl = new URL(url); + + BufferedReader in = new BufferedReader(new InputStreamReader(serviceUrl.openStream())); + String inputLine; + while ((inputLine = in.readLine()) != null) { + sw.write(inputLine); + } + in.close(); + + results = sw.toString(); + + } catch (Exception ex) { + logger.error("error occurred in servlet", ex); + ex.printStackTrace(); + throw ex; + } + return results; + } + + + protected List getRelatedUris(String json) { + List uriList = new ArrayList(); + String uri = ""; + ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(json); + if (jsonArray.size() == 0) { + return new ArrayList(); + } + for (int i = 0; i < jsonArray.size(); i++) { + ObjectNode jsonObj = (ObjectNode) jsonArray.get(i); + uri = getJsonValue(jsonObj, "uri"); + uriList.add(uri); + } + + return uriList; + + } + + protected List getPropertyFromJson(String json) { + List props = new ArrayList(); + ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(json); + if (jsonArray.size() == 0) { + return new ArrayList(); + } + for (int i = 0; i < jsonArray.size(); i++) { + System.out.println((jsonArray.get(i)).toString()); + } + return props; + } + + protected String stripConceptId(String uri) { + String conceptId = ""; + int lastslash = uri.lastIndexOf('/'); + conceptId = uri.substring(lastslash + 1, uri.length()); + return conceptId; + } + + + +} diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java index a2347927..32327ebc 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java @@ -39,8 +39,8 @@ public class LCSHService implements ExternalConceptService { private final String schemeUri = hostUri + "/authorities/subjects"; private final String baseUri = hostUri + "/search/"; - - + + @Override public List getConcepts(String term) throws Exception { List conceptList = new ArrayList(); @@ -111,19 +111,19 @@ public class LCSHService implements ExternalConceptService { conceptList.add(c); } i++; - + } return conceptList; } - + //Load individual concept using a request - //private - + //private + public Concept createConcept(String bestMatch, String conceptURLString, String skosConceptURI) { Concept concept = new Concept(); - + log.debug("SKOSConceptURI is " + skosConceptURI); // get skos version of uri @@ -133,31 +133,31 @@ public class LCSHService implements ExternalConceptService { concept.setDefinedBy(schemeUri); concept.setSchemeURI(schemeUri); concept.setType(""); - + //Utilize the XML directly instead of the SKOS API try { //LCSH doesn't need a language tag right now as results in english //Also want to add skos notes as definition concept = SKOSUtils.createConceptUsingXMLFromURL(concept, conceptURLString, null, true); - + } catch(Exception ex) { log.debug("Error occurred for annotation retrieval for skos concept " + skosConceptURI, ex); return null; } - - + + return concept; } - + private String getSKOSURL(String uri) { String skosURI = uri + skosSuffix; - + return skosURI; } - - + + public List getConceptURISFromJSON(String results) { List uris = new ArrayList(); @@ -197,7 +197,7 @@ public class LCSHService implements ExternalConceptService { } } - + log.debug("concept uri is " + conceptUri); uris.add(conceptUri); } @@ -241,6 +241,6 @@ public class LCSHService implements ExternalConceptService { // TODO Auto-generated method stub return null; } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java index 9232592d..59653f3f 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java @@ -1,229 +1,229 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.semservices.service.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import edu.cornell.mannlib.semservices.bo.Concept; -import edu.cornell.mannlib.semservices.exceptions.ConceptsNotFoundException; -import edu.cornell.mannlib.semservices.service.ExternalConceptService; -import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; -import org.apache.http.HttpVersion; -import org.apache.http.client.fluent.Form; -import org.apache.http.client.fluent.Request; -import org.apache.http.client.utils.URIBuilder; -import org.springframework.util.StringUtils; - -/** - * @author jaf30 - * - */ -public class UMLSService implements ExternalConceptService { - protected final Log logger = LogFactory.getLog(getClass()); - - private static String UTS_REST_API_URL = "https://uts-ws.nlm.nih.gov/rest"; - private static String SEARCH_PATH = "/search/current"; - private static String SEARCH_PARAMETER = "string"; - private static String SEARCH_TYPE_PARAMETER = "searchType"; - private static String SEARCH_TYPE = "rightTruncation"; - private static String PAGE_SIZE_PARAMETER = "pageSize"; - private static String RETURN_TYPE_PARAMETER = "returnIdType"; - private static String RETURN_TYPE = "concept"; - private static String TICKET_PARAMETER = "ticket"; - - private static String ticketGrantingTicketURL = null; - - private static long lastUpdate = -1; - - private static String username = null; - private static String password = null; - private static String apikey = null; - - private static String pageSize = "50"; - - private static String UMLS_AUTH_USER_URL = "https://utslogin.nlm.nih.gov/cas/v1/tickets"; - private static String UMLS_AUTH_KEY_URL = "https://utslogin.nlm.nih.gov/cas/v1/api-key"; - private static String UTS_SERVICE_URL = "http://umlsks.nlm.nih.gov"; - - { - if (username == null || apikey == null) { - final Properties properties = new Properties(); - try (InputStream stream = getClass().getResourceAsStream("/umls.properties")) { - properties.load(stream); - username = properties.getProperty("username"); - password = properties.getProperty("password"); - apikey = properties.getProperty("apikey"); - - String exPageSize = properties.getProperty("pagesize"); - try { - if (!StringUtils.isEmpty(exPageSize)) { - int iPageSize = Integer.parseInt(exPageSize, 10); - if (iPageSize > 5 && iPageSize < 200) { - pageSize = Integer.toString(iPageSize, 10); - } - } - } catch (Exception e) { - } - } catch (IOException e) { - } - } - } - - public boolean isConfigured() { - return !(StringUtils.isEmpty(username) && StringUtils.isEmpty(apikey)); - } - - @Override - public List getConcepts(String term) throws Exception { - String ticket = getSingleUseTicket(); - - List conceptList = new ArrayList(); - - String results = null; - - try { - URIBuilder b = new URIBuilder(UTS_REST_API_URL + SEARCH_PATH); - b.addParameter(SEARCH_PARAMETER, term); - b.addParameter(RETURN_TYPE_PARAMETER, RETURN_TYPE); - b.addParameter(SEARCH_TYPE_PARAMETER, SEARCH_TYPE); - b.addParameter(PAGE_SIZE_PARAMETER, pageSize); - b.addParameter(TICKET_PARAMETER, ticket); - - results = Request.Get(b.build()) - .connectTimeout(3000) - .socketTimeout(3000) - .execute().returnContent().asString(); - - conceptList = processOutput(results); - return conceptList; - - } catch (Exception ex) { - logger.error("error occurred in servlet", ex); - return null; - } - } - - public List processResults(String term) throws Exception { - return getConcepts(term); - } - - /** - * @param uri URI - */ - public List getConceptsByURIWithSparql(String uri) throws Exception { - // deprecating this method...just return an empty list - List conceptList = new ArrayList(); - return conceptList; - } - - /** - * @param results Results to process - */ - private List processOutput(String results) throws Exception { - List conceptList = new ArrayList(); - List bestMatchIdList = new ArrayList(); - String bestMatchId = ""; - - try { - ObjectNode json = (ObjectNode) JacksonUtils.parseJson(results); - ArrayNode allArray = (ArrayNode) json.get("result").get("results"); - int len = allArray.size(); - int i; - for (i = 0; i < len; i++) { - ObjectNode o = (ObjectNode) allArray.get(i); - - Concept concept = new Concept(); - concept.setDefinedBy(UTS_SERVICE_URL); - concept.setSchemeURI(UTS_SERVICE_URL); - - concept.setType(RETURN_TYPE); - concept.setConceptId(getJsonValue(o, "ui")); - concept.setLabel(getJsonValue(o, "name")); - concept.setUri(getJsonValue(o, "uri")); - - concept.setBestMatch("false"); - conceptList.add(concept); - } - } catch (Exception ex) { - ex.printStackTrace(); - logger.error("Could not get concepts", ex); - throw ex; - } - - if (conceptList.size() == 0) { - throw new ConceptsNotFoundException(); - } - - // - return conceptList; - - } - - /** - * Get a string from a json object or an empty string if there is no value for the given key - * - * @param obj JSON Object - * @param key Key to retrieve - */ - protected String getJsonValue(ObjectNode obj, String key) { - if (obj.has(key)) { - return obj.get(key).asText(); - } else { - return ""; - } - } - - - protected String stripConceptId(String uri) { - String conceptId = ""; - int lastslash = uri.lastIndexOf('/'); - conceptId = uri.substring(lastslash + 1, uri.length()); - return conceptId; - } - - private synchronized void getTicketGrantingTicket() { - if (StringUtils.isEmpty(username) && StringUtils.isEmpty(apikey)) { - throw new IllegalStateException("Unable to read umls.properties"); - } - - if (ticketGrantingTicketURL == null || lastUpdate + 28700000L < System.currentTimeMillis()) { - try { - if (!StringUtils.isEmpty(apikey)) { - ticketGrantingTicketURL = Request.Post(UMLS_AUTH_KEY_URL).useExpectContinue().version(HttpVersion.HTTP_1_1) - .bodyForm(Form.form().add("apikey", apikey).build()) - .execute().returnResponse().getFirstHeader("location").getValue(); - } else { - ticketGrantingTicketURL = Request.Post(UMLS_AUTH_USER_URL).useExpectContinue().version(HttpVersion.HTTP_1_1) - .bodyForm(Form.form().add("username", username).add("password", password).build()) - .execute().returnResponse().getFirstHeader("location").getValue(); - } - } catch (IOException e) { - throw new IllegalStateException("Unable to get ticket granting ticket."); - } - lastUpdate = System.currentTimeMillis(); - } - } - - private String getSingleUseTicket() { - getTicketGrantingTicket(); - String ticket = ""; - try { - ticket = Request.Post(ticketGrantingTicketURL).useExpectContinue().version(HttpVersion.HTTP_1_1) - .bodyForm(Form.form().add("service", UTS_SERVICE_URL).build()) - .execute().returnContent().asString(); - } catch (IOException e) { - throw new IllegalStateException("Unable to get ticket."); - } - return ticket; - } -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.semservices.service.impl; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import edu.cornell.mannlib.semservices.bo.Concept; +import edu.cornell.mannlib.semservices.exceptions.ConceptsNotFoundException; +import edu.cornell.mannlib.semservices.service.ExternalConceptService; +import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; +import org.apache.http.HttpVersion; +import org.apache.http.client.fluent.Form; +import org.apache.http.client.fluent.Request; +import org.apache.http.client.utils.URIBuilder; +import org.springframework.util.StringUtils; + +/** + * @author jaf30 + * + */ +public class UMLSService implements ExternalConceptService { + protected final Log logger = LogFactory.getLog(getClass()); + + private static String UTS_REST_API_URL = "https://uts-ws.nlm.nih.gov/rest"; + private static String SEARCH_PATH = "/search/current"; + private static String SEARCH_PARAMETER = "string"; + private static String SEARCH_TYPE_PARAMETER = "searchType"; + private static String SEARCH_TYPE = "rightTruncation"; + private static String PAGE_SIZE_PARAMETER = "pageSize"; + private static String RETURN_TYPE_PARAMETER = "returnIdType"; + private static String RETURN_TYPE = "concept"; + private static String TICKET_PARAMETER = "ticket"; + + private static String ticketGrantingTicketURL = null; + + private static long lastUpdate = -1; + + private static String username = null; + private static String password = null; + private static String apikey = null; + + private static String pageSize = "50"; + + private static String UMLS_AUTH_USER_URL = "https://utslogin.nlm.nih.gov/cas/v1/tickets"; + private static String UMLS_AUTH_KEY_URL = "https://utslogin.nlm.nih.gov/cas/v1/api-key"; + private static String UTS_SERVICE_URL = "http://umlsks.nlm.nih.gov"; + + { + if (username == null || apikey == null) { + final Properties properties = new Properties(); + try (InputStream stream = getClass().getResourceAsStream("/umls.properties")) { + properties.load(stream); + username = properties.getProperty("username"); + password = properties.getProperty("password"); + apikey = properties.getProperty("apikey"); + + String exPageSize = properties.getProperty("pagesize"); + try { + if (!StringUtils.isEmpty(exPageSize)) { + int iPageSize = Integer.parseInt(exPageSize, 10); + if (iPageSize > 5 && iPageSize < 200) { + pageSize = Integer.toString(iPageSize, 10); + } + } + } catch (Exception e) { + } + } catch (IOException e) { + } + } + } + + public boolean isConfigured() { + return !(StringUtils.isEmpty(username) && StringUtils.isEmpty(apikey)); + } + + @Override + public List getConcepts(String term) throws Exception { + String ticket = getSingleUseTicket(); + + List conceptList = new ArrayList(); + + String results = null; + + try { + URIBuilder b = new URIBuilder(UTS_REST_API_URL + SEARCH_PATH); + b.addParameter(SEARCH_PARAMETER, term); + b.addParameter(RETURN_TYPE_PARAMETER, RETURN_TYPE); + b.addParameter(SEARCH_TYPE_PARAMETER, SEARCH_TYPE); + b.addParameter(PAGE_SIZE_PARAMETER, pageSize); + b.addParameter(TICKET_PARAMETER, ticket); + + results = Request.Get(b.build()) + .connectTimeout(3000) + .socketTimeout(3000) + .execute().returnContent().asString(); + + conceptList = processOutput(results); + return conceptList; + + } catch (Exception ex) { + logger.error("error occurred in servlet", ex); + return null; + } + } + + public List processResults(String term) throws Exception { + return getConcepts(term); + } + + /** + * @param uri URI + */ + public List getConceptsByURIWithSparql(String uri) throws Exception { + // deprecating this method...just return an empty list + List conceptList = new ArrayList(); + return conceptList; + } + + /** + * @param results Results to process + */ + private List processOutput(String results) throws Exception { + List conceptList = new ArrayList(); + List bestMatchIdList = new ArrayList(); + String bestMatchId = ""; + + try { + ObjectNode json = (ObjectNode) JacksonUtils.parseJson(results); + ArrayNode allArray = (ArrayNode) json.get("result").get("results"); + int len = allArray.size(); + int i; + for (i = 0; i < len; i++) { + ObjectNode o = (ObjectNode) allArray.get(i); + + Concept concept = new Concept(); + concept.setDefinedBy(UTS_SERVICE_URL); + concept.setSchemeURI(UTS_SERVICE_URL); + + concept.setType(RETURN_TYPE); + concept.setConceptId(getJsonValue(o, "ui")); + concept.setLabel(getJsonValue(o, "name")); + concept.setUri(getJsonValue(o, "uri")); + + concept.setBestMatch("false"); + conceptList.add(concept); + } + } catch (Exception ex) { + ex.printStackTrace(); + logger.error("Could not get concepts", ex); + throw ex; + } + + if (conceptList.size() == 0) { + throw new ConceptsNotFoundException(); + } + + // + return conceptList; + + } + + /** + * Get a string from a json object or an empty string if there is no value for the given key + * + * @param obj JSON Object + * @param key Key to retrieve + */ + protected String getJsonValue(ObjectNode obj, String key) { + if (obj.has(key)) { + return obj.get(key).asText(); + } else { + return ""; + } + } + + + protected String stripConceptId(String uri) { + String conceptId = ""; + int lastslash = uri.lastIndexOf('/'); + conceptId = uri.substring(lastslash + 1, uri.length()); + return conceptId; + } + + private synchronized void getTicketGrantingTicket() { + if (StringUtils.isEmpty(username) && StringUtils.isEmpty(apikey)) { + throw new IllegalStateException("Unable to read umls.properties"); + } + + if (ticketGrantingTicketURL == null || lastUpdate + 28700000L < System.currentTimeMillis()) { + try { + if (!StringUtils.isEmpty(apikey)) { + ticketGrantingTicketURL = Request.Post(UMLS_AUTH_KEY_URL).useExpectContinue().version(HttpVersion.HTTP_1_1) + .bodyForm(Form.form().add("apikey", apikey).build()) + .execute().returnResponse().getFirstHeader("location").getValue(); + } else { + ticketGrantingTicketURL = Request.Post(UMLS_AUTH_USER_URL).useExpectContinue().version(HttpVersion.HTTP_1_1) + .bodyForm(Form.form().add("username", username).add("password", password).build()) + .execute().returnResponse().getFirstHeader("location").getValue(); + } + } catch (IOException e) { + throw new IllegalStateException("Unable to get ticket granting ticket."); + } + lastUpdate = System.currentTimeMillis(); + } + } + + private String getSingleUseTicket() { + getTicketGrantingTicket(); + String ticket = ""; + try { + ticket = Request.Post(ticketGrantingTicketURL).useExpectContinue().version(HttpVersion.HTTP_1_1) + .bodyForm(Form.form().add("service", UTS_SERVICE_URL).build()) + .execute().returnContent().asString(); + } catch (IOException e) { + throw new IllegalStateException("Unable to get ticket."); + } + return ticket; + } +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java index 1ac27292..47cb5171 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/AboutQrCodesController.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller; +package edu.cornell.mannlib.vitro.webapp.controller; import java.util.HashMap; import java.util.Map; @@ -18,7 +18,7 @@ import javax.servlet.annotation.WebServlet; @WebServlet(name = "AboutQrCodesController", urlPatterns = {"/qrcode/about"}) public class AboutQrCodesController extends FreemarkerHttpServlet { - + private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(ExportQrCodeController.class); private static final String TEMPLATE_DEFAULT = "aboutQrCodes.ftl"; @@ -27,7 +27,7 @@ public class AboutQrCodesController extends FreemarkerHttpServlet { protected ResponseValues processRequest(VitroRequest vreq) { try { Map body = new HashMap(); - + return new TemplateResponseValues(TEMPLATE_DEFAULT, body); } catch (Throwable e) { log.error(e, e); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java index d036ff1d..d74f424f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ExportQrCodeController.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller; +package edu.cornell.mannlib.vitro.webapp.controller; import java.util.ArrayList; import java.util.HashMap; @@ -31,7 +31,7 @@ import javax.servlet.annotation.WebServlet; @WebServlet(name = "ExportQrCodeController", urlPatterns = {"/qrcode"}) public class ExportQrCodeController extends FreemarkerHttpServlet { - + private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(ExportQrCodeController.class); private static final String TEMPLATE_DEFAULT = "foaf-person--exportQrCode.ftl"; @@ -61,12 +61,12 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { protected ResponseValues processRequest(VitroRequest vreq) { try { Individual individual = getIndividualFromRequest(vreq); - + qrData = generateQrData(individual, vreq); DefaultObjectWrapper wrapper = new DefaultObjectWrapper(); wrapper.setExposureLevel(BeansWrapper.EXPOSE_SAFE); - + Map body = new HashMap(); body.put("individual", wrapper.wrap(IndividualTemplateModelBuilder.build(individual, vreq))); body.put("qrData", qrData); @@ -94,7 +94,7 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { } private Map generateQrData(Individual individual, VitroRequest vreq) { - + try { String firstName = ""; String lastName = ""; @@ -106,7 +106,7 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { Map qrData = new HashMap(); - for (Map map: vcardData) { + for (Map map: vcardData) { firstName = map.get("firstName"); lastName = map.get("lastName"); preferredTitle = map.get("title"); @@ -128,13 +128,13 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { String tempUrl = vreq.getRequestURL().toString(); String prefix = "http://"; tempUrl = tempUrl.substring(0, tempUrl.replace(prefix, "").indexOf("/") + prefix.length()); - String externalUrl = tempUrl ; + String externalUrl = tempUrl ; qrData.put("externalUrl", externalUrl); String individualUri = individual.getURI(); String contextPath = vreq.getContextPath(); qrData.put("exportQrCodeUrl", contextPath + "/qrcode?uri=" + UrlBuilder.urlEncode(individualUri)); - + qrData.put("aboutQrCodesUrl", contextPath + "/qrcode/about"); return qrData; } catch (Exception e) { @@ -155,8 +155,8 @@ public class ExportQrCodeController extends FreemarkerHttpServlet { } } catch (Exception e) { log.error(e, e); - } - + } + return vcardData; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java index ea5d56dd..eecbb5cf 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusMapLocations.java @@ -27,7 +27,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { private static String GEO_FOCUS_QUERY = "" + "PREFIX geo: \n" + "PREFIX rdfs: \n" - + "PREFIX rdf: \n" + + "PREFIX rdf: \n" + "PREFIX core: \n" + "PREFIX foaf: \n" + "PREFIX vivoc: \n" @@ -52,7 +52,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { + " ?person rdf:type foaf:Person \n" + "} } \n" + "GROUP BY ?label ?location \n"; - + public GeoFocusMapLocations(HttpServlet parent, VitroRequest vreq, HttpServletResponse resp) { super(parent, vreq, resp); @@ -62,12 +62,12 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { public String prepareResponse() throws IOException { try { geoLocations = getGeoLocations(vreq); - + StringBuilder response = new StringBuilder("["); String geometry = "{\"geometry\": {\"type\": \"Point\",\"coordinates\": \"\"},"; String typeProps = "\"type\": \"Feature\",\"properties\": {\"mapType\": \"\","; String previousLabel = ""; - + for (Map map: geoLocations) { String label = map.get("label"); String html = map.get("count"); @@ -79,7 +79,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { Integer count = Integer.parseInt(map.get("count")); String radius = String.valueOf(calculateRadius(count)); String name = ""; - + if ( label != null && !label.equals(previousLabel) ) { if ( label.contains("Ivoire") ) { name = "Ivory Coast"; @@ -94,18 +94,18 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { name = label; } String tempStr = geometry; //+label - tempStr += typeProps //+ label + tempStr += typeProps //+ label + "\"popupContent\": \"" - + name + + name + "\",\"html\":" - + html + + html + ",\"radius\":" + radius + ",\"uri\": \"" + uri + "\",\"local\": \"" + local - + "\"}},"; + + "\"}},"; response.append(tempStr); previousLabel = label; } @@ -123,9 +123,9 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { return EMPTY_RESPONSE; } } - + private List> getGeoLocations(VitroRequest vreq) { - + String queryStr = GEO_FOCUS_QUERY; log.debug("queryStr = " + queryStr); List> locations = new ArrayList>(); @@ -137,12 +137,12 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder { } } catch (Exception e) { log.error(e, e); - } - + } + return locations; } private Integer calculateRadius(Integer count) { - + int radius = 8; if ( count != null ) { if ( count < 4 ) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java index c03e4643..8012b782 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java @@ -30,7 +30,7 @@ public class GeoFocusResearcherCount extends AbstractAjaxResponder { + " ?person a foaf:Person . \n" + " ?person core:geographicFocus ?focus \n" + "}" ; - + public GeoFocusResearcherCount(HttpServlet parent, VitroRequest vreq, HttpServletResponse resp) { super(parent, vreq, resp); @@ -40,9 +40,9 @@ public class GeoFocusResearcherCount extends AbstractAjaxResponder { public String prepareResponse() throws IOException { try { geoFocusCount = getGeoFocusCount(vreq); - + StringBuilder response = new StringBuilder("{ "); - + for (Map map: geoFocusCount) { String theCount = map.get("count"); response.append("\"count\": \"").append(theCount).append("\""); @@ -55,9 +55,9 @@ public class GeoFocusResearcherCount extends AbstractAjaxResponder { return EMPTY_RESPONSE; } } - + private List> getGeoFocusCount(VitroRequest vreq) { - + String queryStr = GEO_FOCUS_COUNT_QUERY; log.debug("queryStr = " + queryStr); List> count = new ArrayList>(); @@ -69,8 +69,8 @@ public class GeoFocusResearcherCount extends AbstractAjaxResponder { } } catch (Exception e) { log.error(e, e); - } - + } + return count; } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java index bfc02d10..bb6e0c50 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java @@ -35,7 +35,7 @@ public class HomePageAjaxController extends VitroAjaxController { } else if ("getGeoFocusResearcherCount".equals(function)) { new GeoFocusResearcherCount(this, vreq, resp).processRequest(); - } + } else { resp.getWriter().write("[]"); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/QrCodeDetails.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/QrCodeDetails.java index 444e7e52..19beed0d 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/QrCodeDetails.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/ajax/QrCodeDetails.java @@ -46,7 +46,7 @@ public class QrCodeDetails extends AbstractAjaxResponder { + " ?vTitle vcard:title ?title . \n" + " } \n" + "} " ; - + public QrCodeDetails(HttpServlet parent, VitroRequest vreq, HttpServletResponse resp) { super(parent, vreq, resp); @@ -62,17 +62,17 @@ public class QrCodeDetails extends AbstractAjaxResponder { String phoneNumber = ""; String email = ""; String response = "["; - + vcardData = getVcardData(individual, vreq); - for (Map map: vcardData) { + for (Map map: vcardData) { firstName = map.get("firstName"); lastName = map.get("lastName"); preferredTitle = map.get("title"); phoneNumber = map.get("phone"); email = map.get("email"); } - + /* String tempUrl = vreq.getRequestURL().toString(); String prefix = "http://"; @@ -121,7 +121,7 @@ public class QrCodeDetails extends AbstractAjaxResponder { return EMPTY_RESPONSE; } } - + private List> getVcardData(Individual individual, VitroRequest vreq) { String queryStr = QueryUtils.subUriForQueryVar(VCARD_DATA_QUERY, "subject", individual.getURI()); log.debug("queryStr = " + queryStr); @@ -134,8 +134,8 @@ public class QrCodeDetails extends AbstractAjaxResponder { } } catch (Exception e) { log.error(e, e); - } - + } + return vcardData; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/InstitutionalInternalClassController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/InstitutionalInternalClassController.java index f2de9d4c..4a19317b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/InstitutionalInternalClassController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/InstitutionalInternalClassController.java @@ -1,258 +1,258 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.controller.freemarker; - -import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSERTIONS; - -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.ResourceFactory; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.shared.Lock; - -import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; -import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; -import edu.cornell.mannlib.vitro.webapp.beans.VClass; -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.controller.edit.utils.LocalNamespaceClassUtils; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; -import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; -import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent; -import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; -/* - * Custom controller for menu management. This will be replaced later once N3 Editing - * has been successfully refactored and integrated with menu management. - */ -@WebServlet(name = "InstitutionalInternalClassController", urlPatterns = {"/processInstitutionalInternalClass"} ) -public class InstitutionalInternalClassController extends FreemarkerHttpServlet { - private static final Log log = LogFactory.getLog(InstitutionalInternalClassController.class); - - private static final String EDIT_FORM = "/processInstitutionalInternalClass"; - public final static AuthorizationRequest REQUIRED_ACTIONS = SimplePermission.MANAGE_MENUS.ACTION; - private static final String DISPLAY_FORM = "/institutionalInternalClassForm.ftl"; - private static HashMap localNamespaces = new HashMap(); - private static HashMap localNamespaceClasses = new HashMap(); - private static final String CREATE_CLASS_PARAM = "createClass"; - private static final String REDIRECT_PAGE = "/siteAdmin"; - @Override - protected AuthorizationRequest requiredActions(VitroRequest vreq) { - return REQUIRED_ACTIONS; - } - - @Override - protected ResponseValues processRequest(VitroRequest vreq) { - - //Based on existing of local namespaces and number of local classes present - //as well as command parameter, execute command - - Map data = new HashMap(); - //Get all local classes and namespace information - retrieveLocalClasses(vreq, data); - if(isSubmission(vreq)){ - processSubmission(vreq, data); - } else if(isCreateNewClass(vreq)) { - //Local namespace(s) exist and user wishes to create a new class - //Either cmd = create new or no local classes exist at all and one must be created - processCreateNewClass(vreq, data); - } else if(isSelectExistingClass(vreq)) { - //Local namespace(s) exist and user can select an existing class - processSelectExistingClass(vreq, data); - } else if(isCreateOntologies(vreq)) { - //Not being handled expliclity but message will display indicating - //no local namespaces exist and one must be created - processCreateOntologies(vreq, data); - } else { - log.error("Don't recognize the type of request."); - } - //Retrieve local namespaces - - - //Check if existing local namespaces - - data.put("formUrl", vreq.getContextPath() + EDIT_FORM); - data.put("cancelUrl", vreq.getContextPath() + REDIRECT_PAGE); - - //if no local namespaces, then provide message to display - //if existing namespace(s), then check - //if single namespace, retrieve all classes belonging to that local namespace - //if multiple namespaces, generate select list with namespaces - //for instertion: VClassDaoJena.insertVClass - // - if(isSubmission(vreq)){ - return redirectToSiteAdmin(); - } - return new TemplateResponseValues(DISPLAY_FORM, data); - - } - - private boolean isSubmission(VitroRequest vreq) { - String submit = vreq.getParameter("submitForm"); - return(submit!= null && !submit.isEmpty()); - } - - private void processCreateOntologies(VitroRequest vreq, Map data) { - data.put("submitAction", ""); - - } - - private boolean isCreateOntologies(VitroRequest vreq) { - //no local namespaces - return (localNamespaces.size() == 0); - - } - - private void processCreateNewClass(VitroRequest vreq, Map data) { - //this may need to be changed on the basis of how new classes interact with new ontologies - data.put("submitAction", "Create Class"); - data.put("createNewClass", true); - } - - private boolean isCreateNewClass(VitroRequest vreq) { - String command = vreq.getParameter("cmd"); - if(command != null && command.equals(CREATE_CLASS_PARAM)) { - return true; - } - //If local namespace exists but no classes in local namespaces, then need to enable creation of new classes - return(localNamespaces.size() > 0 && localNamespaceClasses.size() == 0); - } - - private void processSelectExistingClass(VitroRequest vreq, Map data) { - //Check if local classes exist and use for selection - data.put("useExistingLocalClass", true); - data.put("submitAction", "Save"); - } - - private boolean isSelectExistingClass(VitroRequest vreq) { - //Local namespaces exist and there are existing classes within those namespaces - return (localNamespaces.size() > 0 && localNamespaceClasses.size() > 0); - } - - - - private void retrieveLocalClasses(VitroRequest vreq, Map data) { - localNamespaces = LocalNamespaceClassUtils.getLocalOntologyNamespaces(vreq); - //Get classes for local namespaces - localNamespaceClasses = LocalNamespaceClassUtils.getLocalNamespacesClasses(vreq, localNamespaces); - data.put("existingLocalClasses", localNamespaceClasses); - data.put("existingLocalNamespaces", localNamespaces); - String noLocalOntologiesMessage = "There are currently no local ontologies. You must create a new ontology"; - data.put("noLocalOntologiesMessage", noLocalOntologiesMessage); - if(localNamespaces.size() == 0) { - data.put("ontologiesExist", false); - } - else { - data.put("ontologiesExist", true); - if(localNamespaces.size() > 1) { - data.put("multipleLocalNamespaces", true); - } else { - data.put("multipleLocalNamespaces", false); - data.put("existingLocalNamespace", localNamespaces.keySet().iterator().next()); - } - //Get current internal class if it exists - data.put("existingInternalClass", retrieveCurrentInternalClass()); - } - //Place default namespace within data to pass back to template - String defaultNamespace = vreq.getWebappDaoFactory().getDefaultNamespace(); - data.put("defaultNamespace", defaultNamespace); - } - - - //Process submission on submitting form - private void processSubmission(VitroRequest vreq, Map data) { - //If new class, need to generate new class - String classUri = null; - if(isNewClassSubmission(vreq)){ - VClass v= generateNewVClass(vreq.getParameter("localClassName"), vreq.getParameter("existingLocalNamespaces")); - classUri = v.getURI(); - try { - vreq.getWebappDaoFactory().getVClassDao().insertNewVClass(v); - } catch(Exception ex) { - log.error("Insertion of new class " + vreq.getParameter("name") + " resulted in error ", ex); - } - } else { - //Existing class so get URI from that - classUri = getExistingClassUri(vreq); - } - //If existing class, need to simply add a statement specifying existing class is an internal class - if(classUri != null && !classUri.isEmpty()) { - Model writeModel = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS); - writeModel.enterCriticalSection(Lock.WRITE); - writeModel.notifyEvent(new EditEvent(null,true)); - try { - log.debug("Should be removing these statements " + writeModel.listStatements(null, - ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), - (RDFNode) null).toList().toString()); - //remove existing internal classes if there are any as assuming only one - writeModel.removeAll(null, - ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), - (RDFNode) null); - log.debug("Are there any statements left for internal class annotation: " + writeModel.listStatements(null, - ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), - (RDFNode) null).toList().toString()); - writeModel.add( - writeModel.createStatement( - ResourceFactory.createResource(classUri), - ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), - writeModel.createLiteral("true"))); - } catch(Exception ex) { - log.error("Error occurred in adding statement for " + classUri + " becoming internal class", ex); - } finally { - writeModel.notifyEvent(new EditEvent(null,true)); - writeModel.leaveCriticalSection(); - } - } - } - - private VClass generateNewVClass(String newClassName, String namespace) { - VClass newClass = new VClass(); - newClass.setName(newClassName); - newClass.setNamespace(namespace); - String uri = namespace + newClassName.replaceAll(" ", ""); - newClass.setURI(uri); - //How to g - return newClass; - } - - private boolean isNewClassSubmission(VitroRequest vreq) { - String localName = vreq.getParameter("localClassName"); - return (localName != null && !localName.isEmpty()); - } - - private String getExistingClassUri(VitroRequest vreq) { - return vreq.getParameter("existingLocalClasses"); - - } - - private RedirectResponseValues redirectToSiteAdmin() { - return new RedirectResponseValues(REDIRECT_PAGE, HttpServletResponse.SC_SEE_OTHER); - } - - //Get current internal class - private String retrieveCurrentInternalClass() { - String internalClassUri = ""; - Model mainModel = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS); - StmtIterator internalIt = mainModel.listStatements(null, - ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), - (RDFNode) null); - while(internalIt.hasNext()){ - Statement s = internalIt.nextStatement(); - //The class IS an internal class so the subject is what we're looking for - internalClassUri = s.getSubject().getURI(); - log.debug("Found internal class uri " + internalClassUri); - } - return internalClassUri; - } - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.controller.freemarker; + +import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSERTIONS; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.shared.Lock; + +import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; +import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; +import edu.cornell.mannlib.vitro.webapp.beans.VClass; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.edit.utils.LocalNamespaceClassUtils; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; +import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent; +import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; +/* + * Custom controller for menu management. This will be replaced later once N3 Editing + * has been successfully refactored and integrated with menu management. + */ +@WebServlet(name = "InstitutionalInternalClassController", urlPatterns = {"/processInstitutionalInternalClass"} ) +public class InstitutionalInternalClassController extends FreemarkerHttpServlet { + private static final Log log = LogFactory.getLog(InstitutionalInternalClassController.class); + + private static final String EDIT_FORM = "/processInstitutionalInternalClass"; + public final static AuthorizationRequest REQUIRED_ACTIONS = SimplePermission.MANAGE_MENUS.ACTION; + private static final String DISPLAY_FORM = "/institutionalInternalClassForm.ftl"; + private static HashMap localNamespaces = new HashMap(); + private static HashMap localNamespaceClasses = new HashMap(); + private static final String CREATE_CLASS_PARAM = "createClass"; + private static final String REDIRECT_PAGE = "/siteAdmin"; + @Override + protected AuthorizationRequest requiredActions(VitroRequest vreq) { + return REQUIRED_ACTIONS; + } + + @Override + protected ResponseValues processRequest(VitroRequest vreq) { + + //Based on existing of local namespaces and number of local classes present + //as well as command parameter, execute command + + Map data = new HashMap(); + //Get all local classes and namespace information + retrieveLocalClasses(vreq, data); + if(isSubmission(vreq)){ + processSubmission(vreq, data); + } else if(isCreateNewClass(vreq)) { + //Local namespace(s) exist and user wishes to create a new class + //Either cmd = create new or no local classes exist at all and one must be created + processCreateNewClass(vreq, data); + } else if(isSelectExistingClass(vreq)) { + //Local namespace(s) exist and user can select an existing class + processSelectExistingClass(vreq, data); + } else if(isCreateOntologies(vreq)) { + //Not being handled expliclity but message will display indicating + //no local namespaces exist and one must be created + processCreateOntologies(vreq, data); + } else { + log.error("Don't recognize the type of request."); + } + //Retrieve local namespaces + + + //Check if existing local namespaces + + data.put("formUrl", vreq.getContextPath() + EDIT_FORM); + data.put("cancelUrl", vreq.getContextPath() + REDIRECT_PAGE); + + //if no local namespaces, then provide message to display + //if existing namespace(s), then check + //if single namespace, retrieve all classes belonging to that local namespace + //if multiple namespaces, generate select list with namespaces + //for instertion: VClassDaoJena.insertVClass + // + if(isSubmission(vreq)){ + return redirectToSiteAdmin(); + } + return new TemplateResponseValues(DISPLAY_FORM, data); + + } + + private boolean isSubmission(VitroRequest vreq) { + String submit = vreq.getParameter("submitForm"); + return(submit!= null && !submit.isEmpty()); + } + + private void processCreateOntologies(VitroRequest vreq, Map data) { + data.put("submitAction", ""); + + } + + private boolean isCreateOntologies(VitroRequest vreq) { + //no local namespaces + return (localNamespaces.size() == 0); + + } + + private void processCreateNewClass(VitroRequest vreq, Map data) { + //this may need to be changed on the basis of how new classes interact with new ontologies + data.put("submitAction", "Create Class"); + data.put("createNewClass", true); + } + + private boolean isCreateNewClass(VitroRequest vreq) { + String command = vreq.getParameter("cmd"); + if(command != null && command.equals(CREATE_CLASS_PARAM)) { + return true; + } + //If local namespace exists but no classes in local namespaces, then need to enable creation of new classes + return(localNamespaces.size() > 0 && localNamespaceClasses.size() == 0); + } + + private void processSelectExistingClass(VitroRequest vreq, Map data) { + //Check if local classes exist and use for selection + data.put("useExistingLocalClass", true); + data.put("submitAction", "Save"); + } + + private boolean isSelectExistingClass(VitroRequest vreq) { + //Local namespaces exist and there are existing classes within those namespaces + return (localNamespaces.size() > 0 && localNamespaceClasses.size() > 0); + } + + + + private void retrieveLocalClasses(VitroRequest vreq, Map data) { + localNamespaces = LocalNamespaceClassUtils.getLocalOntologyNamespaces(vreq); + //Get classes for local namespaces + localNamespaceClasses = LocalNamespaceClassUtils.getLocalNamespacesClasses(vreq, localNamespaces); + data.put("existingLocalClasses", localNamespaceClasses); + data.put("existingLocalNamespaces", localNamespaces); + String noLocalOntologiesMessage = "There are currently no local ontologies. You must create a new ontology"; + data.put("noLocalOntologiesMessage", noLocalOntologiesMessage); + if(localNamespaces.size() == 0) { + data.put("ontologiesExist", false); + } + else { + data.put("ontologiesExist", true); + if(localNamespaces.size() > 1) { + data.put("multipleLocalNamespaces", true); + } else { + data.put("multipleLocalNamespaces", false); + data.put("existingLocalNamespace", localNamespaces.keySet().iterator().next()); + } + //Get current internal class if it exists + data.put("existingInternalClass", retrieveCurrentInternalClass()); + } + //Place default namespace within data to pass back to template + String defaultNamespace = vreq.getWebappDaoFactory().getDefaultNamespace(); + data.put("defaultNamespace", defaultNamespace); + } + + + //Process submission on submitting form + private void processSubmission(VitroRequest vreq, Map data) { + //If new class, need to generate new class + String classUri = null; + if(isNewClassSubmission(vreq)){ + VClass v= generateNewVClass(vreq.getParameter("localClassName"), vreq.getParameter("existingLocalNamespaces")); + classUri = v.getURI(); + try { + vreq.getWebappDaoFactory().getVClassDao().insertNewVClass(v); + } catch(Exception ex) { + log.error("Insertion of new class " + vreq.getParameter("name") + " resulted in error ", ex); + } + } else { + //Existing class so get URI from that + classUri = getExistingClassUri(vreq); + } + //If existing class, need to simply add a statement specifying existing class is an internal class + if(classUri != null && !classUri.isEmpty()) { + Model writeModel = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS); + writeModel.enterCriticalSection(Lock.WRITE); + writeModel.notifyEvent(new EditEvent(null,true)); + try { + log.debug("Should be removing these statements " + writeModel.listStatements(null, + ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), + (RDFNode) null).toList().toString()); + //remove existing internal classes if there are any as assuming only one + writeModel.removeAll(null, + ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), + (RDFNode) null); + log.debug("Are there any statements left for internal class annotation: " + writeModel.listStatements(null, + ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), + (RDFNode) null).toList().toString()); + writeModel.add( + writeModel.createStatement( + ResourceFactory.createResource(classUri), + ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), + writeModel.createLiteral("true"))); + } catch(Exception ex) { + log.error("Error occurred in adding statement for " + classUri + " becoming internal class", ex); + } finally { + writeModel.notifyEvent(new EditEvent(null,true)); + writeModel.leaveCriticalSection(); + } + } + } + + private VClass generateNewVClass(String newClassName, String namespace) { + VClass newClass = new VClass(); + newClass.setName(newClassName); + newClass.setNamespace(namespace); + String uri = namespace + newClassName.replaceAll(" ", ""); + newClass.setURI(uri); + //How to g + return newClass; + } + + private boolean isNewClassSubmission(VitroRequest vreq) { + String localName = vreq.getParameter("localClassName"); + return (localName != null && !localName.isEmpty()); + } + + private String getExistingClassUri(VitroRequest vreq) { + return vreq.getParameter("existingLocalClasses"); + + } + + private RedirectResponseValues redirectToSiteAdmin() { + return new RedirectResponseValues(REDIRECT_PAGE, HttpServletResponse.SC_SEE_OTHER); + } + + //Get current internal class + private String retrieveCurrentInternalClass() { + String internalClassUri = ""; + Model mainModel = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS); + StmtIterator internalIt = mainModel.listStatements(null, + ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), + (RDFNode) null); + while(internalIt.hasNext()){ + Statement s = internalIt.nextStatement(); + //The class IS an internal class so the subject is what we're looking for + internalClassUri = s.getSubject().getURI(); + log.debug("Found internal class uri " + internalClassUri); + } + return internalClassUri; + } + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java index 6a5024b0..fbb5b467 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManageGrantsForIndividualController.java @@ -32,7 +32,7 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet { private static final Log log = LogFactory.getLog(ManageGrantsForIndividualController.class.getName()); private static final String TEMPLATE_NAME = "manageGrantsForIndividual.ftl"; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { return SimplePermission.DO_FRONT_END_EDITING.ACTION; @@ -54,17 +54,17 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet { List allSubclasses = getAllSubclasses(grants); body.put("allSubclasses", allSubclasses); - + Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subjectUri); if( subject != null && subject.getName() != null ){ body.put("subjectName", subject.getName()); }else{ body.put("subjectName", null); } - + return new TemplateResponseValues(TEMPLATE_NAME, body); } - + private static String GRANT_QUERY = "" + "PREFIX core: \n" + "PREFIX rdfs: \n" @@ -87,12 +87,12 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet { + " ?activity a core:Project . \n" + " ?activity rdfs:label ?label2 . \n" + " } \n" - + " OPTIONAL { ?role core:hideFromDisplay ?hideThis } \n" + + " OPTIONAL { ?role core:hideFromDisplay ?hideThis } \n" + "} ORDER BY ?subclass ?label2"; - + HashMap>> getGrants(String subjectUri, VitroRequest vreq) { - VClassDao vcDao = vreq.getUnfilteredAssertionsWebappDaoFactory().getVClassDao(); - + VClassDao vcDao = vreq.getUnfilteredAssertionsWebappDaoFactory().getVClassDao(); + String queryStr = QueryUtils.subUriForQueryVar(GRANT_QUERY, "subject", subjectUri); log.debug("queryStr = " + queryStr); HashMap>> subclassToGrants = new HashMap>>(); @@ -109,13 +109,13 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet { subclassToGrants.put(subclass, new ArrayList>()); //list of grant information } List> grantsList = subclassToGrants.get(subclass); - grantsList.add(QueryUtils.querySolutionToStringValueMap(soln)); - } + grantsList.add(QueryUtils.querySolutionToStringValueMap(soln)); + } } } catch (Exception e) { log.error(e, e); - } - + } + return subclassToGrants; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java index dc68d76d..aad9f180 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePeopleForOrganizationController.java @@ -32,7 +32,7 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet private static final Log log = LogFactory.getLog(ManagePeopleForOrganizationController.class.getName()); private static final String TEMPLATE_NAME = "managePeopleForOrganization.ftl"; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { return SimplePermission.DO_FRONT_END_EDITING.ACTION; @@ -54,17 +54,17 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet List allSubclasses = getAllSubclasses(people); body.put("allSubclasses", allSubclasses); - + Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subjectUri); if( subject != null && subject.getName() != null ){ body.put("subjectName", subject.getName()); }else{ body.put("subjectName", null); } - + return new TemplateResponseValues(TEMPLATE_NAME, body); } - + private static String PEOPLE_QUERY = "" + "PREFIX core: \n" + "PREFIX rdfs: \n" @@ -88,8 +88,8 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet + " } \n " + " OPTIONAL { ?position core:hideFromDisplay ?hideThis } \n " + " FILTER ( !BOUND(?displayRank) || ?displayRank < 500 )" - + "} ORDER BY ?subclass ?name"; - + + "} ORDER BY ?subclass ?name"; + HashMap>> getPeople(String subjectUri, VitroRequest vreq) { VClassDao vcDao = vreq.getUnfilteredAssertionsWebappDaoFactory().getVClassDao(); @@ -106,7 +106,7 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet VClass vClass = vcDao.getVClassByURI(subclassUriStr); String subclass = ((vClass.getName() == null) ? subclassUriStr : vClass.getName()); if(!subclassToPeople.containsKey(subclass)) { - subclassToPeople.put(subclass, new ArrayList>()); + subclassToPeople.put(subclass, new ArrayList>()); } List> peopleList = subclassToPeople.get(subclass); peopleList.add(QueryUtils.querySolutionToStringValueMap(soln)); @@ -114,7 +114,7 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet } } catch (Exception e) { log.error(e, e); - } + } return subclassToPeople; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java index 6e003852..d1e6ff1c 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ManagePublicationsForIndividualController.java @@ -32,7 +32,7 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer private static final Log log = LogFactory.getLog(ManagePublicationsForIndividualController.class.getName()); private static final String TEMPLATE_NAME = "managePublicationsForIndividual.ftl"; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { return SimplePermission.DO_FRONT_END_EDITING.ACTION; @@ -54,17 +54,17 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer List allSubclasses = getAllSubclasses(publications); body.put("allSubclasses", allSubclasses); - + Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subjectUri); if( subject != null && subject.getName() != null ){ body.put("subjectName", subject.getName()); }else{ body.put("subjectName", null); } - + return new TemplateResponseValues(TEMPLATE_NAME, body); } - + private static String PUBLICATION_QUERY = "" + "PREFIX core: \n" + "PREFIX rdfs: \n" @@ -85,10 +85,10 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer + " ?pub a . \n" + " ?pub vitro:mostSpecificType ?subclass . \n" + " } \n" - + " } \n" + + " } \n" + " OPTIONAL { ?authorship core:hideFromDisplay ?hideThis } \n" + "} ORDER BY ?subclass ?title"; - + HashMap>> getPublications(String subjectUri, VitroRequest vreq) { VClassDao vcDao = vreq.getUnfilteredAssertionsWebappDaoFactory().getVClassDao(); @@ -118,8 +118,8 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer } } catch (Exception e) { log.error(e, e); - } - + } + return subclassToPublications; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/CsvFileHarvestJob.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/CsvFileHarvestJob.java index 6844dadb..e7fcb2ae 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/CsvFileHarvestJob.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/CsvFileHarvestJob.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller.harvester; +package edu.cornell.mannlib.vitro.webapp.controller.harvester; import java.io.BufferedReader; import java.io.File; @@ -69,7 +69,7 @@ class CsvFileHarvestJob implements FileHarvestJob { } return returnValue; } - + private JobType(String httpParameterName, String templateFileName, String scriptFileName, String xsltFileName, String friendlyName, String linkHeader, String noNewDataMessage, String[] rdfTypesForLinks) { this.httpParameterName = httpParameterName; this.templateFileName = templateFileName; @@ -80,13 +80,13 @@ class CsvFileHarvestJob implements FileHarvestJob { this.noNewDataMessage = noNewDataMessage; this.rdfTypesForLinks = Arrays.copyOf(rdfTypesForLinks, rdfTypesForLinks.length); } - + private CsvFileHarvestJob constructCsvFileHarvestJob(VitroRequest vreq, String namespace) { return new CsvFileHarvestJob(vreq, this.templateFileName, this.scriptFileName, this.xsltFileName, namespace, this.friendlyName, this.linkHeader, this.noNewDataMessage, this.rdfTypesForLinks); } } - + /** * Logger. */ @@ -139,17 +139,17 @@ class CsvFileHarvestJob implements FileHarvestJob { * An array of rdf:type values which will be used for links. */ private final String[] rdfTypesForLinks; - + /** * The session ID of this user session. */ private final String sessionId; - + public static CsvFileHarvestJob createJob(JobType jobType, VitroRequest vreq, String namespace) { return jobType.constructCsvFileHarvestJob(vreq, namespace); } - + /** * Constructor. * @param templateFileName just the name of the template file. The directory is assumed to be standard. @@ -164,7 +164,7 @@ class CsvFileHarvestJob implements FileHarvestJob { this.linkHeader = linkHeader; this.noNewDataMessage = noNewDataMessage; this.rdfTypesForLinks = Arrays.copyOf(rdfTypesForLinks, rdfTypesForLinks.length); - + this.sessionId = this.vreq.getSession().getId(); } @@ -189,27 +189,27 @@ class CsvFileHarvestJob implements FileHarvestJob { } - + private boolean[] getLinesEndingInComma(File file) throws IOException { ArrayList linesEndingInCommaList = new ArrayList(); - + BufferedReader reader = new BufferedReader(new FileReader(file)); - + for(String line = reader.readLine(); line != null; line = reader.readLine()) { boolean lineEndsInComma = line.endsWith(","); linesEndingInCommaList.add(lineEndsInComma); } reader.close(); - + boolean[] linesEndingInComma = new boolean[linesEndingInCommaList.size()]; for(int i = 0; i < linesEndingInComma.length; i++) { linesEndingInComma[i] = linesEndingInCommaList.get(i); } return linesEndingInComma; } - - - + + + @Override @SuppressWarnings("rawtypes") public String validateUpload(File file) { @@ -256,31 +256,31 @@ class CsvFileHarvestJob implements FileHarvestJob { } } -/* +/* private void prepareWorkspaceDirectory() { String path = FileHarvestController.getFileHarvestRootPath() + "workspaces/" + this.sessionId; File directory = new File(path); if(!directory.exists()) directory.mkdirs(); - + File scriptTemplate = this.scriptFile; String scriptTemplateContents = readFromFile(scriptTemplate); String scriptTemplateReplacements = performScriptTemplateReplacements(scriptTemplateContents); File outputScriptFile = new File(path + "/" + scriptTemplate.getName()); writeToFile(outputScriptFile, scriptTemplateReplacements); - + File xsltTemplate = this.xsltFile; String xsltTemplateContents = readFromFile(xsltTemplate); String xsltTemplateReplacements = performXsltTemplateReplacements(xsltTemplateContents); File outputXsltFile = new File(path + "/" + xsltTemplate.getName()); writeToFile(outputXsltFile, xsltTemplateReplacements); - + } -*/ - - - - +*/ + + + + @Override public String getScript() { @@ -302,7 +302,7 @@ class CsvFileHarvestJob implements FileHarvestJob { if(harvestedDataPath.endsWith("/")) harvestedDataPath = harvestedDataPath.substring(0, harvestedDataPath.length() - 1); - + replacements = replacements.replace("${WORKING_DIRECTORY}", workingDirectory); replacements = replacements.replace("${UPLOADS_FOLDER}", fileDirectory); replacements = replacements.replace("${HARVESTED_DATA_PATH}", harvestedDataPath); @@ -314,13 +314,13 @@ class CsvFileHarvestJob implements FileHarvestJob { /* private String performXsltTemplateReplacements(String xsltTemplateContents) { String replacements = xsltTemplateContents; - + replacements = replacements.replace("", ""); return replacements; } - + private void writeToFile(File file, String contents) { PrintWriter writer = null; try { @@ -333,7 +333,7 @@ class CsvFileHarvestJob implements FileHarvestJob { writer.close(); } } -*/ +*/ private String readFromFile(File file) { String contents = null; @@ -407,7 +407,7 @@ class CsvFileHarvestJob implements FileHarvestJob { public String getNoNewDataMessage() { return this.noNewDataMessage; } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestController.java index f45d5ad5..e58b2855 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestController.java @@ -54,7 +54,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { private static final String TEMPLATE_DEFAULT = "fileharvest.ftl"; private static final String NORMAL_TERMINATION_LAST_OUTPUT = "File Harvest completed successfully"; - + private static final String PARAMETER_FIRST_UPLOAD = "firstUpload"; private static final String PARAMETER_UPLOADED_FILE = "uploadedFile"; private static final String PARAMETER_MODE = "mode"; @@ -191,7 +191,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { */ public static String getHarvesterPath(HttpServletRequest req) { - String pathToHarvester = ConfigurationProperties.getBean(req).getProperty("harvester.location"); + String pathToHarvester = ConfigurationProperties.getBean(req).getProperty("harvester.location"); if (pathToHarvester == null) { log.error("The runtime.properties file does not contain a value for 'harvester.location'"); return ""; @@ -217,7 +217,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { */ private static String getUploadPathBase(ServletContext context) throws Exception { - String vitroHomeDirectoryName = ApplicationUtils.instance().getHomeDirectory().getPath().toString(); + String vitroHomeDirectoryName = ApplicationUtils.instance().getHomeDirectory().getPath().toString(); return vitroHomeDirectoryName + "/" + FileStorageImplWrapper.FILE_STORAGE_SUBDIRECTORY + "/" + PATH_TO_UPLOADS; } @@ -419,7 +419,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { json = generateJson(true); log.error(e, e); } - + try { response.getWriter().write(json.toString()); } catch(IOException e) { @@ -477,8 +477,8 @@ public class FileHarvestController extends FreemarkerHttpServlet { //remove all entries in "sessionIdTo..." mappings for this session ID clearSessionInfo(sessionId); - - if(sessionInfo.getAbnormalTermination()) + + if(sessionInfo.getAbnormalTermination()) abnormalTermination = true; } @@ -500,7 +500,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { json = generateJson(true); log.error(e, e); } - + try { response.getWriter().write(json.toString()); } catch(IOException e) { @@ -543,9 +543,9 @@ public class FileHarvestController extends FreemarkerHttpServlet { private static String getScriptFileLocation(HttpServletRequest req) { return getHarvesterPath(req) + PATH_TO_HARVESTER_SCRIPTS + "temp/"; } - - - + + + private File createScriptFile(String scriptFileLocation, String script) throws IOException { File scriptDirectory = new File(scriptFileLocation); if(!scriptDirectory.exists()) { @@ -631,7 +631,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { Node node = descriptionNodes.item(i); ArrayList types = getRdfTypes(node); - + boolean match = false; String[] validRdfTypesForJob = job.getRdfTypesForLinks(); for(String rdfType : validRdfTypesForJob) { @@ -640,7 +640,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { break; } } - + if(match) { NamedNodeMap attributes = node.getAttributes(); @@ -795,7 +795,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { public boolean getAbnormalTermination() { return abnormalTermination; } - + public void finish() { finished = true; } @@ -833,7 +833,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { this.sessionId = sessionId; this.script = script; this.additionsFilePath = additionsFilePath; - this.scriptFileLocation = scriptFileLocation; + this.scriptFileLocation = scriptFileLocation; this.job = job; } @@ -863,7 +863,7 @@ public class FileHarvestController extends FreemarkerHttpServlet { for(String line = processOutputReader.readLine(); line != null; line = processOutputReader.readLine()) { normalTerminationLineFound = line.endsWith(NORMAL_TERMINATION_LAST_OUTPUT); //set every read to ensure it's the last line - + //don't add stuff to this list if the main thread is running a "transaction" of copying out the data to send to client and then clearing the list synchronized(unsentLogLines) { unsentLogLines.add(line); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestJob.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestJob.java index d1c08b34..26a2457e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestJob.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/FileHarvestJob.java @@ -1,12 +1,12 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller.harvester; +package edu.cornell.mannlib.vitro.webapp.controller.harvester; import java.io.File; /** - * Handles specifics of a file harvest. + * Handles specifics of a file harvest. * @author mbarbieri * */ @@ -26,7 +26,7 @@ interface FileHarvestJob { String getTemplateFilePath(); /** - * Gets the console script which can be used to run the harvest job. + * Gets the console script which can be used to run the harvest job. * @return the console script which can be used to run the harvest job */ String getScript(); @@ -44,30 +44,30 @@ interface FileHarvestJob { String getPageHeader(); /** - * A heading to be shown above the area where links to profiles of newly-harvested entities are listed. + * A heading to be shown above the area where links to profiles of newly-harvested entities are listed. * @return a heading to be shown above the area where links to profiles of newly-harvested entities are listed */ String getLinkHeader(); - + /** * Get an array of fully-qualified rdf:type values. When the harvest run is complete, any new entities which have an rdf:type represented - * in this array will have a link displayed on the page allowing the user to visit the new profile. + * in this array will have a link displayed on the page allowing the user to visit the new profile. * @return an array of types to be used in links */ String[] getRdfTypesForLinks(); - + /** * Get the HTML to be shown on the page immediately next to the "Download" button for the template. * @return the HTML to be shown on the page immediately next to the "Download" button for the template. */ String getTemplateDownloadHelp(); - + /** * Get the HTML to be shown in the collapsible "Help" area in the "Fill in data" section of the page. * @return the HTML to be shown in the collapsible "Help" area in the "Fill in data" section of the page. */ String getTemplateFillInHelp(); - + /** * Get the message to show to the user if there are no newly-harvested entities to show them. * @return the message to show to the user if there are no newly-harvested entities to show them diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/Harvester.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/Harvester.java index e0e4b44a..37c96e4c 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/Harvester.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/harvester/Harvester.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller.harvester; +package edu.cornell.mannlib.vitro.webapp.controller.harvester; import java.util.ArrayList; import java.util.Collections; @@ -47,7 +47,7 @@ import org.vivoweb.harvester.util.XPathTool; * but that was troublesome for a few reasons, the most important being related to the simple fact that the * Harvester was designed to be used as a collection of command-line tools, and thus we have, for example, the * versatility of Score which would be very difficult to replicate without essentially allowing the user to - * pass in a string to be parsed, which would defeat the purpose. + * pass in a string to be parsed, which would defeat the purpose. * * @author mbarbieri * @@ -81,7 +81,7 @@ class Harvester { public static void runPubmedHTTPFetch(Object ... args) { PubmedHTTPFetch.main(stringsToArray(args)); } - + // qualify public static void runChangeNamespace(Object ... args) { ChangeNamespace.main(stringsToArray(args)); @@ -101,7 +101,7 @@ class Harvester { public static void runSplitProperty(Object ... args) { SplitProperty.main(stringsToArray(args)); } - + // score public static void runMatch(Object ... args) { Match.main(stringsToArray(args)); @@ -112,12 +112,12 @@ class Harvester { public static void runScore(Object ... args) { Score.main(stringsToArray(args)); } - + // transfer public static void runTransfer(Object ... args) { Transfer.main(stringsToArray(args)); } - + // translate public static void runGlozeTranslator(Object ... args) { GlozeTranslator.main(stringsToArray(args)); @@ -153,21 +153,21 @@ class Harvester { /** * Convenience method to expand the ability to use Java's "..." arg list. Harvester scripts frequently declare sub-macros, * so for example you might have: - * + * * SCOREINPUT="-i $H2MODEL -ImodelName=$MODELNAME -IdbUrl=$MODELDBURL -IcheckEmpty=$CHECKEMPTY" * SCOREDATA="-s $H2MODEL -SmodelName=$SCOREDATANAME -SdbUrl=$SCOREDATADBURL -ScheckEmpty=$CHECKEMPTY" * SCOREMODELS="$SCOREINPUT -v $VIVOCONFIG -VcheckEmpty=$CHECKEMPTY $SCOREDATA -t $TEMPCOPYDIR -b $SCOREBATCHSIZE" * $Score $SCOREMODELS -AGrantNumber=$EQTEST -WGrantNumber=1.0 -FGrantNumber=$GRANTIDNUM -PGrantNumber=$GRANTIDNUM -n ${BASEURI}grant/ - * + * * In order to mimic this functionality for easy use in Java, this method has been created. It takes a "..." arg list of Object * objects, and returns an array of Strings. For each object, if it's an array of Strings, each String is added to the output * array. Otherwise, its toString() method is called and that value is added to the output array. - * - * It is intended to be used with a combination of String and String[] values, in any arbitrary order. - * + * + * It is intended to be used with a combination of String and String[] values, in any arbitrary order. + * * All static Harvester methods in this class take an Object arg list rather than a String arg list, and automatically call * this method. - * + * * @param args an array of objects, which ought to be a combination of String and String[] values, in any arbitrary order * @return all the strings put together as one array */ diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/AjaxVisualizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/AjaxVisualizationController.java index cf56ac93..3c09301d 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/AjaxVisualizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/AjaxVisualizationController.java @@ -40,73 +40,73 @@ public class AjaxVisualizationController extends FreemarkerHttpServlet { public static final String URL_ENCODING_SCHEME = "UTF-8"; private static final Log log = LogFactory.getLog(AjaxVisualizationController.class.getName()); - + protected static final Syntax SYNTAX = Syntax.syntaxARQ; - + public static ServletContext servletContext; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { - + /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + if (visRequestHandler != null) { - + AuthorizationRequest requiredPrivileges = visRequestHandler.getRequiredPrivileges(); if (requiredPrivileges != null) { return requiredPrivileges; } } - + return super.requiredActions(vreq); } - + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - + VitroRequest vreq = new VitroRequest(request); - + Object ajaxResponse = processAjaxRequest(vreq); - + if (ajaxResponse instanceof TemplateResponseValues) { - + TemplateResponseValues trv = (TemplateResponseValues) ajaxResponse; try { writeTemplate(trv.getTemplateName(), trv.getMap(), vreq, response); } catch (TemplateProcessingException e) { log.error(e.getMessage(), e); } - + } else { response.getWriter().write(ajaxResponse.toString()); } } - + private Object processAjaxRequest(VitroRequest vreq) { /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + if (visRequestHandler != null) { - + /* - * Pass the query to the selected visualization request handler & render the - * visualization. Since the visualization content is directly added to the response + * Pass the query to the selected visualization request handler & render the + * visualization. Since the visualization content is directly added to the response * object we are side-effecting this method. * */ return renderVisualization(vreq, visRequestHandler); - + } else { - + return UtilityFunctions.handleMalformedParameters( "Visualization Query Error", "Inappropriate query parameters were submitted.", @@ -117,70 +117,70 @@ public class AjaxVisualizationController extends FreemarkerHttpServlet { private Object renderVisualization(VitroRequest vitroRequest, VisualizationRequestHandler visRequestHandler) { - + Model model = vitroRequest.getJenaOntModel(); // getModel() if (model == null) { - - String errorMessage = "This service is not supporeted by the current " - + "webapp configuration. A jena model is required in the " + + String errorMessage = "This service is not supporeted by the current " + + "webapp configuration. A jena model is required in the " + "servlet context."; log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); - + } - + Dataset dataset = setupJENADataSource(vitroRequest); - + if (dataset != null && visRequestHandler != null) { - + try { - return visRequestHandler.generateAjaxVisualization(vitroRequest, - log, + return visRequestHandler.generateAjaxVisualization(vitroRequest, + log, dataset); } catch (JsonProcessingException|MalformedQueryParametersException e) { return UtilityFunctions.handleMalformedParameters( - "Ajax Visualization Query Error - Individual Publication Count", - e.getMessage(), + "Ajax Visualization Query Error - Individual Publication Count", + e.getMessage(), vitroRequest); - + } - + } else { - - String errorMessage = "Data Model Empty &/or Inappropriate " + + String errorMessage = "Data Model Empty &/or Inappropriate " + "query parameters were submitted. "; - + log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); - - + + } } private VisualizationRequestHandler getVisualizationRequestHandler( VitroRequest vitroRequest) { - + String visType = vitroRequest.getParameter(VisualizationFrameworkConstants .VIS_TYPE_KEY); VisualizationRequestHandler visRequestHandler = null; - + try { visRequestHandler = VisualizationsDependencyInjector .getVisualizationIDsToClassMap( getServletContext()).get(visType); - + } catch (NullPointerException nullKeyException) { return null; } - + return visRequestHandler; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/DataVisualizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/DataVisualizationController.java index bd5d4d03..8d051654 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/DataVisualizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/DataVisualizationController.java @@ -38,55 +38,55 @@ public class DataVisualizationController extends VitroHttpServlet { public static final String URL_ENCODING_SCHEME = "UTF-8"; private static final Log log = LogFactory.getLog(DataVisualizationController.class.getName()); - + protected static final Syntax SYNTAX = Syntax.syntaxARQ; - + public static final String FILE_CONTENT_TYPE_KEY = "fileContentType"; public static final String FILE_CONTENT_KEY = "fileContent"; public static final String FILE_NAME_KEY = "fileName"; - + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - + VitroRequest vreq = new VitroRequest(request); - + /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - - + + if (visRequestHandler != null) { - + if (visRequestHandler.getRequiredPrivileges() != null) { if (!isAuthorizedToDisplayPage(request, response, visRequestHandler.getRequiredPrivileges())) { return; } } - + /* * Pass the query to the selected visualization request handler & render the vis. * Since the visualization content is directly added to the response object we are side- * effecting this method. * */ try { - + Map dataResponse = renderVisualization(vreq, visRequestHandler); - + response.setContentType(dataResponse.get(FILE_CONTENT_TYPE_KEY)); - + if (dataResponse.containsKey(FILE_NAME_KEY)) { - response.setHeader("Content-Disposition", + response.setHeader("Content-Disposition", "attachment;filename=" + dataResponse.get(FILE_NAME_KEY)); } - + response.getWriter().write(dataResponse.get(FILE_CONTENT_KEY)); - + return; - + } catch (MalformedQueryParametersException e) { UtilityFunctions.handleMalformedParameters(e.getMessage(), @@ -95,37 +95,37 @@ public class DataVisualizationController extends VitroHttpServlet { } } else { - + UtilityFunctions.handleMalformedParameters( "Inappropriate query parameters were submitted.", response, log); - + } - - + + } private Map renderVisualization( VitroRequest vitroRequest, - VisualizationRequestHandler visRequestHandler) + VisualizationRequestHandler visRequestHandler) throws MalformedQueryParametersException { - + Model model = vitroRequest.getJenaOntModel(); // getModel() if (model == null) { - - String errorMessage = "This service is not supporeted by the current " - + "webapp configuration. A jena model is required in the " + + String errorMessage = "This service is not supporeted by the current " + + "webapp configuration. A jena model is required in the " + "servlet context."; log.error(errorMessage); - + throw new MalformedQueryParametersException(errorMessage); } - + Dataset dataset = setupJENADataSource(vitroRequest); - + if (dataset != null && visRequestHandler != null) { try { return visRequestHandler.generateDataVisualization(vitroRequest, @@ -134,7 +134,7 @@ public class DataVisualizationController extends VitroHttpServlet { } catch (JsonProcessingException e) { } } - + String errorMessage = "Data Model Empty &/or Inappropriate " + "query parameters were submitted. "; @@ -143,21 +143,21 @@ public class DataVisualizationController extends VitroHttpServlet { private VisualizationRequestHandler getVisualizationRequestHandler( VitroRequest vitroRequest) { - + String visType = vitroRequest.getParameter(VisualizationFrameworkConstants .VIS_TYPE_KEY); VisualizationRequestHandler visRequestHandler = null; - + try { - + visRequestHandler = VisualizationsDependencyInjector .getVisualizationIDsToClassMap(getServletContext()) .get(visType); - + } catch (NullPointerException nullKeyException) { return null; } - + return visRequestHandler; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/ShortURLVisualizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/ShortURLVisualizationController.java index 32ff3f9e..af028535 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/ShortURLVisualizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/ShortURLVisualizationController.java @@ -29,7 +29,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; /** - * Services a standard visualization request, which involves templates. This will return a simple + * Services a standard visualization request, which involves templates. This will return a simple * error message and a 501 if there is no jena Model. * * @author cdtank @@ -41,22 +41,22 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet { public static final String URL_ENCODING_SCHEME = "UTF-8"; private static final Log log = LogFactory.getLog(ShortURLVisualizationController.class.getName()); - + protected static final Syntax SYNTAX = Syntax.syntaxARQ; - + public static ServletContext servletContext; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + if (visRequestHandler != null) { - + AuthorizationRequest requiredPrivileges = visRequestHandler.getRequiredPrivileges(); if (requiredPrivileges != null) { return requiredPrivileges; @@ -64,161 +64,161 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet { } return super.requiredActions(vreq); } - + @Override protected ResponseValues processRequest(VitroRequest vreq) { - + /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + servletContext = getServletContext(); - + if (visRequestHandler != null) { - + /* * Pass the query to the selected visualization request handler & render the vis. * Since the visualization content is directly added to the response object we are side- * effecting this method. * */ return renderVisualization(vreq, visRequestHandler); - + } else { return UtilityFunctions.handleMalformedParameters( - "Visualization Query Error", - "Inappropriate query parameters were submitted.", + "Visualization Query Error", + "Inappropriate query parameters were submitted.", vreq); } - + } private ResponseValues renderVisualization(VitroRequest vitroRequest, VisualizationRequestHandler visRequestHandler) { - + Model model = vitroRequest.getJenaOntModel(); // getModel() if (model == null) { - - String errorMessage = "This service is not supporeted by the current " - + "webapp configuration. A jena model is required in the " + + String errorMessage = "This service is not supporeted by the current " + + "webapp configuration. A jena model is required in the " + "servlet context."; log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); } - + Dataset dataset = setupJENADataSource(vitroRequest); - + if (dataset != null && visRequestHandler != null) { - + try { List matchedPatternGroups = extractShortURLParameters(vitroRequest); - + Map parametersForVis = getParamatersForVis(matchedPatternGroups, vitroRequest); - + return visRequestHandler.generateVisualizationForShortURLRequests( parametersForVis, vitroRequest, log, dataset); - + } catch (MalformedQueryParametersException e) { return UtilityFunctions.handleMalformedParameters( - "Standard Visualization Query Error - Individual Publication Count", - e.getMessage(), + "Standard Visualization Query Error - Individual Publication Count", + e.getMessage(), vitroRequest); } - + } else { - - String errorMessage = "Data Model Empty &/or Inappropriate " + + String errorMessage = "Data Model Empty &/or Inappropriate " + "query parameters were submitted. "; - + log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); } } - private Map getParamatersForVis(List matchedPatternGroups, + private Map getParamatersForVis(List matchedPatternGroups, VitroRequest vitroRequest) { - + Map parameters = new HashMap(); - + /* - * We need to convert the short-form URI into a long form. So we use the - * default namespace to construct one. - * Since VIVO allows non-default namespaces, there are chances that short URLs + * We need to convert the short-form URI into a long form. So we use the + * default namespace to construct one. + * Since VIVO allows non-default namespaces, there are chances that short URLs * will have a "uri" parameter instead of individual uri being part of the formal * url. * */ String subjectURI = null; if (matchedPatternGroups.size() <= 1) { - + subjectURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); - + } else { - - subjectURI = vitroRequest.getWebappDaoFactory().getDefaultNamespace() + + subjectURI = vitroRequest.getWebappDaoFactory().getDefaultNamespace() + matchedPatternGroups.get(1); } - + subjectURI = StringEscapeUtils.ESCAPE_HTML4.translate(subjectURI); parameters.put(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, subjectURI); if (VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL .equalsIgnoreCase(matchedPatternGroups.get(0))) { - - parameters.put(VisualizationFrameworkConstants.VIS_MODE_KEY, + + parameters.put(VisualizationFrameworkConstants.VIS_MODE_KEY, VisualizationFrameworkConstants.COAUTHOR_VIS_MODE); - + } else if (VisualizationFrameworkConstants.COINVESTIGATOR_VIS_SHORT_URL .equalsIgnoreCase(matchedPatternGroups.get(0))) { - - parameters.put(VisualizationFrameworkConstants.VIS_MODE_KEY, + + parameters.put(VisualizationFrameworkConstants.VIS_MODE_KEY, VisualizationFrameworkConstants.COPI_VIS_MODE); } else { - + /* - * Currently temporal vis for both grants & publications do not require use of - * vis_modes in their request handlers, so no need to provide anything other than + * Currently temporal vis for both grants & publications do not require use of + * vis_modes in their request handlers, so no need to provide anything other than * the URI. * */ - + } - + return parameters; } private VisualizationRequestHandler getVisualizationRequestHandler( VitroRequest vitroRequest) { - + String visType = null; - + VisualizationRequestHandler visRequestHandler = null; - + List matchedPatternGroups = extractShortURLParameters(vitroRequest); if (matchedPatternGroups.size() > 0) { - + // System.out.println(matchedPatternGroups.get(0) + " --> " + matchedPatternGroups.get(1)); -// -// System.out.println(vitroRequest.getRequestURI() +// +// System.out.println(vitroRequest.getRequestURI() // + " -- " + vitroRequest.getContextPath() // + " -- " + vitroRequest.getContextPath().length() // + " -- " + vitroRequest.getRequestURI().substring(vitroRequest.getContextPath().length())); - + visType = matchedPatternGroups.get(0); - + try { visRequestHandler = VisualizationsDependencyInjector .getVisualizationIDsToClassMap(getServletContext()) @@ -228,9 +228,9 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet { * Let the default flow take care of returning a null. * */ } - + } - + return visRequestHandler; } @@ -244,15 +244,15 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet { */ private List extractShortURLParameters(VitroRequest vitroRequest) { - List matchedGroups = new ArrayList(); + List matchedGroups = new ArrayList(); String subURIString = vitroRequest.getRequestURI().substring(vitroRequest.getContextPath().length()+1); String[] urlParams = StringEscapeUtils.ESCAPE_HTML4.translate(subURIString).split("/"); - - if (urlParams.length > 1 + + if (urlParams.length > 1 && urlParams[0].equalsIgnoreCase("vis")) { matchedGroups.addAll(Arrays.asList(urlParams).subList(1, urlParams.length)); } - + return matchedGroups; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/StandardVisualizationController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/StandardVisualizationController.java index eec09bc6..7f061287 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/StandardVisualizationController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/StandardVisualizationController.java @@ -22,7 +22,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; /** - * Services a standard visualization request, which involves templates. This will return a simple + * Services a standard visualization request, which involves templates. This will return a simple * error message and a 501 if there is no jena Model. * * @author cdtank @@ -34,22 +34,22 @@ public class StandardVisualizationController extends FreemarkerHttpServlet { public static final String URL_ENCODING_SCHEME = "UTF-8"; private static final Log log = LogFactory.getLog(StandardVisualizationController.class.getName()); - + protected static final Syntax SYNTAX = Syntax.syntaxARQ; - + public static ServletContext servletContext; - + @Override protected AuthorizationRequest requiredActions(VitroRequest vreq) { /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + if (visRequestHandler != null) { - + AuthorizationRequest requiredPrivileges = visRequestHandler.getRequiredPrivileges(); if (requiredPrivileges != null) { return requiredPrivileges; @@ -57,93 +57,93 @@ public class StandardVisualizationController extends FreemarkerHttpServlet { } return super.requiredActions(vreq); } - + @Override protected ResponseValues processRequest(VitroRequest vreq) { /* - * Based on the query parameters passed via URI get the appropriate visualization + * Based on the query parameters passed via URI get the appropriate visualization * request handler. * */ - VisualizationRequestHandler visRequestHandler = + VisualizationRequestHandler visRequestHandler = getVisualizationRequestHandler(vreq); - + servletContext = getServletContext(); - + if (visRequestHandler != null) { - + /* * Pass the query to the selected visualization request handler & render the vis. * Since the visualization content is directly added to the response object we are side- * effecting this method. * */ return renderVisualization(vreq, visRequestHandler); - + } else { return UtilityFunctions.handleMalformedParameters( - "Visualization Query Error", - "Inappropriate query parameters were submitted.", + "Visualization Query Error", + "Inappropriate query parameters were submitted.", vreq); } - + } private ResponseValues renderVisualization(VitroRequest vitroRequest, VisualizationRequestHandler visRequestHandler) { - + Model model = vitroRequest.getJenaOntModel(); // getModel() if (model == null) { - - String errorMessage = "This service is not supporeted by the current " - + "webapp configuration. A jena model is required in the " + + String errorMessage = "This service is not supporeted by the current " + + "webapp configuration. A jena model is required in the " + "servlet context."; log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); - + } - + Dataset dataset = setupJENADataSource(vitroRequest); - + if (dataset != null && visRequestHandler != null) { - + try { - return visRequestHandler.generateStandardVisualization(vitroRequest, - log, + return visRequestHandler.generateStandardVisualization(vitroRequest, + log, dataset); } catch (MalformedQueryParametersException e) { return UtilityFunctions.handleMalformedParameters( - "Standard Visualization Query Error - Individual Publication Count", - e.getMessage(), + "Standard Visualization Query Error - Individual Publication Count", + e.getMessage(), vitroRequest); } - + } else { - - String errorMessage = "Data Model Empty &/or Inappropriate " + + String errorMessage = "Data Model Empty &/or Inappropriate " + "query parameters were submitted. "; - + log.error(errorMessage); - - return UtilityFunctions.handleMalformedParameters("Visualization Query Error", - errorMessage, + + return UtilityFunctions.handleMalformedParameters("Visualization Query Error", + errorMessage, vitroRequest); - - + + } } private VisualizationRequestHandler getVisualizationRequestHandler( VitroRequest vitroRequest) { - + String visType = vitroRequest.getParameter(VisualizationFrameworkConstants .VIS_TYPE_KEY); VisualizationRequestHandler visRequestHandler = null; - - + + try { visRequestHandler = VisualizationsDependencyInjector .getVisualizationIDsToClassMap(getServletContext()) @@ -152,7 +152,7 @@ public class StandardVisualizationController extends FreemarkerHttpServlet { return null; } - + return visRequestHandler; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationFrameworkConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationFrameworkConstants.java index 9c100798..30b31430 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationFrameworkConstants.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationFrameworkConstants.java @@ -1,141 +1,141 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.controller.visualization; - -import java.util.regex.Pattern; - -public class VisualizationFrameworkConstants { - - /* - * Contains the location of bean containing info on all the visualizations - * available in that instance. Currently it is stored under - * "productMods/WEB-INF..." - */ - public static final String RELATIVE_LOCATION_OF_VISUALIZATIONS_BEAN = - "/WEB-INF/visualization/visualizations-beans-injection.xml"; - - /* - * Freemarker Version - * */ - public static final String RELATIVE_LOCATION_OF_FM_VISUALIZATIONS_BEAN = - "/WEB-INF/visualization/visualizations-beans-injection-fm.xml"; - - public static final String ERROR_TEMPLATE = "/visualization/visualizationError.ftl"; - - /* - * Vis URL prefix that is seen by all the users - */ - public static final String VISUALIZATION_URL_PREFIX = "/visualization"; - public static final String SHORT_URL_VISUALIZATION_REQUEST_PREFIX = "/vis"; - - public static final String FREEMARKERIZED_VISUALIZATION_URL_PREFIX = "/visualization"; - public static final String AJAX_VISUALIZATION_SERVICE_URL_PREFIX = "/visualizationAjax"; - public static final String DATA_VISUALIZATION_SERVICE_URL_PREFIX = "/visualizationData"; - - public static final String INDIVIDUAL_URL_PREFIX = "/individual"; - - - public static final Pattern SHORT_URL_REQUEST_PATTERN = Pattern - .compile("^" - + SHORT_URL_VISUALIZATION_REQUEST_PREFIX - + "/([\\w-]+)/([^/]*)$"); - - - /* - * These represent possible query keys in a URI for visualization purposes. - * Examples, - * 1. http://vivo.indiana.edu/visualization?uri=http://vivoweb.org/ontology/core/Person10979&vis=person_level&render_mode=standalone - * 2. http://vivo.indiana.edu/visualization?uri=http://vivoweb.org/ontology/core/Person72&vis=person_pub_count&render_mode=dynamic&container=vis_container - * */ - public static final String VIS_TYPE_KEY = "vis"; - public static final String VIS_CONTAINER_KEY = "container"; - public static final String INDIVIDUAL_URI_KEY = "uri"; - public static final String VIS_MODE_KEY = "vis_mode"; - public static final String RENDER_MODE_KEY = "render_mode"; - public static final String OUTPUT_FORMAT_KEY = "output"; - public static final String REQUESTING_TEMPLATE_KEY = "template"; /* tlw72 - added in 1.6 for multi-view support */ - - /* - * These values represent possible render modes. - * */ - public static final String STANDALONE_RENDER_MODE = "standalone"; - public static final String DYNAMIC_RENDER_MODE = "dynamic"; - public static final String DATA_RENDER_MODE = "data"; - public static final String PDF_RENDER_MODE = "pdf"; - - /* - * These values represent possible sub-vis modes. - * */ - public static final String IMAGE_VIS_MODE = "image"; - public static final String SHORT_SPARKLINE_VIS_MODE = "short"; - public static final String FULL_SPARKLINE_VIS_MODE = "full"; - public static final String COPI_VIS_MODE = "copi"; - public static final String COAUTHOR_VIS_MODE = "coauthor"; - - /* - * Vis modes for CoauthorshipRequest Handler - * */ - public static final String COAUTHORS_COUNT_PER_YEAR_VIS_MODE = "coauthors_count_per_year"; - public static final String COAUTHORS_LIST_VIS_MODE = "coauthors"; - public static final String COAUTHOR_NETWORK_STREAM_VIS_MODE = "coauthor_network_stream"; - public static final String COAUTHOR_NETWORK_DOWNLOAD_VIS_MODE = "coauthor_network_download"; - - /* - * Vis modes for CoPIRequest Handler - * */ - public static final String COPIS_COUNT_PER_YEAR_VIS_MODE = "copis_count_per_year"; - public static final String COPIS_LIST_VIS_MODE = "copis"; - public static final String COPI_NETWORK_STREAM_VIS_MODE = "copi_network_stream"; - public static final String COPI_NETWORK_DOWNLOAD_VIS_MODE = "copi_network_download"; - - - /* - * Vis modes for Map of Science Handler - * */ - public static final String DISCIPLINE_TO_ACTIVTY_VIS_MODE = "discipline"; - public static final String SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE = "subdiscipline"; - public static final String SCIENCE_UNLOCATED_JOURNALS_VIS_MODE = "unlocated_journals"; - - - /* - * These values represent possible utilities vis modes. - * */ - public static final String PROFILE_INFO_UTILS_VIS_MODE = "PROFILE_INFO"; - public static final String PROFILE_UTILS_VIS_MODE = "PROFILE_URL"; - public static final String COAUTHOR_UTILS_VIS_MODE = "COAUTHORSHIP_URL"; - public static final String PERSON_LEVEL_UTILS_VIS_MODE = "PERSON_LEVEL_URL"; - public static final String COPI_UTILS_VIS_MODE = "COPI_URL"; - public static final String IMAGE_UTILS_VIS_MODE = "IMAGE_URL"; - public static final String ARE_PUBLICATIONS_AVAILABLE_UTILS_VIS_MODE = "SHOW_AUTHORSHIP_LINK"; - public static final String ARE_GRANTS_AVAILABLE_UTILS_VIS_MODE = "SHOW_GRANTS_LINK"; - public static final String UNIVERSITY_COMPARISON_VIS_MODE = "UNIVERSITY"; - public static final String SCHOOL_COMPARISON_VIS_MODE = "SCHOOL"; - public static final String DEPARTMENT_COMPARISON_VIS_MODE = "DEPARTMENT"; - public static final String HIGHEST_LEVEL_ORGANIZATION_VIS_MODE = "HIGHEST_LEVEL_ORGANIZATION"; - - /* - * These values represent possible visualizations provided as values to the "vis" url key. - * */ - public static final String PERSON_PUBLICATION_COUNT_VIS = "person_pub_count"; - public static final String PERSON_GRANT_COUNT_VIS = "person_grant_count"; - public static final String PDF_REPORT_VIS = "pdf_report"; - public static final String COLLEGE_PUBLICATION_COUNT_VIS = "college_pub_count"; - public static final String COAUTHORSHIP_VIS = "coauthorship"; - public static final String PERSON_LEVEL_VIS = "person_level"; - public static final String COAUTHORSHIP_VIS_SHORT_URL = "author-network"; - public static final String COINVESTIGATOR_VIS_SHORT_URL = "investigator-network"; - public static final String UTILITIES_VIS = "utilities"; - public static final String ENTITY_COMPARISON_VIS = "entity_comparison"; - public static final String PUBLICATION_TEMPORAL_VIS_SHORT_URL = "publication-graph"; - public static final String MAP_OF_SCIENCE_VIS_SHORT_URL = "map-of-science"; - public static final String GRANT_TEMPORAL_VIS_SHORT_URL = "grant-graph"; - public static final String CO_PI_VIS = "coprincipalinvestigator"; - - - /* - * These values represent possible data serialization formats corresponding to - * output format key. - * */ - public static final String JSON_OUTPUT_FORMAT = "json"; - public static final String CSV_OUTPUT_FORMAT = "csv"; -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.controller.visualization; + +import java.util.regex.Pattern; + +public class VisualizationFrameworkConstants { + + /* + * Contains the location of bean containing info on all the visualizations + * available in that instance. Currently it is stored under + * "productMods/WEB-INF..." + */ + public static final String RELATIVE_LOCATION_OF_VISUALIZATIONS_BEAN = + "/WEB-INF/visualization/visualizations-beans-injection.xml"; + + /* + * Freemarker Version + * */ + public static final String RELATIVE_LOCATION_OF_FM_VISUALIZATIONS_BEAN = + "/WEB-INF/visualization/visualizations-beans-injection-fm.xml"; + + public static final String ERROR_TEMPLATE = "/visualization/visualizationError.ftl"; + + /* + * Vis URL prefix that is seen by all the users + */ + public static final String VISUALIZATION_URL_PREFIX = "/visualization"; + public static final String SHORT_URL_VISUALIZATION_REQUEST_PREFIX = "/vis"; + + public static final String FREEMARKERIZED_VISUALIZATION_URL_PREFIX = "/visualization"; + public static final String AJAX_VISUALIZATION_SERVICE_URL_PREFIX = "/visualizationAjax"; + public static final String DATA_VISUALIZATION_SERVICE_URL_PREFIX = "/visualizationData"; + + public static final String INDIVIDUAL_URL_PREFIX = "/individual"; + + + public static final Pattern SHORT_URL_REQUEST_PATTERN = Pattern + .compile("^" + + SHORT_URL_VISUALIZATION_REQUEST_PREFIX + + "/([\\w-]+)/([^/]*)$"); + + + /* + * These represent possible query keys in a URI for visualization purposes. + * Examples, + * 1. http://vivo.indiana.edu/visualization?uri=http://vivoweb.org/ontology/core/Person10979&vis=person_level&render_mode=standalone + * 2. http://vivo.indiana.edu/visualization?uri=http://vivoweb.org/ontology/core/Person72&vis=person_pub_count&render_mode=dynamic&container=vis_container + * */ + public static final String VIS_TYPE_KEY = "vis"; + public static final String VIS_CONTAINER_KEY = "container"; + public static final String INDIVIDUAL_URI_KEY = "uri"; + public static final String VIS_MODE_KEY = "vis_mode"; + public static final String RENDER_MODE_KEY = "render_mode"; + public static final String OUTPUT_FORMAT_KEY = "output"; + public static final String REQUESTING_TEMPLATE_KEY = "template"; /* tlw72 - added in 1.6 for multi-view support */ + + /* + * These values represent possible render modes. + * */ + public static final String STANDALONE_RENDER_MODE = "standalone"; + public static final String DYNAMIC_RENDER_MODE = "dynamic"; + public static final String DATA_RENDER_MODE = "data"; + public static final String PDF_RENDER_MODE = "pdf"; + + /* + * These values represent possible sub-vis modes. + * */ + public static final String IMAGE_VIS_MODE = "image"; + public static final String SHORT_SPARKLINE_VIS_MODE = "short"; + public static final String FULL_SPARKLINE_VIS_MODE = "full"; + public static final String COPI_VIS_MODE = "copi"; + public static final String COAUTHOR_VIS_MODE = "coauthor"; + + /* + * Vis modes for CoauthorshipRequest Handler + * */ + public static final String COAUTHORS_COUNT_PER_YEAR_VIS_MODE = "coauthors_count_per_year"; + public static final String COAUTHORS_LIST_VIS_MODE = "coauthors"; + public static final String COAUTHOR_NETWORK_STREAM_VIS_MODE = "coauthor_network_stream"; + public static final String COAUTHOR_NETWORK_DOWNLOAD_VIS_MODE = "coauthor_network_download"; + + /* + * Vis modes for CoPIRequest Handler + * */ + public static final String COPIS_COUNT_PER_YEAR_VIS_MODE = "copis_count_per_year"; + public static final String COPIS_LIST_VIS_MODE = "copis"; + public static final String COPI_NETWORK_STREAM_VIS_MODE = "copi_network_stream"; + public static final String COPI_NETWORK_DOWNLOAD_VIS_MODE = "copi_network_download"; + + + /* + * Vis modes for Map of Science Handler + * */ + public static final String DISCIPLINE_TO_ACTIVTY_VIS_MODE = "discipline"; + public static final String SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE = "subdiscipline"; + public static final String SCIENCE_UNLOCATED_JOURNALS_VIS_MODE = "unlocated_journals"; + + + /* + * These values represent possible utilities vis modes. + * */ + public static final String PROFILE_INFO_UTILS_VIS_MODE = "PROFILE_INFO"; + public static final String PROFILE_UTILS_VIS_MODE = "PROFILE_URL"; + public static final String COAUTHOR_UTILS_VIS_MODE = "COAUTHORSHIP_URL"; + public static final String PERSON_LEVEL_UTILS_VIS_MODE = "PERSON_LEVEL_URL"; + public static final String COPI_UTILS_VIS_MODE = "COPI_URL"; + public static final String IMAGE_UTILS_VIS_MODE = "IMAGE_URL"; + public static final String ARE_PUBLICATIONS_AVAILABLE_UTILS_VIS_MODE = "SHOW_AUTHORSHIP_LINK"; + public static final String ARE_GRANTS_AVAILABLE_UTILS_VIS_MODE = "SHOW_GRANTS_LINK"; + public static final String UNIVERSITY_COMPARISON_VIS_MODE = "UNIVERSITY"; + public static final String SCHOOL_COMPARISON_VIS_MODE = "SCHOOL"; + public static final String DEPARTMENT_COMPARISON_VIS_MODE = "DEPARTMENT"; + public static final String HIGHEST_LEVEL_ORGANIZATION_VIS_MODE = "HIGHEST_LEVEL_ORGANIZATION"; + + /* + * These values represent possible visualizations provided as values to the "vis" url key. + * */ + public static final String PERSON_PUBLICATION_COUNT_VIS = "person_pub_count"; + public static final String PERSON_GRANT_COUNT_VIS = "person_grant_count"; + public static final String PDF_REPORT_VIS = "pdf_report"; + public static final String COLLEGE_PUBLICATION_COUNT_VIS = "college_pub_count"; + public static final String COAUTHORSHIP_VIS = "coauthorship"; + public static final String PERSON_LEVEL_VIS = "person_level"; + public static final String COAUTHORSHIP_VIS_SHORT_URL = "author-network"; + public static final String COINVESTIGATOR_VIS_SHORT_URL = "investigator-network"; + public static final String UTILITIES_VIS = "utilities"; + public static final String ENTITY_COMPARISON_VIS = "entity_comparison"; + public static final String PUBLICATION_TEMPORAL_VIS_SHORT_URL = "publication-graph"; + public static final String MAP_OF_SCIENCE_VIS_SHORT_URL = "map-of-science"; + public static final String GRANT_TEMPORAL_VIS_SHORT_URL = "grant-graph"; + public static final String CO_PI_VIS = "coprincipalinvestigator"; + + + /* + * These values represent possible data serialization formats corresponding to + * output format key. + * */ + public static final String JSON_OUTPUT_FORMAT = "json"; + public static final String CSV_OUTPUT_FORMAT = "csv"; +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationInjector.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationInjector.java index 29c686d1..17ed0c8f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationInjector.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationInjector.java @@ -1,19 +1,19 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ -package edu.cornell.mannlib.vitro.webapp.controller.visualization; - -import java.util.Map; - -import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; - -public class VisualizationInjector { - private Map visualizationIDToClass; - - public Map getVisualizationIDToClass() { - return visualizationIDToClass; - } - - public void setVisualizations(Map visualizationIDToClass) { - this.visualizationIDToClass = visualizationIDToClass; - } - +/* $This file is distributed under the terms of the license in LICENSE$ */ +package edu.cornell.mannlib.vitro.webapp.controller.visualization; + +import java.util.Map; + +import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; + +public class VisualizationInjector { + private Map visualizationIDToClass; + + public Map getVisualizationIDToClass() { + return visualizationIDToClass; + } + + public void setVisualizations(Map visualizationIDToClass) { + this.visualizationIDToClass = visualizationIDToClass; + } + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java index 6c27572d..a75936bc 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java @@ -12,18 +12,18 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; public class VisualizationsDependencyInjector { - + private static Map visualizationIDsToClass; - + /** - * This method is used to inject vis dependencies i.e. the vis algorithms that are - * being implemented into the vis controller. Modified Dependency Injection pattern is - * used here. XML file containing the location of all the vis is saved in accessible folder. + * This method is used to inject vis dependencies i.e. the vis algorithms that are + * being implemented into the vis controller. Modified Dependency Injection pattern is + * used here. XML file containing the location of all the vis is saved in accessible folder. * @param servletContext Servlet context */ private synchronized static Map initVisualizations( ServletContext servletContext) { - + /* * A visualization request has already been made causing the visualizationIDsToClass to be * initiated & populated with visualization ids to its request handlers. @@ -31,26 +31,26 @@ public class VisualizationsDependencyInjector { if (visualizationIDsToClass != null) { return visualizationIDsToClass; } - - String resourcePath = + + String resourcePath = servletContext .getRealPath(VisualizationFrameworkConstants .RELATIVE_LOCATION_OF_FM_VISUALIZATIONS_BEAN); - + ApplicationContext context = new ClassPathXmlApplicationContext( "file:" + resourcePath); BeanFactory factory = context; - - VisualizationInjector visualizationInjector = + + VisualizationInjector visualizationInjector = (VisualizationInjector) factory.getBean("visualizationInjector"); - + visualizationIDsToClass = visualizationInjector.getVisualizationIDToClass(); - - + + return visualizationIDsToClass; } - + public static Map getVisualizationIDsToClassMap( ServletContext servletContext) { if (visualizationIDsToClass != null) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/AutocompleteRequiredInputValidator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/AutocompleteRequiredInputValidator.java index 57959a41..7db47779 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/AutocompleteRequiredInputValidator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/AutocompleteRequiredInputValidator.java @@ -15,25 +15,25 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmis public class AutocompleteRequiredInputValidator implements N3ValidatorVTwo { private static String MISSING_LABEL_ERROR = "Please select an existing value or enter a new value in the Name field."; - + private String uriReceiver; private String labelInput; - + public AutocompleteRequiredInputValidator(String uriReceiver, String labelInput) { this.uriReceiver = uriReceiver; this.labelInput = labelInput; } - + @Override public Map validate(EditConfigurationVTwo editConfig, MultiValueEditSubmission editSub) { Map> urisFromForm = editSub.getUrisFromForm(); Map> literalsFromForm = editSub.getLiteralsFromForm(); - Map errors = new HashMap(); - + Map errors = new HashMap(); + List selectedUri = urisFromForm.get(uriReceiver); - + // If there's a presentationUri, then we're done. If not, check to see if the label exists. // If that's null, too, it's an error. if (allListElementsEmpty(selectedUri) || selectedUri.contains(">SUBMITTED VALUE WAS BLANK<")) { @@ -50,11 +50,11 @@ public class AutocompleteRequiredInputValidator implements N3ValidatorVTwo { else { errors.put(labelInput, MISSING_LABEL_ERROR); } - } + } return errors.size() != 0 ? errors : null; } - + private boolean allListElementsEmpty(List checkList) { if(checkList == null) return true; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/FirstAndLastNameValidator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/FirstAndLastNameValidator.java index b4f829f8..6cf29654 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/FirstAndLastNameValidator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/FirstAndLastNameValidator.java @@ -18,19 +18,19 @@ public class FirstAndLastNameValidator implements N3ValidatorVTwo { private static String MISSING_LAST_NAME_ERROR = "You must enter a value in the Last Name field."; private static String MALFORMED_LAST_NAME_ERROR = "The last name field may not contain a comma. Please enter first name in First Name field."; private String uriReceiver; - + public FirstAndLastNameValidator(String uriReceiver) { this.uriReceiver = uriReceiver; } - + @Override public Map validate(EditConfigurationVTwo editConfig, MultiValueEditSubmission editSub) { Map> urisFromForm = editSub.getUrisFromForm(); Map> literalsFromForm = editSub.getLiteralsFromForm(); - Map errors = new HashMap(); - + Map errors = new HashMap(); + List personUri = urisFromForm.get(uriReceiver); if (allListElementsEmpty(personUri) || personUri.contains(">SUBMITTED VALUE WAS BLANK<")) { personUri = null; @@ -40,7 +40,7 @@ public class FirstAndLastNameValidator implements N3ValidatorVTwo { if (personUri != null) { return null; } - + //Expecting only one first name in this case //To Do: update logic if multiple first names considered Literal firstName = null; @@ -48,8 +48,8 @@ public class FirstAndLastNameValidator implements N3ValidatorVTwo { if(firstNameList != null && firstNameList.size() > 0) { firstName = firstNameList.get(0); } - if( firstName != null && - firstName.getLexicalForm() != null && + if( firstName != null && + firstName.getLexicalForm() != null && "".equals(firstName.getLexicalForm()) ) firstName = null; @@ -70,17 +70,17 @@ public class FirstAndLastNameValidator implements N3ValidatorVTwo { if (lastName == null) { errors.put("lastName", MISSING_LAST_NAME_ERROR); // Don't reject space in the last name: de Vries, etc. - } else if (lastNameValue.contains(",")) { + } else if (lastNameValue.contains(",")) { errors.put("lastName", MALFORMED_LAST_NAME_ERROR); } - + if (firstName == null) { errors.put("firstName", MISSING_FIRST_NAME_ERROR); - } - + } + return errors.size() != 0 ? errors : null; } - + private boolean allListElementsEmpty(List checkList) { if(checkList == null) return true; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/N3TransitionToV2Mapping.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/N3TransitionToV2Mapping.java index b4e45f26..e0d7bbbc 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/N3TransitionToV2Mapping.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/N3TransitionToV2Mapping.java @@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.edit.n3editing; import java.util.HashMap; import java.util.Map; -public class N3TransitionToV2Mapping extends HashMap{ +public class N3TransitionToV2Mapping extends HashMap{ public N3TransitionToV2Mapping(){ Map map = this; @@ -13,7 +13,7 @@ public class N3TransitionToV2Mapping extends HashMap{ // vivo forms: - map.put("addAuthorsToInformationResource.jsp", + map.put("addAuthorsToInformationResource.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAuthorsToInformationResourceGenerator.class.getName()); map.put("manageWebpagesForIndividual.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator.class.getName()); @@ -24,7 +24,7 @@ public class N3TransitionToV2Mapping extends HashMap{ map.put("personHasEducationalTraining.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining.class.getName()); map.put("personHasPositionHistory.jsp", - edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasPositionHistoryGenerator.class.getName()); + edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasPositionHistoryGenerator.class.getName()); map.put("addGrantRoleToPerson.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddGrantRoleToPersonGenerator.class.getName()); map.put("addEditWebpageForm.jsp", @@ -34,12 +34,12 @@ public class N3TransitionToV2Mapping extends HashMap{ // map.put("terminologyAnnotation.jsp", // edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.TerminologyAnnotationGenerator.class.getName()); -// +// // map.put("redirectToPublication.jsp", // edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.RedirectToPublicationGenerator.class.getName()); // map.put("unsupportedBrowserMessage.jsp", // edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.UnsupportedBrowserMessage.class.getName()); -// +// // vivo 2 stage role forms: map.put("addAttendeeRoleToPerson.jsp", @@ -57,7 +57,7 @@ public class N3TransitionToV2Mapping extends HashMap{ map.put("addOutreachRoleToPerson.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddOutreachProviderRoleToPersonGenerator.class.getName()); map.put("addPresenterRoleToPerson.jsp", - edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPresenterRoleToPersonGenerator.class.getName()); + edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPresenterRoleToPersonGenerator.class.getName()); map.put("addResearcherRoleToPerson.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddResearcherRoleToPersonGenerator.class.getName()); map.put("addReviewerRoleToPerson.jsp", @@ -68,6 +68,6 @@ public class N3TransitionToV2Mapping extends HashMap{ edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddServiceProviderRoleToPersonGenerator.class.getName()); map.put("addTeacherRoleToPerson.jsp", edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddTeacherRoleToPersonGenerator.class.getName()); - + } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java index 76cc439c..4acfde84 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PersonHasPublicationValidator.java @@ -22,7 +22,7 @@ public class PersonHasPublicationValidator implements N3ValidatorVTwo { private static String MISSING_FIRST_NAME_ERROR = "You must enter a value in the First Name field."; private static String MISSING_LAST_NAME_ERROR = "You must enter a value in the Last Name field."; private static String MALFORMED_LAST_NAME_ERROR = "The last name field may not contain a comma. Please enter first name in First Name field."; - + @Override public Map validate(EditConfigurationVTwo editConfig, MultiValueEditSubmission editSub) { @@ -30,11 +30,11 @@ public class PersonHasPublicationValidator implements N3ValidatorVTwo { Map> urisFromForm = editSub.getUrisFromForm(); Map> literalsFromForm = editSub.getLiteralsFromForm(); - Map errors = new HashMap(); - - // The Editor field is optional for all publication subclasses. Validation is only necessary if the user only enters a + Map errors = new HashMap(); + + // The Editor field is optional for all publication subclasses. Validation is only necessary if the user only enters a // last name or only enters a first name - + //Expecting only one first name in this case //To Do: update logic if multiple first names considered List firstNameList = literalsFromForm.get("firstName"); @@ -42,8 +42,8 @@ public class PersonHasPublicationValidator implements N3ValidatorVTwo { if(firstNameList != null && firstNameList.size() > 0) { firstName = firstNameList.get(0); } - if ( firstName != null && - firstName.getLexicalForm() != null && + if ( firstName != null && + firstName.getLexicalForm() != null && "".equals(firstName.getLexicalForm()) ) firstName = null; @@ -67,22 +67,22 @@ public class PersonHasPublicationValidator implements N3ValidatorVTwo { else if ( firstName == null && lastName != null) { errors.put("firstName", MISSING_FIRST_NAME_ERROR); } - else if (lastNameValue.contains(",")) { + else if (lastNameValue.contains(",")) { errors.put("lastName", MALFORMED_LAST_NAME_ERROR); } else { return null; - } - + } + return errors.size() != 0 ? errors : null; } - + private Object getFirstElement(List checkList) { if(checkList == null || checkList.size() == 0) { return null; } return checkList.get(0); } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java index 3780076c..ba6e28a1 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/PublicationHasAuthorValidator.java @@ -19,19 +19,19 @@ public class PublicationHasAuthorValidator implements N3ValidatorVTwo { private static String MISSING_FIRST_NAME_ERROR = "Must specify the author's first name."; private static String MISSING_LAST_NAME_ERROR = "Must specify the author's last name."; private static String MALFORMED_LAST_NAME_ERROR = "Last name may not contain a comma. Please enter first name in first name field."; -; +; @Override public Map validate(EditConfigurationVTwo editConfig, MultiValueEditSubmission editSub) { Map> urisFromForm = editSub.getUrisFromForm(); Map> literalsFromForm = editSub.getLiteralsFromForm(); - Map errors = new HashMap(); - + Map errors = new HashMap(); + List personUri = urisFromForm.get("personUri"); List orgUri = urisFromForm.get("orgUri"); List orgNameList = literalsFromForm.get("orgName"); - + if (allListElementsEmpty(personUri)) { personUri = null; } @@ -47,7 +47,7 @@ public class PublicationHasAuthorValidator implements N3ValidatorVTwo { if (personUri != null || orgUri != null || orgName != null ) { return null; } - + //Expecting only one first name in this case //To Do: update logic if multiple first names considered Literal firstName = null; @@ -55,8 +55,8 @@ public class PublicationHasAuthorValidator implements N3ValidatorVTwo { if(firstNameList != null && firstNameList.size() > 0) { firstName = firstNameList.get(0); } - if( firstName != null && - firstName.getLexicalForm() != null && + if( firstName != null && + firstName.getLexicalForm() != null && "".equals(firstName.getLexicalForm()) ) firstName = null; @@ -77,17 +77,17 @@ public class PublicationHasAuthorValidator implements N3ValidatorVTwo { if (lastName == null) { errors.put("lastName", MISSING_LAST_NAME_ERROR); // Don't reject space in the last name: de Vries, etc. - } else if (lastNameValue.contains(",")) { + } else if (lastNameValue.contains(",")) { errors.put("lastName", MALFORMED_LAST_NAME_ERROR); } - + if (firstName == null) { errors.put("firstName", MISSING_FIRST_NAME_ERROR); - } - + } + return errors.size() != 0 ? errors : null; } - + private boolean allListElementsEmpty(List checkList) { if(checkList == null) return true; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAssociatedConceptGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAssociatedConceptGenerator.java index aca5545c..66c7d0ff 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAssociatedConceptGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAssociatedConceptGenerator.java @@ -1,569 +1,569 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpSession; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.apache.jena.ontology.OntModel; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; -import org.apache.jena.vocabulary.RDFS; -import org.apache.jena.vocabulary.XSD; - -import edu.cornell.mannlib.vitro.webapp.beans.Individual; -import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; -import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.AddAssociatedConceptsPreprocessor; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.ConceptSemanticTypesPreprocessor; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; -import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; -import edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService.ConceptSearchServiceUtils; -/** - * Generates the edit configuration for importing concepts from external - * search services, e.g. UMLS etc. - * - * Since editing/deletion is handled by separate custom code, this generator always assumes - * property addition mode. - */ -public class AddAssociatedConceptGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { - - private Log log = LogFactory.getLog(AddAssociatedConceptGenerator.class); - private String template = "addAssociatedConcept.ftl"; - //TODO: Set this to a dynamic mechanism - private static String VIVOCore = "http://vivoweb.org/ontology/core#"; - private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; - private static String SKOSBroaderURI = "http://www.w3.org/2004/02/skos/core#broader"; - private static String SKOSNarrowerURI = "http://www.w3.org/2004/02/skos/core#narrower"; - @Override - public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); - initBasics(editConfiguration, vreq); - initPropertyParameters(vreq, session, editConfiguration); - initObjectPropForm(editConfiguration, vreq); - editConfiguration.setTemplate(template); - - setVarNames(editConfiguration); - - // Assumes this is a simple case of subject predicate var - editConfiguration.setN3Required(this.generateN3Required(vreq)); - - // n3 optional - editConfiguration.setN3Optional(this.generateN3Optional()); - - editConfiguration.setNewResources(generateNewResources(vreq)); - // In scope - this.setUrisAndLiteralsInScope(editConfiguration, vreq); - - // on Form - this.setUrisAndLiteralsOnForm(editConfiguration, vreq); - - editConfiguration.setFilesOnForm(new ArrayList()); - - // Sparql queries - this.setSparqlQueries(editConfiguration, vreq); - - // set fields - setFields(editConfiguration, vreq, EditConfigurationUtils - .getPredicateUri(vreq)); - - setTemplate(editConfiguration, vreq); - // No validators required here - // Add preprocessors - //Passing from servlet context for now but will have to see if there's a way to pass vreq - addPreprocessors(editConfiguration); - // Adding additional data, specifically edit mode - addFormSpecificData(editConfiguration, vreq); - // One override for basic functionality, changing url pattern - // and entity - // Adding term should return to this same page, not the subject - // Return takes the page back to the individual form - editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils - .getFormUrlWithoutContext(vreq)); - - editConfiguration.addValidator(new AntiXssValidation()); - - // prepare - prepare(vreq, editConfiguration); - return editConfiguration; - } - - //In this case, the generator is not equipped to handle any deletion - //Editing in the usual sense does not exist for this form - //So we will disable editing - @Override - void initObjectPropForm(EditConfigurationVTwo editConfiguration,VitroRequest vreq) { - editConfiguration.setObject( null ); - } - - //Ensuring that editing property logic does not get executed on processing - //since form's deletions are handled separately - @Override - void prepare(VitroRequest vreq, EditConfigurationVTwo editConfig) { - Model model = vreq.getJenaOntModel(); - //Set subject and predicate uri - if( editConfig.getSubjectUri() == null) - editConfig.setSubjectUri( EditConfigurationUtils.getSubjectUri(vreq)); - if( editConfig.getPredicateUri() == null ) - editConfig.setPredicateUri( EditConfigurationUtils.getPredicateUri(vreq)); - //Always set creation - editConfig.prepareForNonUpdate(model); - - } - - - private void setVarNames(EditConfigurationVTwo editConfiguration) { - editConfiguration.setVarNameForSubject("subject"); - editConfiguration.setVarNameForPredicate("predicate"); - //We are not including concept node here since - //we never actually "edit" using this form - //the n3 required and optional will still be evaluated based on the form - editConfiguration.setVarNameForObject("object"); - } - - protected void setTemplate(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.setTemplate(template); - - } - - - - /* - * N3 Required and Optional Generators as well as supporting methods - */ - - private String getPrefixesString() { - //TODO: Include dynamic way of including this - return "@prefix core: ."; - } - - //The only string always required is that linking the subject to the concept node - //Since the concept node from an external vocabulary may already be in the system - //The label and is defined by may already be defined and don't require re-saving - private List generateN3Required(VitroRequest vreq) { - List n3Required = list( - getPrefixesString() + "\n" + - "?subject ?predicate ?conceptNode .\n" + - "?conceptNode <" + RDF.type.getURI() + "> <" + this.SKOSConceptType + "> ." - ); - //"?conceptNode <" + RDF.type.getURI() + "> ." - - List inversePredicate = getInversePredicate(vreq); - //Adding inverse predicate if it exists - if(inversePredicate.size() > 0) { - n3Required.add("?conceptNode <" + inversePredicate.get(0) + "> ?subject ."); - } - return n3Required; - } - - //Optional N3, includes possibility of semantic type which may or may not be included - //label and source are independent of semantic type - //concept semantic type uri is a placeholder which is actually processed in the sparql update preprocessor - private List generateN3Optional() { - return list("?conceptNode <" + RDFS.label.getURI() + "> ?conceptLabel .\n" + - "?conceptNode <" + RDFS.isDefinedBy.getURI() + "> ?conceptSource .", - "?conceptNode <" + RDF.type + "> ?conceptSemanticTypeURI ." + - "?conceptSemanticTypeURI <" + RDFS.label.getURI() + "> ?conceptSemanticTypeLabel ." + - "?conceptSemanticTypeURI <" + RDFS.subClassOf + "> <" + SKOSConceptType + "> .", - "?conceptNode <" + this.SKOSNarrowerURI + "> ?conceptNarrowerURI ." + - "?conceptNarrowerURI <" + this.SKOSBroaderURI + "> ?conceptNode .", - "?conceptNode <" + this.SKOSBroaderURI + "> ?conceptBroaderURI ." + - "?conceptBroaderURI <" + this.SKOSNarrowerURI + "> ?conceptNode ." - ); - } - - - - - /* - * Get new resources - */ - private Map generateNewResources(VitroRequest vreq) { - HashMap newResources = new HashMap(); - //There are no new resources here, the concept node uri doesn't - //get created but already exists, and vocab uri should already exist as well - //Adding concept semantic type uri just to test - note this isn't really on the form at all - newResources.put("conceptSemanticTypeURI", null); - return newResources; - } - - - - - /* - * Set URIS and Literals In Scope and on form and supporting methods - */ - - private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap> urisInScope = new HashMap>(); - //note that at this point the subject, predicate, and object var parameters have already been processed - //these two were always set when instantiating an edit configuration object from json, - //although the json itself did not specify subject/predicate as part of uris in scope - urisInScope.put(editConfiguration.getVarNameForSubject(), - Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), - Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); - //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); - - - editConfiguration.setUrisInScope(urisInScope); - //Uris in scope include subject, predicate, and object var - //literals in scope empty initially, usually populated by code in prepare for update - //with existing values for variables - editConfiguration.setLiteralsInScope(new HashMap>()); - } - - private List getInversePredicate(VitroRequest vreq) { - List inversePredicateArray = new ArrayList(); - ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); - if(op != null && op.getURIInverse() != null) { - inversePredicateArray.add(op.getURIInverse()); - } - return inversePredicateArray; - } - - //n3 should look as follows - //?subject ?predicate ?objectVar - - private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); - List literalsOnForm = new ArrayList(); - //The URI of the node that defines the concept - urisOnForm.add("conceptNode"); - urisOnForm.add("conceptSource"); - urisOnForm.add("conceptSemanticTypeURI"); - urisOnForm.add("conceptBroaderURI"); - urisOnForm.add("conceptNarrowerURI"); - editConfiguration.setUrisOnform(urisOnForm); - //Also need to add the label of the concept - literalsOnForm.add("conceptLabel"); - literalsOnForm.add("conceptSemanticTypeLabel"); - - editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - - /** - * Set SPARQL Queries and supporting methods - */ - - - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - //Sparql queries defining retrieval of literals etc. - editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); - editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); - editConfiguration.setSparqlForExistingLiterals(new HashMap()); - editConfiguration.setSparqlForExistingUris(new HashMap()); - } - - - /** - * - * Set Fields and supporting methods - */ - - private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { - setConceptNodeField(editConfiguration, vreq); - setConceptLabelField(editConfiguration, vreq); - setVocabURIField(editConfiguration, vreq); - setConceptSemanticTypeURIField(editConfiguration,vreq); - setConceptSemanticTypeLabelField(editConfiguration,vreq); - setConceptBroaderURIField(editConfiguration, vreq); - setConceptNarrowerURIField(editConfiguration, vreq); - } - - private void setConceptNarrowerURIField( - EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptNarrowerURI")); - } - - private void setConceptBroaderURIField( - EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptBroaderURI")); - - } - - //this field will be hidden and include the concept node URI - private void setConceptNodeField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptNode"). - setValidators(list("nonempty"))); - } - - - - private void setVocabURIField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptSource")); - } - - - - private void setConceptLabelField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptLabel"). - setRangeDatatypeUri(XSD.xstring.toString()) - ); - } - - //This will also be a URI - private void setConceptSemanticTypeURIField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptSemanticTypeURI") - ); - } - - private void setConceptSemanticTypeLabelField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptSemanticTypeLabel"). - setRangeDatatypeUri(XSD.xstring.toString()) - ); - } - - - //Add preprocessor - - private void addPreprocessors(EditConfigurationVTwo editConfiguration) { - //An Edit submission preprocessor for enabling addition of multiple terms for a single search - //TODO: Check if this is the appropriate way of getting model - - //Passing model to check for any URIs that are present - - editConfiguration.addEditSubmissionPreprocessor( - new AddAssociatedConceptsPreprocessor(editConfiguration)); - editConfiguration.addModelChangePreprocessor(new ConceptSemanticTypesPreprocessor()); - - } - - - //Form specific data - public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap formSpecificData = new HashMap(); - //These are the concepts that already exist currently - formSpecificData.put("existingConcepts", getExistingConcepts(vreq)); - //Return url for adding user defined concept - formSpecificData.put("userDefinedConceptUrl", getUserDefinedConceptUrl(vreq)); - //Add URIs and labels for different services - formSpecificData.put("searchServices", ConceptSearchServiceUtils.getVocabSources()); - List inversePredicate = getInversePredicate(vreq); - if(inversePredicate.size() > 0) { - formSpecificData.put("inversePredicate", inversePredicate.get(0)); - } else { - formSpecificData.put("inversePredicate", ""); - } - editConfiguration.setFormSpecificData(formSpecificData); - } - - - // - private Object getUserDefinedConceptUrl(VitroRequest vreq) { - String subjectUri = EditConfigurationUtils.getSubjectUri(vreq); - String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); - String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddUserDefinedConceptGenerator"; - String editUrl = EditConfigurationUtils.getEditUrl(vreq); - - return editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + - "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + - "&editForm=" + UrlBuilder.urlEncode(generatorName); - } - - private List getExistingConcepts(VitroRequest vreq) { - Individual individual = EditConfigurationUtils.getSubjectIndividual(vreq); - List concepts = individual.getRelatedIndividuals( - EditConfigurationUtils.getPredicateUri(vreq)); - List associatedConcepts = getAssociatedConceptInfo(concepts, vreq); - sortConcepts(associatedConcepts); - return associatedConcepts; - } - - - private void sortConcepts(List concepts) { - concepts.sort(new AssociatedConceptInfoComparator()); - log.debug("Concepts should be sorted now" + concepts.toString()); - } - - - //To determine whether or not a concept is a user generated or one from an external vocab source. - //we cannot rely on whether or not it is a skos concept because incorporating UMLS semantic network classes as - //SKOS concept subclasses means that even concepts from an external vocab source might be considered SKOS concepts - //Instead, we will simply determine whether a concept is defined by an external vocabulary source and use that - //as the primary indicator of whether a concept is from an external vocabulary source or a user generated concept - private List getAssociatedConceptInfo( - List concepts, VitroRequest vreq) { - List info = new ArrayList(); - for ( Individual conceptIndividual : concepts ) { - boolean userGenerated = true; - //Note that this isn't technically - String conceptUri = conceptIndividual.getURI(); - String conceptLabel = conceptIndividual.getName(); - - //Check if defined by an external vocabulary source - List vocabList = conceptIndividual.getObjectPropertyStatements(RDFS.isDefinedBy.getURI()); - String vocabSource = null; - String vocabLabel = null; - if(vocabList != null && vocabList.size() > 0) { - userGenerated = false; - vocabSource = vocabList.get(0).getObjectURI(); - Individual sourceIndividual = EditConfigurationUtils.getIndividual(vreq, vocabSource); - //Assuming name will get label - vocabLabel = sourceIndividual.getName(); - } - - - - if(userGenerated) { - //if the concept in question is skos - which would imply a user generated concept - info.add(new AssociatedConceptInfo(conceptLabel, conceptUri, null, null, SKOSConceptType, null, null)); - } else { - String conceptSemanticTypeURI = null; - String conceptSemanticTypeLabel = null; - //Can a concept have multiple semantic types? Currently we are only returning the first one - //TODO: Change this into a sparql query that returns all types for the concept that are subclasses of SKOS concepts - HashMap typeAndLabel = this.getConceptSemanticTypeQueryResults(conceptIndividual.getURI(), ModelAccess.on(vreq).getOntModel()); - if(typeAndLabel.containsKey("semanticTypeURI")) { - conceptSemanticTypeURI = typeAndLabel.get("semanticTypeURI"); - } - if(typeAndLabel.containsKey("semanticTypeLabel")) { - conceptSemanticTypeLabel = typeAndLabel.get("semanticTypeLabel"); - } - - //Assuming this is from an external vocabulary source - info.add(new AssociatedConceptInfo(conceptLabel, conceptUri, vocabSource, vocabLabel, null, conceptSemanticTypeURI, conceptSemanticTypeLabel)); - - } - } - return info; - } - - private HashMap getConceptSemanticTypeQueryResults(String conceptURI, OntModel ontModel) { - HashMap typeAndLabel = new HashMap(); - String queryStr = "SELECT ?semanticTypeURI ?semanticTypeLabel WHERE { " + - "<" + conceptURI + "> <" + RDF.type.getURI() + "> ?semanticTypeURI . " + - "?semanticTypeURI <" + RDFS.subClassOf.getURI() + "> <" + this.SKOSConceptType + ">. " + - "?semanticTypeURI <" + RDFS.label.getURI() + "> ?semanticTypeLabel ." + - "}"; - QueryExecution qe = null; - try{ - Query query = QueryFactory.create(queryStr); - qe = QueryExecutionFactory.create(query, ontModel); - ResultSet results = null; - results = qe.execSelect(); - - while( results.hasNext()){ - QuerySolution qs = results.nextSolution(); - if(qs.get("semanticTypeURI") != null) { - Resource semanticTypeURI = qs.getResource("semanticTypeURI"); - log.debug("Semantic Type URI returned " + semanticTypeURI.getURI()); - typeAndLabel.put("semanticTypeURI", semanticTypeURI.getURI()); - } - if(qs.get("semanticTypeLabel") != null) { - Literal semanticTypeLabel = qs.getLiteral("semanticTypeLabel"); - log.debug("Semantic Type label returned " + semanticTypeLabel.getString()); - typeAndLabel.put("semanticTypeLabel", semanticTypeLabel.getString()); - } - - - } - }catch(Exception ex){ - throw new Error("Error in executing query string: \n" + queryStr + '\n' + ex.getMessage()); - }finally{ - if( qe != null) - qe.close(); - } - return typeAndLabel; - } - - public class AssociatedConceptInfo { - private String conceptLabel; - private String conceptURI; - private String vocabURI; - private String vocabLabel; - private String type; //In case of SKOS concept, will have skos concept type - private String conceptSemanticTypeURI; //For some services, such as UMLS, we have a semantic type associated - private String conceptSemanticTypeLabel; - public AssociatedConceptInfo(String inputLabel, String inputURI, String inputVocabURI, String inputVocabLabel, String inputType, String inputConceptSemanticTypeURI, String inputConceptSemanticTypeLabel) { - this.conceptLabel = inputLabel; - this.conceptURI = inputURI; - this.vocabURI = inputVocabURI; - this.vocabLabel = inputVocabLabel; - this.type = inputType; - this.conceptSemanticTypeURI = inputConceptSemanticTypeURI; - this.conceptSemanticTypeLabel = inputConceptSemanticTypeLabel; - } - - //Getters - public String getConceptLabel() { - return conceptLabel; - } - - public String getConceptURI() { - return conceptURI; - } - - public String getVocabURI() { - return vocabURI; - } - - public String getVocabLabel(){ - return vocabLabel; - } - - public String getType(){ - return type; - } - - public String getConceptSemanticTypeURI(){ - return conceptSemanticTypeURI; - } - - public String getConceptSemanticTypeLabel(){ - return conceptSemanticTypeLabel; - } - - } - - public class AssociatedConceptInfoComparator implements Comparator{ - public int compare(AssociatedConceptInfo concept1, AssociatedConceptInfo concept2) { - String concept1Label = concept1.getConceptLabel().toLowerCase(); - String concept2Label = concept2.getConceptLabel().toLowerCase(); - return concept1Label.compareTo(concept2Label); - } - } - - - - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpSession; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.apache.jena.ontology.OntModel; +import org.apache.jena.query.Query; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QueryFactory; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; +import org.apache.jena.vocabulary.XSD; + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.AddAssociatedConceptsPreprocessor; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.ConceptSemanticTypesPreprocessor; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; +import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; +import edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService.ConceptSearchServiceUtils; +/** + * Generates the edit configuration for importing concepts from external + * search services, e.g. UMLS etc. + * + * Since editing/deletion is handled by separate custom code, this generator always assumes + * property addition mode. + */ +public class AddAssociatedConceptGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { + + private Log log = LogFactory.getLog(AddAssociatedConceptGenerator.class); + private String template = "addAssociatedConcept.ftl"; + //TODO: Set this to a dynamic mechanism + private static String VIVOCore = "http://vivoweb.org/ontology/core#"; + private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; + private static String SKOSBroaderURI = "http://www.w3.org/2004/02/skos/core#broader"; + private static String SKOSNarrowerURI = "http://www.w3.org/2004/02/skos/core#narrower"; + @Override + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + initBasics(editConfiguration, vreq); + initPropertyParameters(vreq, session, editConfiguration); + initObjectPropForm(editConfiguration, vreq); + editConfiguration.setTemplate(template); + + setVarNames(editConfiguration); + + // Assumes this is a simple case of subject predicate var + editConfiguration.setN3Required(this.generateN3Required(vreq)); + + // n3 optional + editConfiguration.setN3Optional(this.generateN3Optional()); + + editConfiguration.setNewResources(generateNewResources(vreq)); + // In scope + this.setUrisAndLiteralsInScope(editConfiguration, vreq); + + // on Form + this.setUrisAndLiteralsOnForm(editConfiguration, vreq); + + editConfiguration.setFilesOnForm(new ArrayList()); + + // Sparql queries + this.setSparqlQueries(editConfiguration, vreq); + + // set fields + setFields(editConfiguration, vreq, EditConfigurationUtils + .getPredicateUri(vreq)); + + setTemplate(editConfiguration, vreq); + // No validators required here + // Add preprocessors + //Passing from servlet context for now but will have to see if there's a way to pass vreq + addPreprocessors(editConfiguration); + // Adding additional data, specifically edit mode + addFormSpecificData(editConfiguration, vreq); + // One override for basic functionality, changing url pattern + // and entity + // Adding term should return to this same page, not the subject + // Return takes the page back to the individual form + editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils + .getFormUrlWithoutContext(vreq)); + + editConfiguration.addValidator(new AntiXssValidation()); + + // prepare + prepare(vreq, editConfiguration); + return editConfiguration; + } + + //In this case, the generator is not equipped to handle any deletion + //Editing in the usual sense does not exist for this form + //So we will disable editing + @Override + void initObjectPropForm(EditConfigurationVTwo editConfiguration,VitroRequest vreq) { + editConfiguration.setObject( null ); + } + + //Ensuring that editing property logic does not get executed on processing + //since form's deletions are handled separately + @Override + void prepare(VitroRequest vreq, EditConfigurationVTwo editConfig) { + Model model = vreq.getJenaOntModel(); + //Set subject and predicate uri + if( editConfig.getSubjectUri() == null) + editConfig.setSubjectUri( EditConfigurationUtils.getSubjectUri(vreq)); + if( editConfig.getPredicateUri() == null ) + editConfig.setPredicateUri( EditConfigurationUtils.getPredicateUri(vreq)); + //Always set creation + editConfig.prepareForNonUpdate(model); + + } + + + private void setVarNames(EditConfigurationVTwo editConfiguration) { + editConfiguration.setVarNameForSubject("subject"); + editConfiguration.setVarNameForPredicate("predicate"); + //We are not including concept node here since + //we never actually "edit" using this form + //the n3 required and optional will still be evaluated based on the form + editConfiguration.setVarNameForObject("object"); + } + + protected void setTemplate(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.setTemplate(template); + + } + + + + /* + * N3 Required and Optional Generators as well as supporting methods + */ + + private String getPrefixesString() { + //TODO: Include dynamic way of including this + return "@prefix core: ."; + } + + //The only string always required is that linking the subject to the concept node + //Since the concept node from an external vocabulary may already be in the system + //The label and is defined by may already be defined and don't require re-saving + private List generateN3Required(VitroRequest vreq) { + List n3Required = list( + getPrefixesString() + "\n" + + "?subject ?predicate ?conceptNode .\n" + + "?conceptNode <" + RDF.type.getURI() + "> <" + this.SKOSConceptType + "> ." + ); + //"?conceptNode <" + RDF.type.getURI() + "> ." + + List inversePredicate = getInversePredicate(vreq); + //Adding inverse predicate if it exists + if(inversePredicate.size() > 0) { + n3Required.add("?conceptNode <" + inversePredicate.get(0) + "> ?subject ."); + } + return n3Required; + } + + //Optional N3, includes possibility of semantic type which may or may not be included + //label and source are independent of semantic type + //concept semantic type uri is a placeholder which is actually processed in the sparql update preprocessor + private List generateN3Optional() { + return list("?conceptNode <" + RDFS.label.getURI() + "> ?conceptLabel .\n" + + "?conceptNode <" + RDFS.isDefinedBy.getURI() + "> ?conceptSource .", + "?conceptNode <" + RDF.type + "> ?conceptSemanticTypeURI ." + + "?conceptSemanticTypeURI <" + RDFS.label.getURI() + "> ?conceptSemanticTypeLabel ." + + "?conceptSemanticTypeURI <" + RDFS.subClassOf + "> <" + SKOSConceptType + "> .", + "?conceptNode <" + this.SKOSNarrowerURI + "> ?conceptNarrowerURI ." + + "?conceptNarrowerURI <" + this.SKOSBroaderURI + "> ?conceptNode .", + "?conceptNode <" + this.SKOSBroaderURI + "> ?conceptBroaderURI ." + + "?conceptBroaderURI <" + this.SKOSNarrowerURI + "> ?conceptNode ." + ); + } + + + + + /* + * Get new resources + */ + private Map generateNewResources(VitroRequest vreq) { + HashMap newResources = new HashMap(); + //There are no new resources here, the concept node uri doesn't + //get created but already exists, and vocab uri should already exist as well + //Adding concept semantic type uri just to test - note this isn't really on the form at all + newResources.put("conceptSemanticTypeURI", null); + return newResources; + } + + + + + /* + * Set URIS and Literals In Scope and on form and supporting methods + */ + + private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap> urisInScope = new HashMap>(); + //note that at this point the subject, predicate, and object var parameters have already been processed + //these two were always set when instantiating an edit configuration object from json, + //although the json itself did not specify subject/predicate as part of uris in scope + urisInScope.put(editConfiguration.getVarNameForSubject(), + Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); + urisInScope.put(editConfiguration.getVarNameForPredicate(), + Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); + //Setting inverse role predicate + urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); + + + editConfiguration.setUrisInScope(urisInScope); + //Uris in scope include subject, predicate, and object var + //literals in scope empty initially, usually populated by code in prepare for update + //with existing values for variables + editConfiguration.setLiteralsInScope(new HashMap>()); + } + + private List getInversePredicate(VitroRequest vreq) { + List inversePredicateArray = new ArrayList(); + ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); + if(op != null && op.getURIInverse() != null) { + inversePredicateArray.add(op.getURIInverse()); + } + return inversePredicateArray; + } + + //n3 should look as follows + //?subject ?predicate ?objectVar + + private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + List urisOnForm = new ArrayList(); + List literalsOnForm = new ArrayList(); + //The URI of the node that defines the concept + urisOnForm.add("conceptNode"); + urisOnForm.add("conceptSource"); + urisOnForm.add("conceptSemanticTypeURI"); + urisOnForm.add("conceptBroaderURI"); + urisOnForm.add("conceptNarrowerURI"); + editConfiguration.setUrisOnform(urisOnForm); + //Also need to add the label of the concept + literalsOnForm.add("conceptLabel"); + literalsOnForm.add("conceptSemanticTypeLabel"); + + editConfiguration.setLiteralsOnForm(literalsOnForm); + } + + + /** + * Set SPARQL Queries and supporting methods + */ + + + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + //Sparql queries defining retrieval of literals etc. + editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); + editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); + editConfiguration.setSparqlForExistingLiterals(new HashMap()); + editConfiguration.setSparqlForExistingUris(new HashMap()); + } + + + /** + * + * Set Fields and supporting methods + */ + + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { + setConceptNodeField(editConfiguration, vreq); + setConceptLabelField(editConfiguration, vreq); + setVocabURIField(editConfiguration, vreq); + setConceptSemanticTypeURIField(editConfiguration,vreq); + setConceptSemanticTypeLabelField(editConfiguration,vreq); + setConceptBroaderURIField(editConfiguration, vreq); + setConceptNarrowerURIField(editConfiguration, vreq); + } + + private void setConceptNarrowerURIField( + EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptNarrowerURI")); + } + + private void setConceptBroaderURIField( + EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptBroaderURI")); + + } + + //this field will be hidden and include the concept node URI + private void setConceptNodeField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptNode"). + setValidators(list("nonempty"))); + } + + + + private void setVocabURIField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptSource")); + } + + + + private void setConceptLabelField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptLabel"). + setRangeDatatypeUri(XSD.xstring.toString()) + ); + } + + //This will also be a URI + private void setConceptSemanticTypeURIField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptSemanticTypeURI") + ); + } + + private void setConceptSemanticTypeLabelField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptSemanticTypeLabel"). + setRangeDatatypeUri(XSD.xstring.toString()) + ); + } + + + //Add preprocessor + + private void addPreprocessors(EditConfigurationVTwo editConfiguration) { + //An Edit submission preprocessor for enabling addition of multiple terms for a single search + //TODO: Check if this is the appropriate way of getting model + + //Passing model to check for any URIs that are present + + editConfiguration.addEditSubmissionPreprocessor( + new AddAssociatedConceptsPreprocessor(editConfiguration)); + editConfiguration.addModelChangePreprocessor(new ConceptSemanticTypesPreprocessor()); + + } + + + //Form specific data + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + //These are the concepts that already exist currently + formSpecificData.put("existingConcepts", getExistingConcepts(vreq)); + //Return url for adding user defined concept + formSpecificData.put("userDefinedConceptUrl", getUserDefinedConceptUrl(vreq)); + //Add URIs and labels for different services + formSpecificData.put("searchServices", ConceptSearchServiceUtils.getVocabSources()); + List inversePredicate = getInversePredicate(vreq); + if(inversePredicate.size() > 0) { + formSpecificData.put("inversePredicate", inversePredicate.get(0)); + } else { + formSpecificData.put("inversePredicate", ""); + } + editConfiguration.setFormSpecificData(formSpecificData); + } + + + // + private Object getUserDefinedConceptUrl(VitroRequest vreq) { + String subjectUri = EditConfigurationUtils.getSubjectUri(vreq); + String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); + String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddUserDefinedConceptGenerator"; + String editUrl = EditConfigurationUtils.getEditUrl(vreq); + + return editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + + "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + + "&editForm=" + UrlBuilder.urlEncode(generatorName); + } + + private List getExistingConcepts(VitroRequest vreq) { + Individual individual = EditConfigurationUtils.getSubjectIndividual(vreq); + List concepts = individual.getRelatedIndividuals( + EditConfigurationUtils.getPredicateUri(vreq)); + List associatedConcepts = getAssociatedConceptInfo(concepts, vreq); + sortConcepts(associatedConcepts); + return associatedConcepts; + } + + + private void sortConcepts(List concepts) { + concepts.sort(new AssociatedConceptInfoComparator()); + log.debug("Concepts should be sorted now" + concepts.toString()); + } + + + //To determine whether or not a concept is a user generated or one from an external vocab source. + //we cannot rely on whether or not it is a skos concept because incorporating UMLS semantic network classes as + //SKOS concept subclasses means that even concepts from an external vocab source might be considered SKOS concepts + //Instead, we will simply determine whether a concept is defined by an external vocabulary source and use that + //as the primary indicator of whether a concept is from an external vocabulary source or a user generated concept + private List getAssociatedConceptInfo( + List concepts, VitroRequest vreq) { + List info = new ArrayList(); + for ( Individual conceptIndividual : concepts ) { + boolean userGenerated = true; + //Note that this isn't technically + String conceptUri = conceptIndividual.getURI(); + String conceptLabel = conceptIndividual.getName(); + + //Check if defined by an external vocabulary source + List vocabList = conceptIndividual.getObjectPropertyStatements(RDFS.isDefinedBy.getURI()); + String vocabSource = null; + String vocabLabel = null; + if(vocabList != null && vocabList.size() > 0) { + userGenerated = false; + vocabSource = vocabList.get(0).getObjectURI(); + Individual sourceIndividual = EditConfigurationUtils.getIndividual(vreq, vocabSource); + //Assuming name will get label + vocabLabel = sourceIndividual.getName(); + } + + + + if(userGenerated) { + //if the concept in question is skos - which would imply a user generated concept + info.add(new AssociatedConceptInfo(conceptLabel, conceptUri, null, null, SKOSConceptType, null, null)); + } else { + String conceptSemanticTypeURI = null; + String conceptSemanticTypeLabel = null; + //Can a concept have multiple semantic types? Currently we are only returning the first one + //TODO: Change this into a sparql query that returns all types for the concept that are subclasses of SKOS concepts + HashMap typeAndLabel = this.getConceptSemanticTypeQueryResults(conceptIndividual.getURI(), ModelAccess.on(vreq).getOntModel()); + if(typeAndLabel.containsKey("semanticTypeURI")) { + conceptSemanticTypeURI = typeAndLabel.get("semanticTypeURI"); + } + if(typeAndLabel.containsKey("semanticTypeLabel")) { + conceptSemanticTypeLabel = typeAndLabel.get("semanticTypeLabel"); + } + + //Assuming this is from an external vocabulary source + info.add(new AssociatedConceptInfo(conceptLabel, conceptUri, vocabSource, vocabLabel, null, conceptSemanticTypeURI, conceptSemanticTypeLabel)); + + } + } + return info; + } + + private HashMap getConceptSemanticTypeQueryResults(String conceptURI, OntModel ontModel) { + HashMap typeAndLabel = new HashMap(); + String queryStr = "SELECT ?semanticTypeURI ?semanticTypeLabel WHERE { " + + "<" + conceptURI + "> <" + RDF.type.getURI() + "> ?semanticTypeURI . " + + "?semanticTypeURI <" + RDFS.subClassOf.getURI() + "> <" + this.SKOSConceptType + ">. " + + "?semanticTypeURI <" + RDFS.label.getURI() + "> ?semanticTypeLabel ." + + "}"; + QueryExecution qe = null; + try{ + Query query = QueryFactory.create(queryStr); + qe = QueryExecutionFactory.create(query, ontModel); + ResultSet results = null; + results = qe.execSelect(); + + while( results.hasNext()){ + QuerySolution qs = results.nextSolution(); + if(qs.get("semanticTypeURI") != null) { + Resource semanticTypeURI = qs.getResource("semanticTypeURI"); + log.debug("Semantic Type URI returned " + semanticTypeURI.getURI()); + typeAndLabel.put("semanticTypeURI", semanticTypeURI.getURI()); + } + if(qs.get("semanticTypeLabel") != null) { + Literal semanticTypeLabel = qs.getLiteral("semanticTypeLabel"); + log.debug("Semantic Type label returned " + semanticTypeLabel.getString()); + typeAndLabel.put("semanticTypeLabel", semanticTypeLabel.getString()); + } + + + } + }catch(Exception ex){ + throw new Error("Error in executing query string: \n" + queryStr + '\n' + ex.getMessage()); + }finally{ + if( qe != null) + qe.close(); + } + return typeAndLabel; + } + + public class AssociatedConceptInfo { + private String conceptLabel; + private String conceptURI; + private String vocabURI; + private String vocabLabel; + private String type; //In case of SKOS concept, will have skos concept type + private String conceptSemanticTypeURI; //For some services, such as UMLS, we have a semantic type associated + private String conceptSemanticTypeLabel; + public AssociatedConceptInfo(String inputLabel, String inputURI, String inputVocabURI, String inputVocabLabel, String inputType, String inputConceptSemanticTypeURI, String inputConceptSemanticTypeLabel) { + this.conceptLabel = inputLabel; + this.conceptURI = inputURI; + this.vocabURI = inputVocabURI; + this.vocabLabel = inputVocabLabel; + this.type = inputType; + this.conceptSemanticTypeURI = inputConceptSemanticTypeURI; + this.conceptSemanticTypeLabel = inputConceptSemanticTypeLabel; + } + + //Getters + public String getConceptLabel() { + return conceptLabel; + } + + public String getConceptURI() { + return conceptURI; + } + + public String getVocabURI() { + return vocabURI; + } + + public String getVocabLabel(){ + return vocabLabel; + } + + public String getType(){ + return type; + } + + public String getConceptSemanticTypeURI(){ + return conceptSemanticTypeURI; + } + + public String getConceptSemanticTypeLabel(){ + return conceptSemanticTypeLabel; + } + + } + + public class AssociatedConceptInfoComparator implements Comparator{ + public int compare(AssociatedConceptInfo concept1, AssociatedConceptInfo concept2) { + String concept1Label = concept1.getConceptLabel().toLowerCase(); + String concept2Label = concept2.getConceptLabel().toLowerCase(); + return concept1Label.compareTo(concept2Label); + } + } + + + + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAttendeeRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAttendeeRoleToPersonGenerator.java index be52c3d1..69ad7422 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAttendeeRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAttendeeRoleToPersonGenerator.java @@ -1,67 +1,67 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; - -public class AddAttendeeRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - - private static String TEMPLATE = "addAttendeeRoleToPerson.ftl"; - - @Override - String getTemplate(){ return TEMPLATE; } - - @Override - String getRoleType() { - return "http://vivoweb.org/ontology/core#AttendeeRole"; - } - - /** Editor role involves hard-coded options for the "right side" of the role or activity. */ - @Override - FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { - return new ConstantFieldOptions( - "", "Select type", - "http://purl.org/NET/c4dm/event.owl#Event", "Event", - "http://vivoweb.org/ontology/core#Competition", "Competition", - "http://purl.org/ontology/bibo/Conference", "Conference", - "http://vivoweb.org/ontology/core#Course", "Course", - "http://vivoweb.org/ontology/core#Exhibit", "Exhibit", - "http://purl.org/ontology/bibo/Hearing", "Hearing", - "http://purl.org/ontology/bibo/Interview", "Interview", - "http://vivoweb.org/ontology/core#Meeting", "Meeting", - "http://purl.org/ontology/bibo/Performance", "Performance", - "http://vivoweb.org/ontology/core#Presentation", "Presentation", - "http://vivoweb.org/ontology/core#InvitedTalk", "Invited Talk", - "http://purl.org/ontology/bibo/Workshop", "Workshop", - "http://vivoweb.org/ontology/core#EventSeries", "Event Series", - "http://vivoweb.org/ontology/core#ConferenceSeries", "Conference Series", - "http://vivoweb.org/ontology/core#SeminarSeries", "Seminar Series", - "http://vivoweb.org/ontology/core#WorkshopSeries", "Workshop Series" - ); - } - - @Override - boolean isShowRoleLabelField() { - return false; - } - - /* - * Use the methods below to change the date/time precision in the - * custom form associated with this generator. When not used, the - * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, - * MINUTE, TIME and NONE. - */ - /* - public String getStartDatePrecision() { - String precision = VitroVocabulary.Precision.MONTH.uri(); - return precision; - } - - public String getEndDatePrecision() { - String precision = VitroVocabulary.Precision.DAY.uri(); - return precision; - } - */ -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; + +public class AddAttendeeRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { + + private static String TEMPLATE = "addAttendeeRoleToPerson.ftl"; + + @Override + String getTemplate(){ return TEMPLATE; } + + @Override + String getRoleType() { + return "http://vivoweb.org/ontology/core#AttendeeRole"; + } + + /** Editor role involves hard-coded options for the "right side" of the role or activity. */ + @Override + FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { + return new ConstantFieldOptions( + "", "Select type", + "http://purl.org/NET/c4dm/event.owl#Event", "Event", + "http://vivoweb.org/ontology/core#Competition", "Competition", + "http://purl.org/ontology/bibo/Conference", "Conference", + "http://vivoweb.org/ontology/core#Course", "Course", + "http://vivoweb.org/ontology/core#Exhibit", "Exhibit", + "http://purl.org/ontology/bibo/Hearing", "Hearing", + "http://purl.org/ontology/bibo/Interview", "Interview", + "http://vivoweb.org/ontology/core#Meeting", "Meeting", + "http://purl.org/ontology/bibo/Performance", "Performance", + "http://vivoweb.org/ontology/core#Presentation", "Presentation", + "http://vivoweb.org/ontology/core#InvitedTalk", "Invited Talk", + "http://purl.org/ontology/bibo/Workshop", "Workshop", + "http://vivoweb.org/ontology/core#EventSeries", "Event Series", + "http://vivoweb.org/ontology/core#ConferenceSeries", "Conference Series", + "http://vivoweb.org/ontology/core#SeminarSeries", "Seminar Series", + "http://vivoweb.org/ontology/core#WorkshopSeries", "Workshop Series" + ); + } + + @Override + boolean isShowRoleLabelField() { + return false; + } + + /* + * Use the methods below to change the date/time precision in the + * custom form associated with this generator. When not used, the + * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, + * MINUTE, TIME and NONE. + */ + /* + public String getStartDatePrecision() { + String precision = VitroVocabulary.Precision.MONTH.uri(); + return precision; + } + + public String getEndDatePrecision() { + String precision = VitroVocabulary.Precision.DAY.uri(); + return precision; + } + */ +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java index baf0b552..83762677 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddAuthorsToInformationResourceGenerator.java @@ -35,9 +35,9 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. /** * This is a slightly unusual generator that is used by Manage Authors on - * information resources. + * information resources. * - * It is intended to always be an add, and never an update. + * It is intended to always be an add, and never an update. */ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { public static Log log = LogFactory.getLog(AddAuthorsToInformationResourceGenerator.class); @@ -45,7 +45,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); initBasics(editConfiguration, vreq); initPropertyParameters(vreq, session, editConfiguration); @@ -53,22 +53,22 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator setUrlToReturnTo(editConfiguration, vreq); //set variable names - editConfiguration.setVarNameForSubject("infoResource"); - editConfiguration.setVarNameForPredicate("predicate"); - editConfiguration.setVarNameForObject("authorshipUri"); + editConfiguration.setVarNameForSubject("infoResource"); + editConfiguration.setVarNameForPredicate("predicate"); + editConfiguration.setVarNameForObject("authorshipUri"); // Required N3 - editConfiguration.setN3Required( list( getN3NewAuthorship() ) ); + editConfiguration.setN3Required( list( getN3NewAuthorship() ) ); - // Optional N3 - editConfiguration.setN3Optional( generateN3Optional()); + // Optional N3 + editConfiguration.setN3Optional( generateN3Optional()); editConfiguration.addNewResource("authorshipUri", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("newPerson", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("newOrg", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("vcardPerson", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("vcardName", DEFAULT_NS_TOKEN); - + //In scope setUrisAndLiteralsInScope(editConfiguration, vreq); @@ -88,121 +88,121 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator //Adding additional data, specifically edit mode addFormSpecificData(editConfiguration, vreq); - + editConfiguration.addValidator(new AntiXssValidation()); - - //NOITCE this generator does not run prepare() since it + + //NOITCE this generator does not run prepare() since it //is never an update and has no SPARQL for existing - + return editConfiguration; } - + private void setUrlToReturnTo(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); + editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); } - + /***N3 strings both required and optional***/ - + public String getN3PrefixString() { - return "@prefix core: <" + vivoCore + "> .\n" + + return "@prefix core: <" + vivoCore + "> .\n" + "@prefix foaf: <" + foaf + "> . \n" ; } - + private String getN3NewAuthorship() { - return getN3PrefixString() + - "?authorshipUri a core:Authorship ;\n" + - " core:relates ?infoResource .\n" + + return getN3PrefixString() + + "?authorshipUri a core:Authorship ;\n" + + " core:relates ?infoResource .\n" + "?infoResource core:relatedBy ?authorshipUri ."; } - + private String getN3AuthorshipRank() { - return getN3PrefixString() + + return getN3PrefixString() + "?authorshipUri core:rank ?rank ."; } - + //first name, middle name, last name, and new perseon for new author being created, and n3 for existing person //if existing person selected as author public List generateN3Optional() { return list( getN3NewPersonFirstName() , getN3NewPersonMiddleName(), - getN3NewPersonLastName(), + getN3NewPersonLastName(), getN3NewPerson(), getN3AuthorshipRank(), getN3ForExistingPerson(), getN3NewOrg(), getN3ForExistingOrg()); - + } - - + + private String getN3NewPersonFirstName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; } - + private String getN3NewPersonMiddleName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a vcard:Individual . \n" + + "?vcardPerson a vcard:Individual . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a vcard:Name . \n" + + "?vcardName a vcard:Name . \n" + "?vcardName ?middleName ."; } - + private String getN3NewPersonLastName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; } - + private String getN3NewPerson() { - return getN3PrefixString() + - "?newPerson a foaf:Person ;\n" + - "<" + RDFS.label.getURI() + "> ?label .\n" + - "?authorshipUri core:relates ?newPerson .\n" + + return getN3PrefixString() + + "?newPerson a foaf:Person ;\n" + + "<" + RDFS.label.getURI() + "> ?label .\n" + + "?authorshipUri core:relates ?newPerson .\n" + "?newPerson core:relatedBy ?authorshipUri . "; } - + private String getN3ForExistingPerson() { - return getN3PrefixString() + - "?authorshipUri core:relates ?personUri .\n" + + return getN3PrefixString() + + "?authorshipUri core:relates ?personUri .\n" + "?personUri core:relatedBy ?authorshipUri ."; } - + private String getN3NewOrg() { - return getN3PrefixString() + - "?newOrg a foaf:Organization ;\n" + - "<" + RDFS.label.getURI() + "> ?orgName .\n" + - "?authorshipUri core:relates ?newOrg .\n" + + return getN3PrefixString() + + "?newOrg a foaf:Organization ;\n" + + "<" + RDFS.label.getURI() + "> ?orgName .\n" + + "?authorshipUri core:relates ?newOrg .\n" + "?newOrg core:relatedBy ?authorshipUri . "; } - + private String getN3ForExistingOrg() { - return getN3PrefixString() + - "?authorshipUri core:relates ?orgUri .\n" + + return getN3PrefixString() + + "?authorshipUri core:relates ?orgUri .\n" + "?orgUri core:relatedBy ?authorshipUri ."; } /** Get new resources */ //A new authorship uri will always be created when an author is added //A new person may be added if a person not in the system will be added as author - private Map generateNewResources(VitroRequest vreq) { - - - HashMap newResources = new HashMap(); + private Map generateNewResources(VitroRequest vreq) { + + + HashMap newResources = new HashMap(); newResources.put("authorshipUri", DEFAULT_NS_TOKEN); newResources.put("newPerson", DEFAULT_NS_TOKEN); newResources.put("vcardPerson", DEFAULT_NS_TOKEN); @@ -210,26 +210,26 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator newResources.put("newOrg", DEFAULT_NS_TOKEN); return newResources; } - - /** Set URIS and Literals In Scope and on form and supporting methods */ + + /** Set URIS and Literals In Scope and on form and supporting methods */ private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { //Uris in scope always contain subject and predicate HashMap> urisInScope = new HashMap>(); - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); editConfiguration.setUrisInScope(urisInScope); - //no literals in scope + //no literals in scope } - + public void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); + List urisOnForm = new ArrayList(); //If an existing person is being used as an author, need to get the person uri urisOnForm.add("personUri"); urisOnForm.add("orgUri"); editConfiguration.setUrisOnform(urisOnForm); - + //for person who is not in system, need to add first name, last name and middle name //Also need to store authorship rank and label of author List literalsOnForm = list("firstName", @@ -239,10 +239,10 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator "orgName", "label"); editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - /** Set SPARQL Queries and supporting methods. */ - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + } + + /** Set SPARQL Queries and supporting methods. */ + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { //Sparql queries are all empty for existing values //This form is different from the others that it gets multiple authors on the same page //and that information will be queried and stored in the additional form specific data @@ -252,12 +252,12 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); } - + /** - * + * * Set Fields and supporting methods */ - + public void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { setLabelField(editConfiguration); setFirstNameField(editConfiguration); @@ -268,7 +268,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator setOrgUriField(editConfiguration); setOrgNameField(editConfiguration); } - + private void setLabelField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("label"). @@ -333,7 +333,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator setRangeDatatypeUri(XSD.xstring.toString()) ); } - + //Form specific data public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); @@ -418,27 +418,27 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator + "WHERE { { \n" + " ?subject core:relatedBy ?authorshipURI . \n" + " ?authorshipURI a core:Authorship . \n" - + " ?authorshipURI core:relates ?authorURI . \n" + + " ?authorshipURI core:relates ?authorURI . \n" + " ?authorURI a foaf:Agent . \n" + " OPTIONAL { ?authorURI rdfs:label ?authorName } \n" - + " OPTIONAL { ?authorshipURI core:rank ?rank } \n" - + "} UNION { \n" - + " ?subject core:relatedBy ?authorshipURI . \n" - + " ?authorshipURI a core:Authorship . \n" - + " ?authorshipURI core:relates ?authorURI . \n" - + " ?authorURI a vcard:Individual . \n" - + " ?authorURI vcard:hasName ?vName . \n" - + " ?vName vcard:givenName ?firstName . \n" - + " ?vName vcard:familyName ?lastName . \n" - + " OPTIONAL { ?vName core:middleName ?middleName . } \n" - + " OPTIONAL { ?authorshipURI core:rank ?rank } \n" - + " bind ( COALESCE(?firstName, \"\") As ?firstName1) . \n" - + " bind ( COALESCE(?middleName, \"\") As ?middleName1) . \n" - + " bind ( COALESCE(?lastName, \"\") As ?lastName1) . \n" - + " bind (concat(str(?lastName1 + \", \"),str(?middleName1 + \" \"),str(?firstName1)) as ?authorName) . \n" + + " OPTIONAL { ?authorshipURI core:rank ?rank } \n" + + "} UNION { \n" + + " ?subject core:relatedBy ?authorshipURI . \n" + + " ?authorshipURI a core:Authorship . \n" + + " ?authorshipURI core:relates ?authorURI . \n" + + " ?authorURI a vcard:Individual . \n" + + " ?authorURI vcard:hasName ?vName . \n" + + " ?vName vcard:givenName ?firstName . \n" + + " ?vName vcard:familyName ?lastName . \n" + + " OPTIONAL { ?vName core:middleName ?middleName . } \n" + + " OPTIONAL { ?authorshipURI core:rank ?rank } \n" + + " bind ( COALESCE(?firstName, \"\") As ?firstName1) . \n" + + " bind ( COALESCE(?middleName, \"\") As ?middleName1) . \n" + + " bind ( COALESCE(?lastName, \"\") As ?lastName1) . \n" + + " bind (concat(str(?lastName1 + \", \"),str(?middleName1 + \" \"),str(?firstName1)) as ?authorName) . \n" + "} } ORDER BY ?rank"; - - + + private List getExistingAuthorships(String subjectUri, VitroRequest vreq) { RDFService rdfService = vreq.getRDFService(); @@ -448,7 +448,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator Model constructedModel = ModelFactory.createDefaultModel(); rdfService.sparqlConstructQuery(constructStr, constructedModel); - + String queryStr = QueryUtils.subUriForQueryVar(this.getAuthorshipsQuery(), "subject", subjectUri); log.debug("Query string is: " + queryStr); @@ -467,7 +467,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator } } catch (Exception e) { log.error(e, e); - } + } authorships = QueryUtils.removeDuplicatesMapsFromList(authorships, "authorShipURI", "authorURI"); log.debug("authorships = " + authorships); return getAuthorshipInfo(authorships); @@ -480,22 +480,22 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator + " ?authorship a core:Authorship . \n" + " ?authorship core:rank ?rank .\n" + "} ORDER BY DESC(?rank) LIMIT 1"; - + private int getMaxRank(String subjectUri, VitroRequest vreq) { - int maxRank = 0; // default value + int maxRank = 0; // default value String queryStr = QueryUtils.subUriForQueryVar(this.getMaxRankQueryStr(), "subject", subjectUri); log.debug("maxRank query string is: " + queryStr); try { ResultSet results = QueryUtils.getQueryResults(queryStr, vreq); if (results != null && results.hasNext()) { // there is at most one result - QuerySolution soln = results.next(); + QuerySolution soln = results.next(); RDFNode node = soln.get("rank"); if (node != null && node.isLiteral()) { - // node.asLiteral().getInt() won't return an xsd:string that + // node.asLiteral().getInt() won't return an xsd:string that // can be parsed as an int. int rank = Integer.parseInt(node.asLiteral().getLexicalForm()); - if (rank > maxRank) { + if (rank > maxRank) { log.debug("setting maxRank to " + rank); maxRank = rank; } @@ -549,8 +549,8 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator //Author information for authorship node private String authorUri; private String authorName; - - public AuthorshipInfo(String inputAuthorshipUri, + + public AuthorshipInfo(String inputAuthorshipUri, String inputAuthorshipName, String inputAuthorUri, String inputAuthorName) { @@ -560,25 +560,25 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator authorName = inputAuthorName; } - + //Getters - specifically required for Freemarker template's access to POJO public String getAuthorshipUri() { return authorshipUri; } - + public String getAuthorshipName() { return authorshipName; } - + public String getAuthorUri() { return authorUri; } - + public String getAuthorName() { return authorName; } } - + static final String DEFAULT_NS_TOKEN=null; //null forces the default NS protected String getMaxRankQueryStr() { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddClinicalRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddClinicalRoleToPersonGenerator.java index 3d086a64..1586860f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddClinicalRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddClinicalRoleToPersonGenerator.java @@ -7,28 +7,28 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantField import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddClinicalRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - + private static String template = "addClinicalRoleToPerson.ftl"; - + //Should this be overridden @Override - String getTemplate() { - return template; + String getTemplate() { + return template; } @Override String getRoleType() { return "http://vivoweb.org/ontology/core#ClinicalRole"; } - + /** Clinical role involves hard-coded options for the "right side" of the role or activity. */ @Override - FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { + FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { return new ConstantFieldOptions( - "", "Select one", - "http://vivoweb.org/ontology/core#Project", "Project", + "", "Select one", + "http://vivoweb.org/ontology/core#Project", "Project", "http://purl.obolibrary.org/obo/ERO_0000005", "Service" - ); + ); } //isShowRoleLabelField remains true for this so doesn't need to be overwritten @@ -38,7 +38,7 @@ public class AddClinicalRoleToPersonGenerator extends AddRoleToPersonTwoStageGen } - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -54,6 +54,6 @@ public class AddClinicalRoleToPersonGenerator extends AddRoleToPersonTwoStageGen String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } - */ - + */ + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java index 6f27292b..4f081415 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java @@ -22,14 +22,14 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaSearchQueryOptions; /** - * This generator is for the case where a new concept is being added for an object property other than research/subject areas where the + * This generator is for the case where a new concept is being added for an object property other than research/subject areas where the * default object property form generator would work instead of the generator for managing concepts. * In this case, we don't want the dropdown list for types for "add a new item of this type" to show concept subclasses, so we are overriding * the fields to just include the Concept class. */ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPropertyFormGenerator implements EditConfigurationGenerator { - private Log log = LogFactory.getLog(AddConceptThroughObjectPropertyGenerator.class); + private Log log = LogFactory.getLog(AddConceptThroughObjectPropertyGenerator.class); @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, @@ -44,7 +44,7 @@ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPrope } return editConfig; } - + private HashMap getCreateNewTypesOptions(VitroRequest vreq) { HashMap options = new HashMap(); List rangeTypes = getRangeTypes(vreq); @@ -53,7 +53,7 @@ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPrope } return options; } - + //We will override range types as well so that autocomplete and other fields dependent on range //will only consider the main concept type to be the range type @Override @@ -73,44 +73,44 @@ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPrope if (rangeUri != null) { VClass rangeVClass = ctxDaoFact.getVClassDao().getVClassByURI(rangeUri); if (!rangeVClass.isUnion()) { - types.add(rangeVClass); + types.add(rangeVClass); } else { types.addAll(rangeVClass.getUnionComponents()); } return types; } else { - //This should never happen + //This should never happen log.warn("Range not found for this property so employing SKOS concept class"); String vclassURI = "http://www.w3.org/2004/02/skos/core#Concept"; VClass rangeVClass = ctxDaoFact.getVClassDao().getVClassByURI(vclassURI); types.add(rangeVClass); } - + return types; - } - + } + //Should override the method in default object property private String getTemplate( VitroRequest vreq) { - + String acObjectPropertyTemplate = "addConceptThroughObjectPropertyAutoComplete.ftl"; String objectPropertyTemplate = "addConceptThroughObjectPropertyForm.ftl"; String template = objectPropertyTemplate; if( doAutoComplete ) template = acObjectPropertyTemplate; return template; - + } - + @Override protected void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri, List rangeTypes) throws Exception { FieldVTwo field = new FieldVTwo(); - field.setName("objectVar"); - + field.setName("objectVar"); + List validators = new ArrayList(); validators.add("nonempty"); field.setValidators(validators); - + if( ! doAutoComplete ){ List types = new ArrayList(); for(VClass v: rangeTypes) { @@ -125,11 +125,11 @@ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPrope }else{ field.setOptions(null); } - + Map fields = new HashMap(); - fields.put(field.getName(), field); - + fields.put(field.getName(), field); + editConfiguration.setFields(fields); - } + } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java index 9fd9cc60..e5ddfc96 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java @@ -24,8 +24,8 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. /** Custom form for adding or editing a webpage associated with an individual. The primary page, -ManageWebpagesForIndividual, should forward to this page if: (a) we are adding a new page, or -(b) an edit link in the Manage Webpages view has been clicked. But right now (a) is not implemented. +ManageWebpagesForIndividual, should forward to this page if: (a) we are adding a new page, or +(b) an edit link in the Manage Webpages view has been clicked. But right now (a) is not implemented. */ @@ -40,41 +40,41 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator prepare(vreq, config); return config; } - + //Have broken this method down into two portions to allow for overriding of edit configuration //without having to copy the entire method and before prepare is called - - protected EditConfigurationVTwo setupConfig(VitroRequest vreq, HttpSession session) throws Exception{ - + + protected EditConfigurationVTwo setupConfig(VitroRequest vreq, HttpSession session) throws Exception{ + EditConfigurationVTwo config = new EditConfigurationVTwo(); - + config.setTemplate(this.getTemplate()); - + initBasics(config, vreq); initPropertyParameters(vreq, session, config); - initObjectPropForm(config, vreq); + initObjectPropForm(config, vreq); String linkUri = getLinkUri(vreq); String domainUri = vreq.getParameter("domainUri"); String vcardIndividualType = "http://www.w3.org/2006/vcard/ns#Kind"; - + config.setVarNameForSubject("subject"); config.setVarNameForObject("vcard"); - + config.addNewResource("vcard", DEFAULT_NS_FOR_NEW_RESOURCE); config.addNewResource("link", DEFAULT_NS_FOR_NEW_RESOURCE); - + config.setN3Required(list( this.getN3ForWebpage(), N3_FOR_URLTYPE )); config.setN3Optional(list( N3_FOR_ANCHOR, N3_FOR_RANK)); - + config.addUrisInScope("webpageProperty", list( "http://purl.obolibrary.org/obo/ARG_2000028" )); config.addUrisInScope("inverseProperty", list( "http://purl.obolibrary.org/obo/ARG_2000029" )); config.addUrisInScope("linkUrlPredicate", list( "http://www.w3.org/2006/vcard/ns#url" )); config.addUrisInScope("linkLabelPredicate", list( "http://www.w3.org/2000/01/rdf-schema#label" )); config.addUrisInScope("rankPredicate", list( core + "rank")); config.addUrisInScope("vcardType", list( vcardIndividualType )); - - + + if ( config.isUpdate() ) { config.addUrisInScope("link", list( linkUri )); } @@ -87,45 +87,45 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator } } config.addSparqlForAdditionalUrisInScope("vcard", individualVcardQuery); - + config.setUrisOnForm("urlType"); config.setLiteralsOnForm(list("url","label","rank")); - + config.addSparqlForExistingLiteral("url", URL_QUERY); config.addSparqlForExistingLiteral("label", ANCHOR_QUERY); config.addSparqlForExistingLiteral("rank", MAX_RANK_QUERY); config.addSparqlForExistingUris("urlType", URLTYPE_QUERY); - + config.addField(new FieldVTwo(). setName("url"). setValidators(list("nonempty", "datatype:"+XSD.anyURI.toString(), "httpUrl")). setRangeDatatypeUri(XSD.anyURI.toString())); - + config.addField( new FieldVTwo(). setName("urlType"). setValidators( list("nonempty") ). - setOptions( + setOptions( new ChildVClassesWithParent("http://www.w3.org/2006/vcard/ns#URL"))); - + config.addField(new FieldVTwo(). setName("label")); - + config.addField(new FieldVTwo(). setName("rank"). setRangeDatatypeUri(XSD.xint.toString())); - - config.addFormSpecificData("newRank", - getMaxRank( EditConfigurationUtils.getObjectUri(vreq), + + config.addFormSpecificData("newRank", + getMaxRank( EditConfigurationUtils.getObjectUri(vreq), EditConfigurationUtils.getSubjectUri(vreq), vreq ) + 1 ); - + config.addValidator(new AntiXssValidation()); - + //might be null config.addFormSpecificData("subjectName", getName( config, vreq)); return config; } - + /** may be null */ private Object getName(EditConfigurationVTwo config, VitroRequest vreq) { Individual ind = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(config.getSubjectUri()); @@ -136,40 +136,40 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator } /* ********* N3 Assertions *********** */ - static String N3_FOR_WEBPAGE = + static String N3_FOR_WEBPAGE = "?subject ?webpageProperty ?vcard . \n"+ "?vcard ?inverseProperty ?subject . \n"+ "?vcard a ?vcardType . \n" + "?vcard ?link ."+ "?link a . \n" + - "?link ?linkUrlPredicate ?url ."; - + "?link ?linkUrlPredicate ?url ."; + static String N3_FOR_URLTYPE = "?link a ?urlType ."; static String N3_FOR_ANCHOR = "?link ?linkLabelPredicate ?label ."; - - static String N3_FOR_RANK = + + static String N3_FOR_RANK = "?link ?rankPredicate ?rank ."; /* *********** SPARQL queries for existing values ************** */ - - static String URL_QUERY = + + static String URL_QUERY = "SELECT ?urlExisting WHERE { ?link ?linkUrlPredicate ?urlExisting }"; - - static String URLTYPE_QUERY = + + static String URLTYPE_QUERY = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + "SELECT ?linkClassExisting WHERE { ?link vitro:mostSpecificType ?linkClassExisting }"; - - static String ANCHOR_QUERY = + + static String ANCHOR_QUERY = "SELECT ?labelExisting WHERE { ?link ?linkLabelPredicate ?labelExisting }"; static String RANK_QUERY = "SELECT ?rankExisting WHERE { ?link ?rankPredicate ?rankExisting }"; - + static String core = "http://vivoweb.org/ontology/core#"; - + static String individualVcardQuery = "SELECT ?existingVcard WHERE { \n" + "?subject ?existingVcard . \n" + @@ -177,7 +177,7 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator /* Note on ordering by rank in sparql: if there is a non-integer value on a link, that will be returned, * since it's ranked highest. Preventing that would require getting all the ranks and sorting in Java, - * throwing out non-int values. + * throwing out non-int values. */ private static String MAX_RANK_QUERY = "" + "PREFIX core: \n" @@ -187,23 +187,23 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator + " ?vcard vcard:hasURL ?link . \n" + " ?link core:rank ?rank .\n" + "} ORDER BY DESC(?rank) LIMIT 1"; - + private int getMaxRank(String objectUri, String subjectUri, VitroRequest vreq) { - int maxRank = 0; // default value - if (objectUri == null) { // adding new webpage + int maxRank = 0; // default value + if (objectUri == null) { // adding new webpage String queryStr = QueryUtils.subUriForQueryVar(this.getMaxRankQueryStr(), "subject", subjectUri); log.debug("Query string is: " + queryStr); try { ResultSet results = QueryUtils.getQueryResults(queryStr, vreq); if (results != null && results.hasNext()) { // there is at most one result - QuerySolution soln = results.next(); + QuerySolution soln = results.next(); RDFNode node = soln.get("rank"); if (node != null && node.isLiteral()) { - // node.asLiteral().getInt() won't return an xsd:string that + // node.asLiteral().getInt() won't return an xsd:string that // can be parsed as an int. int rank = Integer.parseInt(node.asLiteral().getLexicalForm()); - if (rank > maxRank) { + if (rank > maxRank) { log.debug("setting maxRank to " + rank); maxRank = rank; } @@ -217,11 +217,11 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator } return maxRank; } - + protected String getTemplate() { return formTemplate; } - + protected String getMaxRankQueryStr() { return MAX_RANK_QUERY; } @@ -238,8 +238,8 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator String rangeUri = (String) vreq.getParameter("rangeUri"); String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"; String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq); - String returnPath = editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + - "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + + String returnPath = editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + + "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + "&editForm=" + UrlBuilder.urlEncode(generatorName); if(domainUri != null && !domainUri.isEmpty()) { returnPath += "&domainUri=" + UrlBuilder.urlEncode(domainUri); @@ -248,12 +248,12 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator returnPath += "&rangeUri=" + UrlBuilder.urlEncode(rangeUri); } return returnPath; - + } private String getLinkUri(VitroRequest vreq) { - String linkUri = vreq.getParameter("linkUri"); - + String linkUri = vreq.getParameter("linkUri"); + return linkUri; } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorRoleToPersonGenerator.java index 4563bfdb..fcfc66a8 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorRoleToPersonGenerator.java @@ -6,36 +6,36 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; /** - * Generates the edit configuration for adding a Role to a Person. - - Stage one is selecting the type of the non-person thing - associated with the Role with the intention of reducing the + * Generates the edit configuration for adding a Role to a Person. + + Stage one is selecting the type of the non-person thing + associated with the Role with the intention of reducing the number of Individuals that the user has to select from. Stage two is selecting the non-person Individual to associate - with the Role. + with the Role. This is intended to create a set of statements like: ?person core:hasResearchActivityRole ?newRole. - ?newRole rdf:type core:ResearchActivityRole ; + ?newRole rdf:type core:ResearchActivityRole ; roleToActivityPredicate ?someActivity . ?someActivity rdf:type core:ResearchActivity . ?someActivity rdfs:label "activity title" . - - + + Each subclass of the abstract two stage Generator class will have the option of overriding certain methods, and must always implement the following methods: getRoleType getRoleActivityTypeOptionsType getRoleActivityTypeObjectClassUri getRoleActivityTypeLiteralOptions - + * */ public class AddEditorRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { private static String TEMPLATE = "addEditorRoleToPerson.ftl"; private static String OPTION_CLASS_URI = "http://purl.org/ontology/bibo/Collection"; - + @Override String getTemplate(){ return TEMPLATE; } @@ -49,12 +49,12 @@ public class AddEditorRoleToPersonGenerator extends AddRoleToPersonTwoStageGener return new ChildVClassesOptions(OPTION_CLASS_URI) .setDefaultOptionLabel("Select type"); } - + /** Do not show the role label field for the AddEditorRoleToPerson form */ - @Override + @Override boolean isShowRoleLabelField() { return true; } - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -70,5 +70,5 @@ public class AddEditorRoleToPersonGenerator extends AddRoleToPersonTwoStageGener String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } -*/ +*/ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java index dad9147f..a7946517 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorsToInformationResourceGenerator.java @@ -35,9 +35,9 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. /** * This is a slightly unusual generator that is used by Manage Editors on - * information resources. + * information resources. * - * It is intended to always be an add, and never an update. + * It is intended to always be an add, and never an update. */ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { public static Log log = LogFactory.getLog(AddEditorsToInformationResourceGenerator.class); @@ -45,7 +45,7 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); initBasics(editConfiguration, vreq); initPropertyParameters(vreq, session, editConfiguration); @@ -53,21 +53,21 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator setUrlToReturnTo(editConfiguration, vreq); //set variable names - editConfiguration.setVarNameForSubject("infoResource"); - editConfiguration.setVarNameForPredicate("predicate"); - editConfiguration.setVarNameForObject("editorshipUri"); + editConfiguration.setVarNameForSubject("infoResource"); + editConfiguration.setVarNameForPredicate("predicate"); + editConfiguration.setVarNameForObject("editorshipUri"); // Required N3 - editConfiguration.setN3Required( list( getN3NewEditorship() ) ); + editConfiguration.setN3Required( list( getN3NewEditorship() ) ); - // Optional N3 - editConfiguration.setN3Optional( generateN3Optional()); + // Optional N3 + editConfiguration.setN3Optional( generateN3Optional()); editConfiguration.addNewResource("editorshipUri", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("newPerson", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("vcardPerson", DEFAULT_NS_TOKEN); editConfiguration.addNewResource("vcardName", DEFAULT_NS_TOKEN); - + //In scope setUrisAndLiteralsInScope(editConfiguration, vreq); @@ -87,130 +87,130 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator //Adding additional data, specifically edit mode addFormSpecificData(editConfiguration, vreq); - + editConfiguration.addValidator(new AntiXssValidation()); - - //NOITCE this generator does not run prepare() since it + + //NOITCE this generator does not run prepare() since it //is never an update and has no SPARQL for existing - + return editConfiguration; } - + private void setUrlToReturnTo(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); + editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); } - + /***N3 strings both required and optional***/ - + public String getN3PrefixString() { - return "@prefix core: <" + vivoCore + "> .\n" + + return "@prefix core: <" + vivoCore + "> .\n" + "@prefix foaf: <" + foaf + "> . \n" ; } - + private String getN3NewEditorship() { - return getN3PrefixString() + - "?editorshipUri a core:Editorship ;\n" + - " core:relates ?infoResource .\n" + + return getN3PrefixString() + + "?editorshipUri a core:Editorship ;\n" + + " core:relates ?infoResource .\n" + "?infoResource core:relatedBy ?editorshipUri ."; } - + private String getN3EditorshipRank() { - return getN3PrefixString() + + return getN3PrefixString() + "?editorshipUri core:editorRank ?rank ."; } - + //first name, middle name, last name, and new perseon for new editor being created, and n3 for existing person //if existing person selected as editor public List generateN3Optional() { return list( getN3NewPersonFirstName() , getN3NewPersonMiddleName(), - getN3NewPersonLastName(), + getN3NewPersonLastName(), getN3NewPerson(), getN3EditorshipRank(), getN3ForExistingPerson()); } - - + + private String getN3NewPersonFirstName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; } - + private String getN3NewPersonMiddleName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a vcard:Individual . \n" + + "?vcardPerson a vcard:Individual . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a vcard:Name . \n" + + "?vcardName a vcard:Name . \n" + "?vcardName ?middleName ."; } - + private String getN3NewPersonLastName() { - return getN3PrefixString() + + return getN3PrefixString() + "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; } - + private String getN3NewPerson() { - return getN3PrefixString() + - "?newPerson a foaf:Person ;\n" + - "<" + RDFS.label.getURI() + "> ?label .\n" + - "?editorshipUri core:relates ?newPerson .\n" + + return getN3PrefixString() + + "?newPerson a foaf:Person ;\n" + + "<" + RDFS.label.getURI() + "> ?label .\n" + + "?editorshipUri core:relates ?newPerson .\n" + "?newPerson core:relatedBy ?editorshipUri . "; } - + private String getN3ForExistingPerson() { - return getN3PrefixString() + - "?editorshipUri core:relates ?personUri .\n" + + return getN3PrefixString() + + "?editorshipUri core:relates ?personUri .\n" + "?personUri core:relatedBy ?editorshipUri ."; } - + /** Get new resources */ //A new editorship uri will always be created when an editor is added //A new person may be added if a person not in the system will be added as editor - private Map generateNewResources(VitroRequest vreq) { - - - HashMap newResources = new HashMap(); + private Map generateNewResources(VitroRequest vreq) { + + + HashMap newResources = new HashMap(); newResources.put("editorshipUri", DEFAULT_NS_TOKEN); newResources.put("newPerson", DEFAULT_NS_TOKEN); newResources.put("vcardPerson", DEFAULT_NS_TOKEN); newResources.put("vcardName", DEFAULT_NS_TOKEN); return newResources; } - - /** Set URIS and Literals In Scope and on form and supporting methods */ + + /** Set URIS and Literals In Scope and on form and supporting methods */ private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { //Uris in scope always contain subject and predicate HashMap> urisInScope = new HashMap>(); - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); editConfiguration.setUrisInScope(urisInScope); - //no literals in scope + //no literals in scope } - + public void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); + List urisOnForm = new ArrayList(); //If an existing person is being used as an editor, need to get the person uri urisOnForm.add("personUri"); editConfiguration.setUrisOnform(urisOnForm); - + //for person who is not in system, need to add first name, last name and middle name //Also need to store editorship rank and label of editor List literalsOnForm = list("firstName", @@ -219,10 +219,10 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator "rank", "label"); editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - /** Set SPARQL Queries and supporting methods. */ - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + } + + /** Set SPARQL Queries and supporting methods. */ + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { //Sparql queries are all empty for existing values //This form is different from the others that it gets multiple editors on the same page //and that information will be queried and stored in the additional form specific data @@ -232,12 +232,12 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); } - + /** - * + * * Set Fields and supporting methods */ - + public void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { setLabelField(editConfiguration); setFirstNameField(editConfiguration); @@ -246,7 +246,7 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator setRankField(editConfiguration); setPersonUriField(editConfiguration); } - + private void setLabelField(EditConfigurationVTwo editConfiguration) { editConfiguration.addField(new FieldVTwo(). setName("label"). @@ -352,13 +352,13 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator + "WHERE { \n" + "?subject core:relatedBy ?editorshipURI . \n" + "?editorshipURI a core:Editorship . \n" - + "?editorshipURI core:relates ?editorURI . \n" + + "?editorshipURI core:relates ?editorURI . \n" + "?editorURI a foaf:Person . \n" + "OPTIONAL { ?editorURI rdfs:label ?editorName } \n" - + "OPTIONAL { ?editorshipURI core:rank ?rank } \n" + + "OPTIONAL { ?editorshipURI core:rank ?rank } \n" + "} ORDER BY ?rank"; - - + + private List getExistingEditorships(String subjectUri, VitroRequest vreq) { RDFService rdfService = vreq.getRDFService(); @@ -387,7 +387,7 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator } } catch (Exception e) { log.error(e, e); - } + } log.debug("editorships = " + editorships); return getEditorshipInfo(editorships); } @@ -399,22 +399,22 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator + " ?editorship a core:Editorship . \n" + " ?editorship core:rank ?rank .\n" + "} ORDER BY DESC(?rank) LIMIT 1"; - + private int getMaxRank(String subjectUri, VitroRequest vreq) { - int maxRank = 0; // default value + int maxRank = 0; // default value String queryStr = QueryUtils.subUriForQueryVar(this.getMaxRankQueryStr(), "subject", subjectUri); log.debug("maxRank query string is: " + queryStr); try { ResultSet results = QueryUtils.getQueryResults(queryStr, vreq); if (results != null && results.hasNext()) { // there is at most one result - QuerySolution soln = results.next(); + QuerySolution soln = results.next(); RDFNode node = soln.get("rank"); if (node != null && node.isLiteral()) { - // node.asLiteral().getInt() won't return an xsd:string that + // node.asLiteral().getInt() won't return an xsd:string that // can be parsed as an int. int rank = Integer.parseInt(node.asLiteral().getLexicalForm()); - if (rank > maxRank) { + if (rank > maxRank) { log.debug("setting maxRank to " + rank); maxRank = rank; } @@ -468,8 +468,8 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator //Editor information for editorship node private String editorUri; private String editorName; - - public EditorshipInfo(String inputEditorshipUri, + + public EditorshipInfo(String inputEditorshipUri, String inputEditorshipName, String inputEditorUri, String inputEditorName) { @@ -479,25 +479,25 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator editorName = inputEditorName; } - + //Getters - specifically required for Freemarker template's access to POJO public String getEditorshipUri() { return editorshipUri; } - + public String getEditorshipName() { return editorshipName; } - + public String getEditorUri() { return editorUri; } - + public String getEditorName() { return editorName; } } - + static final String DEFAULT_NS_TOKEN=null; //null forces the default NS protected String getMaxRankQueryStr() { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorshipToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorshipToPersonGenerator.java index 127cd4b6..41cea139 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorshipToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditorshipToPersonGenerator.java @@ -32,12 +32,12 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { - + public AddEditorshipToPersonGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + if( EditConfigurationUtils.getObjectUri(vreq) == null ){ return doAddNew(vreq,session); }else{ @@ -47,7 +47,7 @@ public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements private EditConfigurationVTwo doSkipToDocument(VitroRequest vreq) { Individual editorshipNode = EditConfigurationUtils.getObjectIndividual(vreq); - + //try to get the document String documentQueryStr = "SELECT ?obj \n" + "WHERE { <" + editorshipNode.getURI() + "> ?obj . \n" + @@ -60,8 +60,8 @@ public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements return doBadEditorshipNoPub( vreq ); }else if( rs.size() > 1 ){ return doBadEditorshipMultiplePubs(vreq); - }else{ - //skip to document + }else{ + //skip to document RDFNode objNode = rs.next().get("obj"); if (!objNode.isResource() || objNode.isAnon()) { return doBadEditorshipNoPub( vreq ); @@ -77,38 +77,38 @@ public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements protected EditConfigurationVTwo doAddNew(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("addEditorshipToPerson.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("editorship"); - + conf.setN3Required( Arrays.asList( n3ForNewEditorship ) ); conf.setN3Optional( Arrays.asList( n3ForNewDocumentAssertion, n3ForExistingDocumentAssertion ) ); - + conf.addNewResource("editorship", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newDocument", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setUrisOnform(Arrays.asList("existingDocument", "documentType")); conf.setLiteralsOnForm(Arrays.asList("documentLabel", "documentLabelDisplay" )); - + conf.addSparqlForExistingLiteral("documentLabel", documentLabelQuery); - + conf.addSparqlForExistingUris("documentType", documentTypeQuery); conf.addSparqlForExistingUris("existingDocument", existingDocumentQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("documentType"). setValidators( list("nonempty") ). - setOptions( new ConstantFieldOptions("documentType", getDocumentTypeLiteralOptions() )) + setOptions( new ConstantFieldOptions("documentType", getDocumentTypeLiteralOptions() )) ); conf.addField( new FieldVTwo(). @@ -123,61 +123,61 @@ public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements conf.addValidator(new AntiXssValidation()); addFormSpecificData(conf, vreq); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewEditorship = - "@prefix vivo: <" + vivoCore + "> . \n" + + final static String n3ForNewEditorship = + "@prefix vivo: <" + vivoCore + "> . \n" + "?person ?predicate ?editorship . \n" + - "?editorship a vivo:Editorship . \n" + + "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?person . " ; - - final static String n3ForNewDocumentAssertion = - "@prefix vivo: <" + vivoCore + "> . \n" + - "?editorship vivo:relates ?newDocument . \n" + - "?newDocument vivo:editedBy ?editorship . \n" + - "?newDocument a ?documentType . \n" + + + final static String n3ForNewDocumentAssertion = + "@prefix vivo: <" + vivoCore + "> . \n" + + "?editorship vivo:relates ?newDocument . \n" + + "?newDocument vivo:editedBy ?editorship . \n" + + "?newDocument a ?documentType . \n" + "?newDocument <" + label + "> ?documentLabel. " ; - - final static String n3ForExistingDocumentAssertion = - "@prefix vivo: <" + vivoCore + "> . \n" + - "?editorship vivo:relates ?existingDocument . \n" + - "?existingDocument vivo:editedBy ?editorship . \n" + + + final static String n3ForExistingDocumentAssertion = + "@prefix vivo: <" + vivoCore + "> . \n" + + "?editorship vivo:relates ?existingDocument . \n" + + "?existingDocument vivo:editedBy ?editorship . \n" + "?existingDocument a ?documentType . " ; /* Queries for editing an existing entry */ final static String documentTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "PREFIX vivo: <" + vivoCore + "> . \n" + - "PREFIX bibo: . \n" + - "SELECT ?documentType WHERE { \n" + - " ?editorship vivo:relates ?existingDocument . \n" + - " ?existingDocument a . \n" + - " ?existingDocument vitro:mostSpecificType ?documentType . \n" + + "PREFIX vivo: <" + vivoCore + "> . \n" + + "PREFIX bibo: . \n" + + "SELECT ?documentType WHERE { \n" + + " ?editorship vivo:relates ?existingDocument . \n" + + " ?existingDocument a . \n" + + " ?existingDocument vitro:mostSpecificType ?documentType . \n" + "}"; - final static String documentLabelQuery = + final static String documentLabelQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "PREFIX vivo: <" + vivoCore + "> . \n" + - "PREFIX bibo: . \n" + - "SELECT ?documentLabel WHERE { \n" + - " ?editorship vivo:relates ?existingDocument . \n" + - " ?existingDocument a . \n" + - " ?existingDocument <" + label + "> ?documentLabel . \n" + + "PREFIX vivo: <" + vivoCore + "> . \n" + + "PREFIX bibo: . \n" + + "SELECT ?documentLabel WHERE { \n" + + " ?editorship vivo:relates ?existingDocument . \n" + + " ?existingDocument a . \n" + + " ?existingDocument <" + label + "> ?documentLabel . \n" + "}"; - final static String existingDocumentQuery = + final static String existingDocumentQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "PREFIX vivo: <" + vivoCore + "> . \n" + - "PREFIX bibo: . \n" + - "SELECT existingDocument WHERE { \n" + - " ?editorship vivo:relates ?existingDocument . \n" + - " ?existingDocument a . \n" + + "PREFIX vivo: <" + vivoCore + "> . \n" + + "PREFIX bibo: . \n" + + "SELECT existingDocument WHERE { \n" + + " ?editorship vivo:relates ?existingDocument . \n" + + " ?existingDocument a . \n" + "}"; //Adding form specific data such as edit mode @@ -202,7 +202,7 @@ public class AddEditorshipToPersonGenerator extends VivoBaseGenerator implements // TODO Auto-generated method stub return null; } - + private List> getDocumentTypeLiteralOptions() { List> literalOptions = new ArrayList>(); literalOptions.add(list("http://purl.org/ontology/bibo/Book", "Book")); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddFullNameToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddFullNameToPersonGenerator.java index 87007f90..43cf5506 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddFullNameToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddFullNameToPersonGenerator.java @@ -21,95 +21,95 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(AddFullNameToPersonGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - String fullNameUri = getFullNameUri(vreq); - + initObjectPropForm(conf, vreq); + String fullNameUri = getFullNameUri(vreq); + conf.setTemplate("addFullNameToPerson.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("individualVcard"); - + conf.setN3Required( Arrays.asList( n3ForNewName ) ); conf.setN3Optional( Arrays.asList( firstNameAssertion, middleNameAssertion, lastNameAssertion, suffixAssertion, prefixAssertion ) ); - + conf.addNewResource("fullName", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setLiteralsOnForm(Arrays.asList("firstName", "middleName", "lastName", "suffix", "prefix" )); - + conf.addSparqlForExistingLiteral("firstName", firstNameQuery); conf.addSparqlForExistingLiteral("middleName", middleNameQuery); conf.addSparqlForExistingLiteral("lastName", lastNameQuery); conf.addSparqlForExistingLiteral("suffix", suffixQuery); conf.addSparqlForExistingLiteral("prefix", prefixQuery); conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); - + if ( conf.isUpdate() ) { HashMap> urisInScope = new HashMap>(); urisInScope.put("fullName", Arrays.asList(new String[]{fullNameUri})); conf.addUrisInScope(urisInScope); } - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("firstName") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("middleName") .setRangeDatatypeUri( XSD.xstring.toString()) ); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("lastName") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("suffix") .setRangeDatatypeUri( XSD.xstring.toString()) ); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("prefix") .setRangeDatatypeUri( XSD.xstring.toString()) ); conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewName = + final static String n3ForNewName = "?person ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?person . \n" + "?individualVcard ?fullName . \n" + - "?fullName a . " ; - - final static String firstNameAssertion = + "?fullName a . " ; + + final static String firstNameAssertion = "?fullName ?firstName ."; - - final static String middleNameAssertion = + + final static String middleNameAssertion = "?fullName ?middleName ."; - final static String lastNameAssertion = + final static String lastNameAssertion = "?fullName ?lastName ."; - final static String suffixAssertion = + final static String suffixAssertion = "?fullName ?suffix ."; - final static String prefixAssertion = + final static String prefixAssertion = "?fullName ?prefix ."; /* Queries for editing an existing entry */ @@ -119,29 +119,29 @@ public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements "?person ?existingIndividualVcard . \n" + "}"; - final static String firstNameQuery = + final static String firstNameQuery = "SELECT ?existingFirstName WHERE {\n"+ "?fullName ?existingFirstName . }"; - final static String middleNameQuery = + final static String middleNameQuery = "SELECT ?existingMiddleName WHERE {\n"+ "?fullName ?existingMiddleName . }"; - final static String lastNameQuery = + final static String lastNameQuery = "SELECT ?existingLastName WHERE {\n"+ "?fullName ?existingLastName . }"; - final static String suffixQuery = + final static String suffixQuery = "SELECT ?existingSuffix WHERE {\n"+ "?fullName ?existingSuffix . }"; - final static String prefixQuery = + final static String prefixQuery = "SELECT ?existingPrefix WHERE {\n"+ "?fullName ?existingPrefix . }"; private String getFullNameUri(VitroRequest vreq) { - String fullNameUri = vreq.getParameter("fullNameUri"); - + String fullNameUri = vreq.getParameter("fullNameUri"); + return fullNameUri; } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java index f17faf24..888d33e4 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java @@ -37,60 +37,60 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; /** * Custom form for adding a grant to an person for the predicates hasCo-PrincipalInvestigatorRole and hasPrincipalInvestigatorRole. - + * */ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator { - + private Log log = LogFactory.getLog(AddGrantRoleToPersonGenerator.class); private String subjectUri = null; private String predicateUri = null; private String objectUri = null; private String template = "addGrantRoleToPerson.ftl"; - + //Types of options to populate drop-down for types for the "right side" of the role public static enum RoleActivityOptionTypes { VCLASSGROUP, CHILD_VCLASSES, HARDCODED_LITERALS } - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); - + //process subject, predicate, object parameters this.initProcessParameters(vreq, session, editConfiguration); - + //Assumes this is a simple case of subject predicate var editConfiguration.setN3Required(this.generateN3Required(vreq)); - + //n3 optional editConfiguration.setN3Optional(this.generateN3Optional(vreq)); - + //Todo: what do new resources depend on here? //In original form, these variables start off empty editConfiguration.setNewResources(generateNewResources(vreq)); //In scope this.setUrisAndLiteralsInScope(editConfiguration, vreq); - + //on Form this.setUrisAndLiteralsOnForm(editConfiguration, vreq); - + editConfiguration.setFilesOnForm(new ArrayList()); - + //Sparql queries this.setSparqlQueries(editConfiguration, vreq); - + //set fields setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); - + // No need to put in session here b/c put in session within edit request dispatch controller instead //placing in session depends on having edit key which is handled in edit request dispatch controller // editConfiguration.putConfigInSession(editConfiguration, session); prepareForUpdate(vreq, session, editConfiguration); - + //Form title and submit label now moved to edit configuration template //TODO: check if edit configuration template correct place to set those or whether //additional methods here should be used and reference instead, e.g. edit configuration template could call @@ -99,7 +99,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator setTemplate(editConfiguration, vreq); //Set edit key setEditKey(editConfiguration, vreq); - + //Add validators editConfiguration.addValidator(new DateTimeIntervalValidationVTwo("startField","endField") ); editConfiguration.addValidator(new AntiXssValidation()); @@ -109,18 +109,18 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator addFormSpecificData(editConfiguration, vreq); return editConfiguration; } - - + + private void setEditKey(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - String editKey = EditConfigurationUtils.getEditKey(vreq); + String editKey = EditConfigurationUtils.getEditKey(vreq); editConfiguration.setEditKey(editKey); } - + protected void setTemplate(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { editConfiguration.setTemplate(template); - + } //Initialize setup: process parameters @@ -131,11 +131,11 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator subjectUri = EditConfigurationUtils.getSubjectUri(vreq); predicateUri = EditConfigurationUtils.getPredicateUri(vreq); - + editConfiguration.setFormUrl(formUrl); - + editConfiguration.setUrlPatternToReturnTo("/individual"); - + editConfiguration.setVarNameForSubject("person"); editConfiguration.setSubjectUri(subjectUri); editConfiguration.setEntityToReturnTo(subjectUri); @@ -143,28 +143,28 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator editConfiguration.setPredicateUri(predicateUri); //by definition, this is an object property objectUri = EditConfigurationUtils.getObjectUri(vreq); - - this.processObjectPropForm(vreq, editConfiguration); - } + + this.processObjectPropForm(vreq, editConfiguration); + } private void processObjectPropForm(VitroRequest vreq, EditConfigurationVTwo editConfiguration) { - editConfiguration.setVarNameForObject("role"); + editConfiguration.setVarNameForObject("role"); editConfiguration.setObject(objectUri); //this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method //pretends this is a data property editing statement and throws an error - //TODO: Check if null in case no object uri exists but this is still an object property + //TODO: Check if null in case no object uri exists but this is still an object property } - - + + /* - * N3 Required and Optional Generators as well as supporting methods + * N3 Required and Optional Generators as well as supporting methods */ - + private String getPrefixesString() { //TODO: Include dynamic way of including this return "@prefix core: ."; } - + //TODO: Check if single string or multiple strings - check rdfslabel form etc. for prefix //processing private List generateN3Required(VitroRequest vreq) { @@ -173,8 +173,8 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator n3ForEdit.add(editString); return n3ForEdit; } - - + + private List generateN3Optional(VitroRequest vreq) { List n3Optional = new ArrayList(); //n3 for new grant @@ -187,61 +187,61 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator n3Optional.addAll(getN3ForStart()); //N3 For End n3Optional.addAll(getN3ForEnd()); - return n3Optional; + return n3Optional; } - + public String getN3ForGrantRole(VitroRequest vreq) { String editString = getPrefixesString(); editString += "?person ?rolePredicate ?role ."; editString += "?role a <" + getRoleType(vreq) + "> ."; return editString; } - + public String getN3ForNewGrant(VitroRequest vreq) { String editString = getPrefixesString(); editString += "?role <" + getRoleToGrantPredicate(vreq) + "> ?grant ."; editString += "?grant a core:Grant . "; - editString += "?person core:relatedBy ?grant . "; - editString += "?grant core:relates ?person . "; + editString += "?person core:relatedBy ?grant . "; + editString += "?grant core:relates ?person . "; editString += "?grant <" + getGrantToRolePredicate(vreq) + "> ?role ."; editString += "?grant <" + RDFS.label.getURI() + "> ?grantLabel ."; return editString; } - + public String getN3ForExistingGrant(VitroRequest vreq) { String editString = getPrefixesString(); - editString += "?person core:relatedBy ?existingGrant . "; - editString += "?existingGrant core:relates ?person . "; - editString += "?role <" + getRoleToGrantPredicate(vreq) + "> ?existingGrant . "; + editString += "?person core:relatedBy ?existingGrant . "; + editString += "?existingGrant core:relates ?person . "; + editString += "?role <" + getRoleToGrantPredicate(vreq) + "> ?existingGrant . "; editString += "?existingGrant <" + getGrantToRolePredicate(vreq) + "> ?role ."; return editString; } - + //Method b/c used in two locations, n3 optional and n3 assertions private List getN3ForStart() { List n3ForStart = new ArrayList(); - n3ForStart.add("?role <" + getRoleToIntervalURI() + "> ?intervalNode ." + - "?intervalNode <" + RDF.type.getURI() + "> <" + getIntervalTypeURI() + "> ." + - "?intervalNode <" + getIntervalToStartURI() + "> ?startNode ." + - "?startNode <" + RDF.type.getURI() + "> <" + getDateTimeValueTypeURI() + "> ." + - "?startNode <" + getDateTimeValueURI() + "> ?startField-value ." + + n3ForStart.add("?role <" + getRoleToIntervalURI() + "> ?intervalNode ." + + "?intervalNode <" + RDF.type.getURI() + "> <" + getIntervalTypeURI() + "> ." + + "?intervalNode <" + getIntervalToStartURI() + "> ?startNode ." + + "?startNode <" + RDF.type.getURI() + "> <" + getDateTimeValueTypeURI() + "> ." + + "?startNode <" + getDateTimeValueURI() + "> ?startField-value ." + "?startNode <" + getDateTimePrecisionURI() + "> ?startField-precision ."); return n3ForStart; } - + private List getN3ForEnd() { List n3ForEnd = new ArrayList(); - n3ForEnd.add("?role <" + getRoleToIntervalURI() + "> ?intervalNode . " + - "?intervalNode <" + RDF.type.getURI() + "> <" + getIntervalTypeURI() + "> ." + - "?intervalNode <" + getIntervalToEndURI() + "> ?endNode ." + - "?endNode <" + RDF.type.getURI() + "> <" + getDateTimeValueTypeURI() + "> ." + - "?endNode <" + getDateTimeValueURI() + "> ?endField-value ." + + n3ForEnd.add("?role <" + getRoleToIntervalURI() + "> ?intervalNode . " + + "?intervalNode <" + RDF.type.getURI() + "> <" + getIntervalTypeURI() + "> ." + + "?intervalNode <" + getIntervalToEndURI() + "> ?endNode ." + + "?endNode <" + RDF.type.getURI() + "> <" + getDateTimeValueTypeURI() + "> ." + + "?endNode <" + getDateTimeValueURI() + "> ?endField-value ." + "?endNode <" + getDateTimePrecisionURI() + "> ?endField-precision ."); return n3ForEnd; - + } - - + + /* * Get new resources */ @@ -256,22 +256,22 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator newResources.put("endNode", defaultNamespace + "individual"); return newResources; } - + /* * Set URIS and Literals In Scope and on form and supporting methods */ - + private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap> urisInScope = new HashMap>(); //note that at this point the subject, predicate, and object var parameters have already been processed //these two were always set when instantiating an edit configuration object from json, //although the json itself did not specify subject/predicate as part of uris in scope - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); //Setting role type - urisInScope.put("roleType", + urisInScope.put("roleType", Arrays.asList(new String[]{getRoleType(vreq)})); //Setting inverse role predicate urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); @@ -281,7 +281,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator //with existing values for variables editConfiguration.setLiteralsInScope(new HashMap>()); } - + private List getInversePredicate(VitroRequest vreq) { List inversePredicateArray = new ArrayList(); ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); @@ -292,8 +292,8 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator } //n3 should look as follows - //?subject ?predicate ?objectVar - + //?subject ?predicate ?objectVar + private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { List urisOnForm = new ArrayList(); List literalsOnForm = new ArrayList(); @@ -306,25 +306,25 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator literalsOnForm.add("grantLabelDisplay"); editConfiguration.setLiteralsOnForm(literalsOnForm); } - - + + /** * Set SPARQL Queries and supporting methods */ - - + + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { //Sparql queries defining retrieval of literals etc. editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); - + Map urisInScope = new HashMap(); editConfiguration.setSparqlForAdditionalUrisInScope(urisInScope); - + editConfiguration.setSparqlForExistingLiterals(generateSparqlForExistingLiterals(vreq)); editConfiguration.setSparqlForExistingUris(generateSparqlForExistingUris(vreq)); } - - + + //Get page uri for object private HashMap generateSparqlForExistingUris(VitroRequest vreq) { HashMap map = new HashMap(); @@ -337,7 +337,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator map.put("endField-precision", getEndPrecisionQuery(vreq)); return map; } - + private String getEndPrecisionQuery(VitroRequest vreq) { @@ -345,7 +345,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator "?role <" + getRoleToIntervalURI() + "> ?intervalNode ." + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> ." + "?intervalNode <" + getIntervalToEndURI() + "> ?endNode ." + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> . " + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> . " + "?endNode <" + getDateTimePrecisionURI() + "> ?existingEndPrecision . }"; return query; } @@ -355,7 +355,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator "?role <" + getRoleToIntervalURI() + "> ?intervalNode ." + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> ." + "?intervalNode <" + getIntervalToStartURI() + "> ?startNode ." + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> . " + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> . " + "?startNode <" + getDateTimePrecisionURI() + "> ?existingStartPrecision . }"; return query; } @@ -365,27 +365,27 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator "?role <" + getRoleToIntervalURI() + "> ?intervalNode ."+ "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> ."+ " ?intervalNode <" + getIntervalToEndURI() + "> ?existingEndNode . "+ - "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .}"; + "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .}"; return query; } private String getStartNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingStartNode WHERE {"+ - "?role <" + getRoleToIntervalURI() + "> ?intervalNode ."+ - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> ."+ - "?intervalNode <" + getIntervalToStartURI() + "> ?existingStartNode . "+ - "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .}"; + String query = "SELECT ?existingStartNode WHERE {"+ + "?role <" + getRoleToIntervalURI() + "> ?intervalNode ."+ + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> ."+ + "?intervalNode <" + getIntervalToStartURI() + "> ?existingStartNode . "+ + "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .}"; return query; } private String getIntervalNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingIntervalNode WHERE { " + - "?role <" + getRoleToIntervalURI() + "> ?existingIntervalNode . " + + String query = "SELECT ?existingIntervalNode WHERE { " + + "?role <" + getRoleToIntervalURI() + "> ?existingIntervalNode . " + " ?existingIntervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> . }"; return query; } - + private HashMap generateSparqlForExistingLiterals(VitroRequest vreq) { HashMap map = new HashMap(); @@ -395,55 +395,55 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator map.put("endField-value", getExistingEndDateQuery(vreq)); return map; } - + private String getGrantLabelQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + getVivoCoreNamespace() + ">" + + String query = "PREFIX core: <" + getVivoCoreNamespace() + ">" + "PREFIX rdfs: <" + RDFS.getURI() + "> \n"; String roleToGrantPredicate = getRoleToGrantPredicate(vreq); - query += "SELECT ?existingGrantLabel WHERE { \n" + - "?role <" + roleToGrantPredicate + "> ?existingGrant . \n" + + query += "SELECT ?existingGrantLabel WHERE { \n" + + "?role <" + roleToGrantPredicate + "> ?existingGrant . \n" + "?existingGrant rdfs:label ?existingGrantLabel . }"; - + return query; } private String getExistingGrantQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + getVivoCoreNamespace() + ">" + + String query = "PREFIX core: <" + getVivoCoreNamespace() + ">" + "PREFIX rdfs: <" + RDFS.getURI() + "> \n"; String roleToGrantPredicate = getRoleToGrantPredicate(vreq); - query += "SELECT ?existingGrant WHERE { \n" + + query += "SELECT ?existingGrant WHERE { \n" + "?role <" + roleToGrantPredicate + "> ?existingGrant . }"; return query; } private String getExistingEndDateQuery(VitroRequest vreq) { - String query = " SELECT ?existingEndDate WHERE {\n" + - "?role <" + getRoleToIntervalURI() + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> .\n" + - "?intervalNode <" + getIntervalToEndURI() + "> ?endNode .\n" + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .\n" + + String query = " SELECT ?existingEndDate WHERE {\n" + + "?role <" + getRoleToIntervalURI() + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> .\n" + + "?intervalNode <" + getIntervalToEndURI() + "> ?endNode .\n" + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .\n" + "?endNode <" + getDateTimeValueURI() + "> ?existingEndDate . }"; return query; } private String getExistingStartDateQuery(VitroRequest vreq) { - String query = "SELECT ?existingDateStart WHERE {\n" + - "?role <" + getRoleToIntervalURI() + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> .\n" + - "?intervalNode <" + getIntervalToStartURI() + "> ?startNode .\n" + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .\n" + + String query = "SELECT ?existingDateStart WHERE {\n" + + "?role <" + getRoleToIntervalURI() + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + getIntervalTypeURI() + "> .\n" + + "?intervalNode <" + getIntervalToStartURI() + "> ?startNode .\n" + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + getDateTimeValueTypeURI() + "> .\n" + "?startNode <" + getDateTimeValueURI() + "> ?existingDateStart . }"; return query; } /** - * + * * Set Fields and supporting methods */ - + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { Map fields = new HashMap(); //Multiple fields @@ -455,20 +455,20 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator getEndField(editConfiguration, vreq, fields); editConfiguration.setFields(fields); } - + private void getGrantField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { String fieldName = "grant"; - + FieldVTwo field = new FieldVTwo(); field.setName(fieldName); //queryForExisting is not being used anywhere in Field - + List validators = new ArrayList(); - field.setValidators(validators); - - fields.put(field.getName(), field); - + field.setValidators(validators); + + fields.put(field.getName(), field); + } private void getGrantLabelField(EditConfigurationVTwo editConfiguration, @@ -476,45 +476,45 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator String fieldName = "grantLabel"; //get range data type uri and range language String stringDatatypeUri = XSD.xstring.toString(); - + FieldVTwo field = new FieldVTwo(); field.setName(fieldName); //queryForExisting is not being used anywhere in Field - + //Not really interested in validators here List validators = new ArrayList(); validators.add("datatype:" + stringDatatypeUri); - field.setValidators(validators); + field.setValidators(validators); + + fields.put(field.getName(), field); - fields.put(field.getName(), field); - } - + private void getGrantLabelDisplayField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { - - FieldVTwo field = new FieldVTwo(); - - String fieldName = "grantLabelDisplay"; - field.setName(fieldName); - - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri(null); - fields.put(field.getName(), field); - + FieldVTwo field = new FieldVTwo(); + + String fieldName = "grantLabelDisplay"; + field.setName(fieldName); + + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri(null); + + fields.put(field.getName(), field); + } //Need if returning from an invalid submission private void getExistingGrantField( EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { String fieldName = "existingGrant"; - + FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); + field.setName(fieldName); //queryForExisting is not being used anywhere in Field - - fields.put(field.getName(), field); + + fields.put(field.getName(), field); } private void getStartField(EditConfigurationVTwo editConfiguration, @@ -522,16 +522,16 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator String fieldName = "startField"; FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - + field.setName(fieldName); + //This logic was originally after edit configuration object created from json in original jsp field.setEditElement( - new DateTimeWithPrecisionVTwo(field, + new DateTimeWithPrecisionVTwo(field, VitroVocabulary.Precision.YEAR.uri(), - VitroVocabulary.Precision.NONE.uri())); - + VitroVocabulary.Precision.NONE.uri())); + fields.put(field.getName(), field); - + } private void getEndField(EditConfigurationVTwo editConfiguration, @@ -539,19 +539,19 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator String fieldName = "endField"; FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - + field.setName(fieldName); + List validators = new ArrayList(); field.setValidators(validators); //Set edit element field.setEditElement( - new DateTimeWithPrecisionVTwo(field, + new DateTimeWithPrecisionVTwo(field, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri())); - + fields.put(field.getName(), field); - + } /** @@ -560,9 +560,9 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator * @param session - the HTTP session * @param editConfiguration - Edit configuration */ - + private void prepareForUpdate(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { - //Here, retrieve model from + //Here, retrieve model from OntModel model = ModelAccess.on(session.getServletContext()).getOntModel(); //Object property by definition String objectUri = EditConfigurationUtils.getObjectUri(vreq); @@ -574,9 +574,9 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator editConfiguration.prepareForNonUpdate( model ); } } - + /**Methods for checking edit mode ** - * + * */ public EditMode getEditMode(VitroRequest vreq) { List roleToGrantPredicates = getPossibleRoleToGrantPredicates(); @@ -586,15 +586,15 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator private boolean isAddMode(VitroRequest vreq) { return EditModeUtils.isAddMode(getEditMode(vreq)); } - + private boolean isEditMode(VitroRequest vreq) { return EditModeUtils.isEditMode(getEditMode(vreq)); } - + private boolean isRepairMode(VitroRequest vreq) { return EditModeUtils.isRepairMode(getEditMode(vreq)); } - + /** * Methods that are REQUIRED to be implemented in subclasses **/ @@ -606,12 +606,12 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator } else if(rangeUri.equals(getCoPrincipalInvestigatorURI())) { return getVivoOntologyCoreNamespace() + "CoPrincipalInvestigatorRole"; - } + } else { return getVivoOntologyCoreNamespace() + "InvestigatorRole"; } } - + private Object getCoPrincipalInvestigatorURI() { return getVivoOntologyCoreNamespace() + "CoPrincipalInvestigatorRole"; } @@ -631,27 +631,27 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator * Methods with default values that may be overwritten when required by a subclass * Both Default value and method that can be overwritten are included below **/ - + public boolean isShowRoleLabelField(VitroRequest vreq) { return true; } - - + + //This has a default value, but note that even that will not be used //in the update with realized in or contributes to //Overridden when need be in subclassed generator - //Also note that for now we're going to actually going to return a + //Also note that for now we're going to actually going to return a //placeholder value by default public String getRoleToGrantPredicate(VitroRequest vreq) { ObjectProperty predicate = ModelUtils.getPropertyForRoleInClass(getGrantType(), vreq.getWebappDaoFactory()); return predicate.getURI(); } - + public String getGrantToRolePredicate(VitroRequest vreq) { ObjectProperty predicate = ModelUtils.getPropertyForRoleInClass(getGrantType(), vreq.getWebappDaoFactory()); return predicate.getURIInverse(); } - + public String getGrantType() { return "http://vivoweb.org/ontology/core#Grant"; } @@ -662,65 +662,65 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator public String getDefaultgrantToRolePredicate() { return "http://vivoweb.org/ontology/core#relates"; } - + //roleToGrantPredicate public String getDefaultroleToGrantPredicate() { return "http://purl.obolibrary.org/obo/BFO_0000054"; - + } - + public List getPossibleRoleToGrantPredicates() { return ModelUtils.getPossiblePropertiesForRole(); } - + public List getPossibleGrantToRolePredicates() { return ModelUtils.getPossibleInversePropertiesForRole(); } - - + + /** * Methods to return URIS for various predicates **/ public String getVivoCoreNamespace() { return "http://vivoweb.org/ontology/core#"; } - + public String getRoleToIntervalURI() { return getVivoCoreNamespace() + "dateTimeInterval"; } - + public String getIntervalTypeURI() { return getVivoCoreNamespace() + "DateTimeInterval"; } - + public String getIntervalToStartURI() { return getVivoCoreNamespace() + "start"; } - + public String getIntervalToEndURI() { return getVivoCoreNamespace() + "end"; } - + public String getStartYearPredURI() { return getVivoCoreNamespace() + "startYear"; } - + public String getEndYearPredURI() { return getVivoCoreNamespace() + "endYear"; } - + public String getDateTimeValueTypeURI() { return getVivoCoreNamespace() + "DateTimeValue"; } - + public String getDateTimePrecisionURI() { return getVivoCoreNamespace() + "dateTimePrecision"; } - + public String getDateTimeValueURI() { return getVivoCoreNamespace() + "dateTime"; } - + //Form specific data public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); @@ -731,23 +731,23 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator //Put in the fact that we require field editConfiguration.setFormSpecificData(formSpecificData); } - + public String getSparqlForAcFilter(VitroRequest vreq) { String subject = EditConfigurationUtils.getSubjectUri(vreq); String predicate = EditConfigurationUtils.getPredicateUri(vreq); - - - String query = "PREFIX core:<" + getVivoCoreNamespace() + "> " + - "SELECT ?grantUri WHERE { " + + + + String query = "PREFIX core:<" + getVivoCoreNamespace() + "> " + + "SELECT ?grantUri WHERE { " + "<" + subject + "> <" + predicate + "> ?grantRole ." + "?grantRole <" + getRoleToGrantPredicate(vreq) + "> ?grantUri . }"; return query; } - + private String getRangeUri(VitroRequest vreq) { - String rangeUri = vreq.getParameter("rangeUri"); - + String rangeUri = vreq.getParameter("rangeUri"); + return rangeUri; } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddHeadOfRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddHeadOfRoleToPersonGenerator.java index 30dd8d6e..8afed1e4 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddHeadOfRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddHeadOfRoleToPersonGenerator.java @@ -1,54 +1,54 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; - -public class AddHeadOfRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - - private static String template = "addHeadOfRoleToPerson.ftl"; - private static String OPTION_CLASS_URI = "http://xmlns.com/foaf/0.1/Organization"; - - //Should this be overridden - @Override - String getTemplate() { - return template; - } - - @Override - String getRoleType() { - return "http://vivoweb.org/ontology/core#LeaderRole"; - } - - /** Head Of role involves hard-coded options for the "right side" of the role or activity */ - @Override - FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { - - return new - ChildVClassesOptions(OPTION_CLASS_URI) - .setDefaultOptionLabel("Select type"); - } - - @Override - boolean isShowRoleLabelField(){return true;} - - /* - * Use the methods below to change the date/time precision in the - * custom form associated with this generator. When not used, the - * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, - * MINUTE, TIME and NONE. - */ -/* - public String getStartDatePrecision() { - String precision = VitroVocabulary.Precision.MONTH.uri(); - return precision; - } - - public String getEndDatePrecision() { - String precision = VitroVocabulary.Precision.DAY.uri(); - return precision; - } -*/ -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; + +public class AddHeadOfRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { + + private static String template = "addHeadOfRoleToPerson.ftl"; + private static String OPTION_CLASS_URI = "http://xmlns.com/foaf/0.1/Organization"; + + //Should this be overridden + @Override + String getTemplate() { + return template; + } + + @Override + String getRoleType() { + return "http://vivoweb.org/ontology/core#LeaderRole"; + } + + /** Head Of role involves hard-coded options for the "right side" of the role or activity */ + @Override + FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { + + return new + ChildVClassesOptions(OPTION_CLASS_URI) + .setDefaultOptionLabel("Select type"); + } + + @Override + boolean isShowRoleLabelField(){return true;} + + /* + * Use the methods below to change the date/time precision in the + * custom form associated with this generator. When not used, the + * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, + * MINUTE, TIME and NONE. + */ +/* + public String getStartDatePrecision() { + String precision = VitroVocabulary.Precision.MONTH.uri(); + return precision; + } + + public String getEndDatePrecision() { + String precision = VitroVocabulary.Precision.DAY.uri(); + return precision; + } +*/ +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddMemberRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddMemberRoleToPersonGenerator.java index acec8b4a..ba79af35 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddMemberRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddMemberRoleToPersonGenerator.java @@ -7,19 +7,19 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantField import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddMemberRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - + private static String template = "addMemberRoleToPerson.ftl"; private static String VCLASS_URI = "http://xmlns.com/foaf/0.1/Organization"; @Override String getTemplate() { return template; - } - + } + @Override - String getRoleType() { + String getRoleType() { return "http://vivoweb.org/ontology/core#MemberRole"; } - + @Override FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { return new ConstantFieldOptions( @@ -58,11 +58,11 @@ public class AddMemberRoleToPersonGenerator extends AddRoleToPersonTwoStageGener "http://purl.obolibrary.org/obo/ERO_0000565","Technology Transfer Office", "http://vivoweb.org/ontology/core#University","University"); } - - @Override - boolean isShowRoleLabelField(){return true;} - /* + @Override + boolean isShowRoleLabelField(){return true;} + + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -78,5 +78,5 @@ public class AddMemberRoleToPersonGenerator extends AddRoleToPersonTwoStageGener String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } -*/ +*/ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrcidIdToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrcidIdToPersonGenerator.java index debd3ca8..bee73d33 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrcidIdToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrcidIdToPersonGenerator.java @@ -17,46 +17,46 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class AddOrcidIdToPersonGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(AddOrcidIdToPersonGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("addOrcidIdToPerson.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("orcidId"); - + conf.setN3Required( Arrays.asList( n3ForOrcidId ) ); - + conf.setUrisOnform(Arrays.asList("orcidId")); - + conf.addSparqlForExistingUris("orcidId", orcidIdQuery); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("orcidId"). setValidators( list("nonempty") )); - + conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForOrcidId = + final static String n3ForOrcidId = "@prefix owl: .\n"+ "?person ?orcidId . \n" + - "?orcidId a owl:Thing . " ; - + "?orcidId a owl:Thing . " ; + /* Queries for editing an existing entry */ final static String orcidIdQuery = diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrganizerRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrganizerRoleToPersonGenerator.java index 678fac48..1dec78f5 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrganizerRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOrganizerRoleToPersonGenerator.java @@ -7,10 +7,10 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantField import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - + private static String template = "addOrganizerRoleToPerson.ftl"; - - + + @Override String getTemplate() { return template; @@ -20,7 +20,7 @@ public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGe String getRoleType() { return "http://vivoweb.org/ontology/core#OrganizerRole"; } - + //Organizer role involves hard-coded options for the "right side" of the role or activity @Override FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { @@ -48,7 +48,7 @@ public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGe boolean isShowRoleLabelField() { return false; } - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -64,5 +64,5 @@ public class AddOrganizerRoleToPersonGenerator extends AddRoleToPersonTwoStageGe String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } - */ + */ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java index 00df49fa..0a69623e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java @@ -7,17 +7,17 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantField import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - + private static String template = "addOutreachProviderRoleToPerson.ftl"; private static String OPTION_CLASS_URI = "http://xmlns.com/foaf/0.1/Organization"; - + @Override String getTemplate() { return template; } @Override - String getRoleType() { + String getRoleType() { return "http://vivoweb.org/ontology/core#OutreachProviderRole"; } @@ -79,8 +79,8 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo @Override boolean isShowRoleLabelField(){return true;} - - /* + + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -96,5 +96,5 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } -*/ +*/ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java index e35af3c6..a638213f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java @@ -37,49 +37,49 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public AddPresenterRoleToPersonGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("addPresenterRoleToPerson.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("role"); - + conf.setN3Required( Arrays.asList( n3ForNewRole ) ); conf.setN3Optional( Arrays.asList( n3ForRoleLabelAssertion, - n3ForNewPresentation, - n3ForExistingPresentation, - n3ForNewConferenceNewPres, - n3ForNewConferenceExistingPres, - n3ForExistingConferenceNewPres, - n3ForExistingConferenceExistingPres, - n3ForStart, + n3ForNewPresentation, + n3ForExistingPresentation, + n3ForNewConferenceNewPres, + n3ForNewConferenceExistingPres, + n3ForExistingConferenceNewPres, + n3ForExistingConferenceExistingPres, + n3ForStart, n3ForEnd ) ); - + conf.addNewResource("presentation", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newConference", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("role", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform(Arrays.asList("existingPresentation", "existingConference", "presentationType")); conf.setLiteralsOnForm(Arrays.asList("presentationLabel", "presentationLabelDisplay", "conferenceLabel", "conferenceLabelDisplay", "roleLabel")); - + conf.addSparqlForExistingLiteral("presentationLabel", presentationLabelQuery); conf.addSparqlForExistingLiteral("conferenceLabel", conferenceLabelQuery); conf.addSparqlForExistingLiteral("roleLabel", roleLabelQuery); @@ -94,69 +94,69 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme "intervalNode", existingIntervalNodeQuery); conf.addSparqlForExistingUris("startNode", existingStartNodeQuery); conf.addSparqlForExistingUris("endNode", existingEndNodeQuery); - conf.addSparqlForExistingUris("startField-precision", + conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); - conf.addSparqlForExistingUris("endField-precision", + conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - + conf.addField( new FieldVTwo(). // an autocomplete field - setName("existingPresentation") + setName("existingPresentation") ); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("presentationLabelDisplay") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()) ) ); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("presentationLabel") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()) ) ); - + conf.addField( new FieldVTwo(). setName("presentationType"). setValidators( list("nonempty") ). setOptions( new ChildVClassesWithParent( - presentationClass)) + presentationClass)) ); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("roleLabel"). setRangeDatatypeUri( XSD.xstring.toString() ). setValidators(list("datatype:" + XSD.xstring.toString()))); conf.addField( new FieldVTwo(). // an autocomplete field - setName("existingConference") + setName("existingConference") ); - + conf.addField( new FieldVTwo(). setName("conferenceLabel"). setRangeDatatypeUri(XSD.xstring.toString() ) ); - + conf.addField( new FieldVTwo(). setName("conferenceLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() ) ); - + conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); - + conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); - + conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); conf.addValidator(new AntiXssValidation()); conf.addValidator(new AutocompleteRequiredInputValidator("existingPresentation", "presentationLabel")); @@ -165,26 +165,26 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme } /* N3 assertions */ - final static String n3ForNewRole = - "@prefix core: <" + vivoCore + "> . \n" + + final static String n3ForNewRole = + "@prefix core: <" + vivoCore + "> . \n" + "?person <" + hasRolePred + "> ?role . \n" + - "?role a <" + roleClass + "> . \n" + + "?role a <" + roleClass + "> . \n" + "?role <" + roleOfPred + "> ?person . "; - final static String n3ForRoleLabelAssertion = - "?role <" + label + "> ?roleLabel . "; - - final static String n3ForNewPresentation = - "?role <" + roleRealizedInPred + "> ?presentation . \n" + - "?presentation <" + realizedRolePred + "> ?role . \n" + + final static String n3ForRoleLabelAssertion = + "?role <" + label + "> ?roleLabel . "; + + final static String n3ForNewPresentation = + "?role <" + roleRealizedInPred + "> ?presentation . \n" + + "?presentation <" + realizedRolePred + "> ?role . \n" + "?presentation <" + label + "> ?presentationLabel . \n" + "?presentation a ?presentationType ."; - - final static String n3ForExistingPresentation = - "?role <" + roleRealizedInPred + "> ?existingPresentation . \n" + + + final static String n3ForExistingPresentation = + "?role <" + roleRealizedInPred + "> ?existingPresentation . \n" + "?existingPresentation <" + realizedRolePred + "> ?role . \n" + "?existingPresentation a ?presentationType ."; - + final static String n3ForNewConferenceNewPres = "?presentation <" + eventWithinPred + "> ?newConference . \n" + "?newConference <" + includesEventPred + "> ?presentation . \n" + @@ -196,63 +196,63 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme "?newConference <" + includesEventPred + "> ?existingPresentation . \n" + "?newConference a <" + conferenceClass + "> . \n" + "?newConference <" + label + "> ?conferenceLabel ."; - + final static String n3ForExistingConferenceNewPres = "?existingConference <" + includesEventPred + "> ?presentation . \n" + "?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" + + "?role <" + roleToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?role <" + roleToInterval + "> ?intervalNode . \n" + + "?role <" + roleToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + "?endNode <" + dateTimeValue + "> ?endField-value . \n" + "?endNode <" + dateTimePrecision + "> ?endField-precision . \n"; - + /* Queries for editing an existing entry */ final static String roleLabelQuery = "SELECT ?existingRoleLabel WHERE { \n" + "?role <" + label + "> ?existingRoleLabel . }"; - - final static String presentationQuery = + + final static String presentationQuery = "SELECT ?existingPresentation WHERE { \n" + "?role <" + roleRealizedInPred + "> ?existingPresentation . }"; - + final static String presentationLabelQuery = "SELECT ?existingPresentationLabel WHERE { \n" + "?role <" + roleRealizedInPred + "> ?existingPresentation . " + "?existingPresentation <" + label + "> ?existingPresentationLabel . }"; - - final static String presentationTypeQuery = + + final static String presentationTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingPresentationType WHERE { \n" + + "SELECT ?existingPresentationType WHERE { \n" + "?role <" + roleRealizedInPred + "> ?existingPresentation . " + "?existingPresentation vitro:mostSpecificType ?existingPresentationType . }"; - - final static String existingConferenceQuery = + + final static String existingConferenceQuery = "SELECT ?existingConference WHERE { \n" + "?role <" + roleRealizedInPred + "> ?existingPresentation . " + "?existingPresentation <" + eventWithinPred + "> ?existingConference . }"; - + final static String conferenceLabelQuery = "SELECT ?existingConferenceLabel WHERE { \n" + "?role <" + roleRealizedInPred + "> ?existingPresentation . " + "?existingPresentation <" + eventWithinPred + "> ?existingConference . \n" + "?existingConference <" + label + "> ?existingConferenceLabel . }"; - + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + @@ -260,7 +260,7 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingDateStart . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + @@ -270,39 +270,39 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?role <" + roleToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - - final static String existingStartNodeQuery = + + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> . } "; - - final static String existingEndNodeQuery = + + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> .} "; - - final static String existingStartPrecisionQuery = + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> .} "; + + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - - final static String existingEndPrecisionQuery = + + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?role <" + roleToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java index 11c395bf..e1bb91f8 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java @@ -38,7 +38,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; /** * On an add/new, this will show a form, on an edit/update this will skip to the - * profile page of the publication. + * profile page of the publication. */ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { @@ -61,12 +61,12 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; final static String relatesPred = vivoCore + "relates"; - + public AddPublicationToPersonGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + if( EditConfigurationUtils.getObjectUri(vreq) == null ){ return doAddNew(vreq,session); }else{ @@ -76,7 +76,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement private EditConfigurationVTwo doSkipToPublication(VitroRequest vreq) { Individual authorshipNode = EditConfigurationUtils.getObjectIndividual(vreq); - + //try to get the publication String pubQueryStr = "SELECT ?obj \n" + "WHERE { <" + authorshipNode.getURI() + "> <" + relatesPred + "> ?obj . \n" + @@ -89,8 +89,8 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return doBadAuthorshipNoPub( vreq ); }else if( rs.size() > 1 ){ return doBadAuthorshipMultiplePubs(vreq); - }else{ - //skip to publication + }else{ + //skip to publication RDFNode objNode = rs.next().get("obj"); if (!objNode.isResource() || objNode.isAnon()) { return doBadAuthorshipNoPub( vreq ); @@ -154,10 +154,10 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement // TODO Auto-generated method stub return null; } - + private void setVarNames(EditConfigurationVTwo editConfiguration) { - editConfiguration.setVarNameForSubject("person"); - editConfiguration.setVarNameForPredicate("predicate"); + editConfiguration.setVarNameForSubject("person"); + editConfiguration.setVarNameForPredicate("predicate"); editConfiguration.setVarNameForObject("authorshipUri"); } @@ -216,18 +216,18 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement } private String getAuthorshipN3() { - return "@prefix core: <" + vivoCore + "> . " + - "?authorshipUri a core:Authorship ;" + - "core:relates ?person ." + + return "@prefix core: <" + vivoCore + "> . " + + "?authorshipUri a core:Authorship ;" + + "core:relates ?person ." + "?person core:relatedBy ?authorshipUri ."; } private String getN3ForNewPub() { return "@prefix core: <" + vivoCore + "> ." + "?newPublication a ?pubType ." + - "?newPublication <" + label + "> ?title ." + + "?newPublication <" + label + "> ?title ." + "?authorshipUri core:relates ?newPublication ." + - "?newPublication core:relatedBy ?authorshipUri ."; + "?newPublication core:relatedBy ?authorshipUri ."; } private String getN3ForExistingPub() { @@ -240,7 +240,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication vivo:hasPublicationVenue ?newCollection . \n" + "?newCollection a <" + collectionClass + "> . \n" + - "?newCollection vivo:publicationVenueFor ?newPublication . \n" + + "?newCollection vivo:publicationVenueFor ?newPublication . \n" + "?newCollection <" + label + "> ?collection ."; } @@ -248,7 +248,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:hasPublicationVenue ?newCollection . \n" + "?newCollection a <" + collectionClass + "> . \n" + - "?newCollection vivo:publicationVenueFor ?pubUri . \n" + + "?newCollection vivo:publicationVenueFor ?pubUri . \n" + "?newCollection <" + label + "> ?collection ."; } @@ -268,7 +268,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:hasPublicationVenue ?newBook . \n" + "?newBook a <" + bookClass + "> . \n" + - "?newBook vivo:publicationVenueFor ?pubUri . \n " + + "?newBook vivo:publicationVenueFor ?pubUri . \n " + "?newBook <" + label + "> ?book ."; } @@ -282,8 +282,8 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication vivo:hasPublicationVenue ?newBook . \n" + "?newBook a <" + bookClass + "> . \n" + - "?newBook vivo:publicationVenueFor ?newPublication . \n " + - "?newBook <" + label + "> ?book . "; + "?newBook vivo:publicationVenueFor ?newPublication . \n " + + "?newBook <" + label + "> ?book . "; } private String getN3ForNewBookVolume() { @@ -312,7 +312,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?newEditor . \n" + "?newEditor a <" + editorClass + "> . \n" + - "?newEditor vivo:relatedBy ?editorship . \n" + + "?newEditor vivo:relatedBy ?editorship . \n" + "?newEditor <" + label + "> ?editor ."; } @@ -323,13 +323,13 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?newBook <" + label + "> ?book . \n " + "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?editorUri . \n" + - "?editorUri vivo:relatedBy ?editorship . "; + "?editorUri vivo:relatedBy ?editorship . "; } private String getN3ForNewBookNewPublisher() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?newBook vivo:publisher ?newPublisher . \n " + - "?newPublisher vivo:publisherOf ?newBook . \n" + + "?newPublisher vivo:publisherOf ?newBook . \n" + "?newPublisher <" + label + "> ?publisher ."; } @@ -349,7 +349,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri <" + presentedAtPred + "> ?newConference . \n" + "?newConference a <" + conferenceClass + "> . \n" + - "?newConference ?pubUri . \n" + + "?newConference ?pubUri . \n" + "?newConference <" + label + "> ?conference ."; } @@ -363,7 +363,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication <" + presentedAtPred + "> ?newConference . \n" + "?newConference a <" + conferenceClass + "> . \n" + - "?newConference ?newPublication . \n" + + "?newConference ?newPublication . \n" + "?newConference <" + label + "> ?conference ."; } @@ -377,7 +377,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:proceedingsOf ?newEvent . \n" + "?newEvent a <" + conferenceClass + "> . \n" + - "?newEvent vivo:hasProceedings ?pubUri . \n" + + "?newEvent vivo:hasProceedings ?pubUri . \n" + "?newEvent <" + label + "> ?event ."; } @@ -391,7 +391,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication vivo:proceedingsOf ?newEvent . \n" + "?newEvent a <" + conferenceClass + "> . \n" + - "?newEvent vivo:hasProceedings ?newPublication . \n" + + "?newEvent vivo:hasProceedings ?newPublication . \n" + "?newEvent <" + label + "> ?event ."; } @@ -408,7 +408,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?newEditor . \n" + "?newEditor a <" + editorClass + "> . \n" + - "?newEditor vivo:relatedBy ?editorship . \n" + + "?newEditor vivo:relatedBy ?editorship . \n" + "?newEditor <" + label + "> ?editor ."; } @@ -418,7 +418,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?editorship vivo:relates ?pubUri . \n" + "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?editorUri . \n" + - "?editorUri vivo:relatedBy ?editorship . "; + "?editorUri vivo:relatedBy ?editorship . "; } private String getN3ForNewEditorNewPub() { @@ -429,7 +429,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?editorship a vivo:Editorship . \n" + "?editorship vivo:relates ?newEditor . \n" + "?newEditor a <" + editorClass + "> . \n" + - "?newEditor vivo:relatedBy ?editorship . \n" + + "?newEditor vivo:relatedBy ?editorship . \n" + "?newEditor <" + label + "> ?editor ."; } @@ -440,14 +440,14 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement "?newPublication <" + label + "> ?title ." + "?editorship vivo:relates ?editorUri . \n" + "?editorship a vivo:Editorship . \n" + - "?editorUri vivo:relatedBy ?editorship . "; + "?editorUri vivo:relatedBy ?editorship . "; } private String getN3ForNewPublisher() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri vivo:publisher ?newPublisher . \n" + "?newPublisher a <" + publisherClass + "> . \n" + - "?newPublisher vivo:publisherOf ?pubUri . \n" + + "?newPublisher vivo:publisherOf ?pubUri . \n" + "?newPublisher <" + label + "> ?publisher ."; } @@ -461,7 +461,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication vivo:publisher ?newPublisher . \n" + "?newPublisher a <" + publisherClass + "> . \n" + - "?newPublisher vivo:publisherOf ?newPublication . \n" + + "?newPublisher vivo:publisherOf ?newPublication . \n" + "?newPublisher <" + label + "> ?publisher ."; } @@ -475,9 +475,9 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vcard: . \n" + "?newEditor ?vcardEditor . \n" + "?vcardEditor ?newEditor . \n" + - "?vcardEditor a . \n" + + "?vcardEditor a . \n" + "?vcardEditor vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; } @@ -485,9 +485,9 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vcard: . \n" + "?newEditor ?vcardEditor . \n" + "?vcardEditor ?newEditor . \n" + - "?vcardEditor a . \n" + + "?vcardEditor a . \n" + "?vcardEditor vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; } @@ -535,10 +535,10 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement } /** Get new resources */ - private Map generateNewResources(VitroRequest vreq) { + private Map generateNewResources(VitroRequest vreq) { String DEFAULT_NS_TOKEN=null; //null forces the default NS - HashMap newResources = new HashMap(); + HashMap newResources = new HashMap(); newResources.put("authorshipUri", DEFAULT_NS_TOKEN); newResources.put("newPublication", DEFAULT_NS_TOKEN); newResources.put("newCollection", DEFAULT_NS_TOKEN); @@ -554,21 +554,21 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return newResources; } - /** Set URIS and Literals In Scope and on form and supporting methods */ + /** Set URIS and Literals In Scope and on form and supporting methods */ private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap> urisInScope = new HashMap>(); - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); - editConfiguration.setUrisInScope(urisInScope); + editConfiguration.setUrisInScope(urisInScope); HashMap> literalsInScope = new HashMap>(); - editConfiguration.setLiteralsInScope(literalsInScope); + editConfiguration.setLiteralsInScope(literalsInScope); } private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); + List urisOnForm = new ArrayList(); //add role activity and roleActivityType to uris on form urisOnForm.add("pubType"); urisOnForm.add("pubUri"); @@ -605,11 +605,11 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement literalsOnForm.add("firstName"); literalsOnForm.add("lastName"); editConfiguration.setLiteralsOnForm(literalsOnForm); - } + } - /** Set SPARQL Queries and supporting methods. */ + /** Set SPARQL Queries and supporting methods. */ //In this case no queries for existing - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { editConfiguration.setSparqlForExistingUris(new HashMap()); editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); @@ -617,9 +617,9 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement } /** - * + * * Set Fields and supporting methods - * @throws Exception + * @throws Exception */ private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq) throws Exception { @@ -668,7 +668,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("pubType"). setValidators( list("nonempty") ). - setOptions( new ConstantFieldOptions("pubType", getPublicationTypeLiteralOptions() )) + setOptions( new ConstantFieldOptions("pubType", getPublicationTypeLiteralOptions() )) ); } @@ -697,7 +697,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("collectionUri")); } - + private void setBookLabelField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -705,7 +705,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setBookDisplayField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -718,7 +718,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("bookUri")); } - + private void setConferenceLabelField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -726,7 +726,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setConferenceDisplayField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -739,7 +739,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("conferenceUri")); } - + private void setEventLabelField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -747,7 +747,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setEventDisplayField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -756,7 +756,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setRangeDatatypeUri(stringDatatypeUri)); } - + private void setFirstNameField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -764,7 +764,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setLastNameField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -776,7 +776,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("eventUri")); } - + private void setEditorLabelField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -784,7 +784,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setEditorDisplayField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -797,7 +797,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("editorUri")); } - + private void setPublisherLabelField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -805,7 +805,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement setValidators(list("datatype:" + stringDatatypeUri)). setRangeDatatypeUri(stringDatatypeUri)); } - + private void setPublisherDisplayField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -818,7 +818,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("publisherUri")); } - + private void setLocaleField(EditConfigurationVTwo editConfiguration) { String stringDatatypeUri = XSD.xstring.toString(); editConfiguration.addField(new FieldVTwo(). @@ -879,11 +879,11 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement editConfiguration.addField(new FieldVTwo(). setName("dateTime"). setEditElement( - new DateTimeWithPrecisionVTwo(null, + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) - ); + ); } private List> getPublicationTypeLiteralOptions() { @@ -930,12 +930,12 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement } public String getSparqlForAcFilter(VitroRequest vreq) { - String subject = EditConfigurationUtils.getSubjectUri(vreq); + String subject = EditConfigurationUtils.getSubjectUri(vreq); - String query = "PREFIX core:<" + vivoCore + "> " + - "SELECT ?pubUri WHERE { " + - "<" + subject + "> core:relatedBy ?authorshipUri . " + - "?authorshipUri a core:Authorship . " + + String query = "PREFIX core:<" + vivoCore + "> " + + "SELECT ?pubUri WHERE { " + + "<" + subject + "> core:relatedBy ?authorshipUri . " + + "?authorshipUri a core:Authorship . " + "?authorshipUri core:relates ?pubUri . }"; return query; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddResearcherRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddResearcherRoleToPersonGenerator.java index b70c27e0..ae3bd262 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddResearcherRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddResearcherRoleToPersonGenerator.java @@ -7,9 +7,9 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantField import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddResearcherRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - + private static String template = "addResearcherRoleToPerson.ftl"; - + @Override String getTemplate() { return template; @@ -19,21 +19,21 @@ public class AddResearcherRoleToPersonGenerator extends AddRoleToPersonTwoStageG public String getRoleType() { return "http://vivoweb.org/ontology/core#ResearcherRole"; } - + /** Researcher role involves hard-coded options for the "right side" of the role or activity. */ @Override FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { return new ConstantFieldOptions( - "", "Select one", - "http://vivoweb.org/ontology/core#Grant", "Grant", - "http://purl.obolibrary.org/obo/ERO_0000015", "Human Study", + "", "Select one", + "http://vivoweb.org/ontology/core#Grant", "Grant", + "http://purl.obolibrary.org/obo/ERO_0000015", "Human Study", "http://vivoweb.org/ontology/core#Project", "Project", - "http://purl.obolibrary.org/obo/ERO_0000014", "Research Project"); + "http://purl.obolibrary.org/obo/ERO_0000014", "Research Project"); } - @Override + @Override boolean isShowRoleLabelField() { return true; } - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -49,5 +49,5 @@ public class AddResearcherRoleToPersonGenerator extends AddRoleToPersonTwoStageG String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } -*/ +*/ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddReviewerRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddReviewerRoleToPersonGenerator.java index e1c68edb..b12452d7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddReviewerRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddReviewerRoleToPersonGenerator.java @@ -6,36 +6,36 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; -public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - +public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { + private static String OBJECT_VCLASS_URI = "http://purl.org/ontology/bibo/Document"; - + @Override String getTemplate() { return "addReviewerRoleToPerson.ftl"; } - //The default activityToRolePredicate and roleToActivityPredicates are + //The default activityToRolePredicate and roleToActivityPredicates are //correct for this subclass so they don't need to be overwritten /* @Override public String getRoleToActivityPredicate(VitroRequest vreq) { return ""; } -*/ +*/ //role type will always be set based on particular form @Override public String getRoleType() { //TODO: Get dynamic way of including vivoweb ontology return "http://vivoweb.org/ontology/core#ReviewerRole"; - } - + } + /** * Each subclass generator will return its own type of option here: - * whether literal hardcoded, based on class group, or subclasses of a specific class + * whether literal hardcoded, based on class group, or subclasses of a specific class */ @Override FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { return new ConstantFieldOptions( - "", "Select type", + "", "Select type", "http://purl.org/ontology/bibo/AcademicArticle", "Academic Article", "http://purl.org/ontology/bibo/Article", "Article", "http://purl.org/ontology/bibo/AudioDocument", "Audio Document", @@ -106,13 +106,13 @@ public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGen "http://vivoweb.org/ontology/core#WorkingPaper", "Working Paper" ); } - + //isShowRoleLabelField remains true for this so doesn't need to be overwritten public boolean isShowRoleLabelField() { return false; } - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -128,6 +128,6 @@ public class AddReviewerRoleToPersonGenerator extends AddRoleToPersonTwoStageGen String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } - */ - + */ + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index e78c66e8..d29a437c 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -39,55 +39,55 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; /** - * Generates the edit configuration for adding a Role to a Person. - - Stage one is selecting the type of the non-person thing - associated with the Role with the intention of reducing the + * Generates the edit configuration for adding a Role to a Person. + + Stage one is selecting the type of the non-person thing + associated with the Role with the intention of reducing the number of Individuals that the user has to select from. Stage two is selecting the non-person Individual to associate - with the Role. + with the Role. This is intended to create a set of statements like: ?person core:hasResearchActivityRole ?newRole. - ?newRole rdf:type core:ResearchActivityRole ; + ?newRole rdf:type core:ResearchActivityRole ; roleToActivityPredicate ?someActivity . ?someActivity rdf:type core:ResearchActivity . ?someActivity rdfs:label "activity title" . - - - + + + Important: This form cannot be directly used as a custom form. It has parameters that must be set. See addClinicalRoleToPerson.jsp for an example. - + roleToActivityPredicate and activityToRolePredicate are both dependent on the type of the activity itself. For a new statement, the predicate type is not known. - For an existing statement, the predicate is known but may change based on the type of the activity newly selected. - - + For an existing statement, the predicate is known but may change based on the type of the activity newly selected. + + bdc34: TODO: figure out what needs to be customized per role form, document it here in comments TODO: rewrite class as an abstract class with simple, documented, required methods to override - + AddRoleToPersonTwoStageGenerator is abstract, each subclass will need to configure: From the old JSP version: - + showRoleLabelField boolean - roleType URI + roleType URI roleToActivityPredicate URI - activityToRolePredicate URI + activityToRolePredicate URI roleActivityType_optionsType roleActivityType_objectClassURI roleActivityType_literalOptions - + For the new generator version: template * */ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { - + private Log log = LogFactory.getLog(AddRoleToPersonTwoStageGenerator.class); - + /* ***** Methods that are REQUIRED to be implemented in subclasses ***** */ // abstract String getStartDatePrecision(); @@ -96,117 +96,117 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura /** Freemarker template to use */ abstract String getTemplate(); - - /** URI of type for the role context node */ + + /** URI of type for the role context node */ abstract String getRoleType(); - - /** return the java object that generates the role activity field options for - * the subclass. + + /** return the java object that generates the role activity field options for + * the subclass. * @throws Exception */ abstract FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception; - + /** In the case of literal options, subclass generator will set the options to be returned */ //not needed any more since the FieldOption can be returned //abstract HashMap getRoleActivityTypeLiteralOptions(); - + /** - * Each subclass generator will return its own type of option here: + * Each subclass generator will return its own type of option here: * whether literal hardcoded, based on class group, or subclasses of a specific class * The latter two will apparently lend some kind of uri to objectClassUri ? */ //not needed any more since the FieldOption can be returned //abstract RoleActivityOptionTypes getRoleActivityTypeOptionsType(); - + /** The URI of a Class to use with options if required. An option type like * CHILD_VCLASSES would reqire a role activity object class URI. */ //not needed any more since the FieldOption can be returned //abstract String getRoleActivityTypeObjectClassUri(VitroRequest vreq); - - /** If true an input should be shown on the form for a - * label for the role context node + + /** If true an input should be shown on the form for a + * label for the role context node * TODO: move this to the FTL and have label optional. */ abstract boolean isShowRoleLabelField(); - - /** URI of predicate between role context node and activity + + /** URI of predicate between role context node and activity * @throws Exception */ //Bdc34: not used anywhere? that's odd - //abstract String getActivityToRolePredicate(); - + //abstract String getActivityToRolePredicate(); + @Override - public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); initProcessParameters(vreq, session, editConfiguration); - - editConfiguration.setVarNameForSubject("person"); - editConfiguration.setVarNameForPredicate("rolePredicate"); + + editConfiguration.setVarNameForSubject("person"); + editConfiguration.setVarNameForPredicate("rolePredicate"); editConfiguration.setVarNameForObject("role"); - + // Required N3 - editConfiguration.setN3Required(list( + editConfiguration.setN3Required(list( N3_PREFIX + "\n" + "?person ?rolePredicate ?role .\n" + "?role a ?roleType .\n" + "?role ?inverseRolePredicate ?person ." - )); - - // Optional N3 + )); + + // Optional N3 //Note here we are placing the role to activity relationships as optional, since //it's possible to delete this relationship from the activity //On submission, if we kept these statements in n3required, the retractions would //not have all variables substituted, leading to an error //Note also we are including the relationship as a separate string in the array, to allow it to be - //independently evaluated and passed back with substitutions even if the other strings are not - //substituted correctly. + //independently evaluated and passed back with substitutions even if the other strings are not + //substituted correctly. editConfiguration.setN3Optional( list( getN3ForNewRoleActivity(), getN3ForExistingRoleActivity(), -// getN3ForActivityType(), +// getN3ForActivityType(), getN3RoleLabelAssertion(), getN3ForStart(), - getN3ForEnd() )); - + getN3ForEnd() )); + editConfiguration.setNewResources( newResources(vreq) ); - + //In scope setUrisAndLiteralsInScope(editConfiguration, vreq); - + //on Form setUrisAndLiteralsOnForm(editConfiguration, vreq); - + //Sparql queries setSparqlQueries(editConfiguration, vreq); - + //set fields setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); - + //Form title and submit label now moved to edit configuration template //TODO: check if edit configuration template correct place to set those or whether //additional methods here should be used and reference instead, e.g. edit configuration template could call //default obj property form.populateTemplate or some such method //Select from existing also set within template itself editConfiguration.setTemplate(getTemplate()); - + //Add validator editConfiguration.addValidator(new DateTimeIntervalValidationVTwo("startField","endField") ); editConfiguration.addValidator(new AntiXssValidation()); editConfiguration.addValidator(new AutocompleteRequiredInputValidator("existingRoleActivity", "activityLabel")); - + //Add preprocessors addPreprocessors(editConfiguration, vreq.getWebappDaoFactory()); //Adding additional data, specifically edit mode addFormSpecificData(editConfiguration, vreq); - + //prepare prepare(vreq, editConfiguration); return editConfiguration; - } + } + + private void initProcessParameters(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { + editConfiguration.setFormUrl(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); + editConfiguration.setEntityToReturnTo(EditConfigurationUtils.getSubjectUri(vreq)); + } - private void initProcessParameters(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { - editConfiguration.setFormUrl(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); - editConfiguration.setEntityToReturnTo(EditConfigurationUtils.getSubjectUri(vreq)); - } - /* N3 Required and Optional Generators as well as supporting methods */ - + private List getN3ForNewRoleActivity() { List n3ForNewRoleActivity = new ArrayList(); n3ForNewRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?roleActivity .\n"+ @@ -215,7 +215,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura "?roleActivity a ?roleActivityType ."); return n3ForNewRoleActivity; } - + private List getN3ForExistingRoleActivity() { List n3ForExistingRoleActivity = new ArrayList(); n3ForExistingRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?existingRoleActivity .\n"+ @@ -223,39 +223,39 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura "?existingRoleActivity a ?roleActivityType ."); return n3ForExistingRoleActivity; } - - + + private String getN3RoleLabelAssertion() { return "?role <" + RDFS.label.getURI() + "> ?roleLabel ."; } - + private List getN3ForStart() { List n3ForStart = new ArrayList(); - n3ForStart.add("?role <" + RoleToIntervalURI + "> ?intervalNode ." + - "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + - "?intervalNode <" + IntervalToStartURI + "> ?startNode ." + - "?startNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + - "?startNode <" + DateTimeValueURI + "> ?startField-value ." + + n3ForStart.add("?role <" + RoleToIntervalURI + "> ?intervalNode ." + + "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + + "?intervalNode <" + IntervalToStartURI + "> ?startNode ." + + "?startNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + + "?startNode <" + DateTimeValueURI + "> ?startField-value ." + "?startNode <" + DateTimePrecisionURI + "> ?startField-precision ."); return n3ForStart; } - + private List getN3ForEnd() { List n3ForEnd = new ArrayList(); - n3ForEnd.add("?role <" + RoleToIntervalURI + "> ?intervalNode . " + - "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + - "?intervalNode <" + IntervalToEndURI + "> ?endNode ." + - "?endNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + - "?endNode <" + DateTimeValueURI + "> ?endField-value ." + + n3ForEnd.add("?role <" + RoleToIntervalURI + "> ?intervalNode . " + + "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + + "?intervalNode <" + IntervalToEndURI + "> ?endNode ." + + "?endNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + + "?endNode <" + DateTimeValueURI + "> ?endField-value ." + "?endNode <" + DateTimePrecisionURI+ "> ?endField-precision ."); - return n3ForEnd; + return n3ForEnd; } - + /** Get new resources */ - private Map newResources(VitroRequest vreq) { + private Map newResources(VitroRequest vreq) { String DEFAULT_NS_TOKEN=null; //null forces the default NS - - HashMap newResources = new HashMap(); + + HashMap newResources = new HashMap(); newResources.put("role", DEFAULT_NS_TOKEN); newResources.put("roleActivity", DEFAULT_NS_TOKEN); newResources.put("intervalNode", DEFAULT_NS_TOKEN); @@ -263,22 +263,22 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura newResources.put("endNode", DEFAULT_NS_TOKEN); return newResources; } - - /** Set URIS and Literals In Scope and on form and supporting methods */ + + /** Set URIS and Literals In Scope and on form and supporting methods */ private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap> urisInScope = new HashMap>(); - + //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); + urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); urisInScope.put("roleType", list( getRoleType() ) ); - + //Uris in scope include subject, predicate, and object var - editConfiguration.setUrisInScope(urisInScope); - + editConfiguration.setUrisInScope(urisInScope); + //literals in scope empty initially, usually populated by code in prepare for update //with existing values for variables } - + private List getInversePredicate(VitroRequest vreq) { List inversePredicateArray = new ArrayList(); ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); @@ -289,7 +289,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura } private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); + List urisOnForm = new ArrayList(); //add role activity and roleActivityType to uris on form urisOnForm.add("existingRoleActivity"); urisOnForm.add("roleActivityType"); @@ -298,30 +298,30 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura urisOnForm.add("roleToActivityPredicate"); urisOnForm.add("activityToRolePredicate"); editConfiguration.setUrisOnform(urisOnForm); - + //activity label and role label are literals on form List literalsOnForm = new ArrayList(); literalsOnForm.add("activityLabel"); literalsOnForm.add("activityLabelDisplay"); literalsOnForm.add("roleLabel"); editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - /** Set SPARQL Queries and supporting methods. - * @throws Exception */ - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) throws Exception { + } + + /** Set SPARQL Queries and supporting methods. + * @throws Exception */ + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) throws Exception { //Queries for activity label, role label, start Field value, end Field value HashMap map = new HashMap(); map.put("activityLabel", getActivityLabelQuery(vreq)); map.put("roleLabel", getRoleLabelQuery(vreq)); map.put("startField-value", getExistingStartDateQuery(vreq)); map.put("endField-value", getExistingEndDateQuery(vreq)); - + editConfiguration.setSparqlForExistingLiterals(map); - - //Queries for role activity, activity type query, interval node, + + //Queries for role activity, activity type query, interval node, // start node, end node, start field precision, endfield precision - map = new HashMap(); + map = new HashMap(); map.put("existingRoleActivity", getExistingRoleActivityQuery(vreq)); map.put("roleActivityType", getActivityTypeQuery(vreq)); map.put("intervalNode", getIntervalNodeQuery(vreq)); @@ -331,13 +331,13 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura map.put("endField-precision", getEndPrecisionQuery(vreq)); //Also need sparql queries for roleToActivityPredicate and activityToRolePredicate map.put("roleToActivityPredicate", getRoleToActivityPredicateQuery(vreq)); - map.put("activityToRolePredicate", getActivityToRolePredicateQuery(vreq)); - + map.put("activityToRolePredicate", getActivityToRolePredicateQuery(vreq)); + editConfiguration.setSparqlForExistingUris(map); } - + private String getActivityToRolePredicateQuery(VitroRequest vreq) { - String query = "SELECT ?existingActivityToRolePredicate \n " + + String query = "SELECT ?existingActivityToRolePredicate \n " + "WHERE { \n" + "?roleActivity ?existingActivityToRolePredicate ?role .\n"; //Get possible predicates @@ -352,7 +352,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura } private String getRoleToActivityPredicateQuery(VitroRequest vreq) { - String query = "SELECT ?existingRoleToActivityPredicate \n " + + String query = "SELECT ?existingRoleToActivityPredicate \n " + "WHERE { \n" + "?role ?existingRoleToActivityPredicate ?roleActivity .\n"; //Get possible predicates @@ -366,7 +366,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + "?endNode <" + DateTimePrecisionURI + "> ?existingEndPrecision . }"; return query; } @@ -376,7 +376,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + "?intervalNode <" + IntervalToStartURI + "> ?startNode .\n" + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + "?startNode <" + DateTimePrecisionURI + "> ?existingStartPrecision . }"; return query; } @@ -386,116 +386,116 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ "?intervalNode <" + IntervalToEndURI + "> ?existingEndNode . \n"+ - "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}\n"; + "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}\n"; return query; } private String getStartNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingStartNode WHERE {\n"+ - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ - "?intervalNode <" + IntervalToStartURI + "> ?existingStartNode . \n"+ - "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}"; + String query = "SELECT ?existingStartNode WHERE {\n"+ + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ + "?intervalNode <" + IntervalToStartURI + "> ?existingStartNode . \n"+ + "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}"; return query; } private String getIntervalNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingIntervalNode WHERE { \n" + - "?role <" + RoleToIntervalURI + "> ?existingIntervalNode . \n" + + String query = "SELECT ?existingIntervalNode WHERE { \n" + + "?role <" + RoleToIntervalURI + "> ?existingIntervalNode . \n" + " ?existingIntervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> . }\n"; return query; } /** * Utility method for subclasses to make a query for type from a ConstantFieldOptions object. - * @throws Exception + * @throws Exception */ protected String getActivityTypeQueryForConstantOptions(VitroRequest vreq, ConstantFieldOptions fieldOptions ) throws Exception{ - - //make list of type URIs from options, this can be called with null since - //ConstantFieldOptions doesn't use any of the arguments. + + //make list of type URIs from options, this can be called with null since + //ConstantFieldOptions doesn't use any of the arguments. Map options = fieldOptions.getOptions(null, null, null) ; - - if (options != null && options.size() > 0) { - List typeUris = new ArrayList(); + + if (options != null && options.size() > 0) { + List typeUris = new ArrayList(); for(String typeUri: options.keySet()) { if(typeUri != null && !typeUri.isEmpty()) { typeUris.add("(?existingActivityType = <" + typeUri + ">)"); } - } - + } + String defaultActivityTypeQuery = getDefaultActivityTypeQuery(vreq); String typeFilters = "FILTER (" + StringUtils.join(typeUris, "||") + ")"; - return defaultActivityTypeQuery.replaceAll("}$", "") + typeFilters + "}"; - } else { - return getDefaultActivityTypeQuery(vreq); - } + return defaultActivityTypeQuery.replaceAll("}$", "") + typeFilters + "}"; + } else { + return getDefaultActivityTypeQuery(vreq); + } } - + /** * Utility method for subclasses to make a query for type from a ChildVClassesOptions object. */ protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){ log.debug("objectClassUri = " + opts.getClassUri()); return QueryUtils.subUriForQueryVar( - getSubclassActivityTypeQuery(vreq), - "objectClassUri", opts.getClassUri()); + getSubclassActivityTypeQuery(vreq), + "objectClassUri", opts.getClassUri()); } - + /** * Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object. */ protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){ log.debug("ClassGroupUri = " + opts.getClassGroupUri()); return QueryUtils.subUriForQueryVar( - getClassgroupActivityTypeQuery(vreq), - "classgroup", opts.getClassGroupUri()); + getClassgroupActivityTypeQuery(vreq), + "classgroup", opts.getClassGroupUri()); } - + /* - * The activity type query results must be limited to the values in the activity type select element. + * The activity type query results must be limited to the values in the activity type select element. * Sometimes the query returns a superclass such as owl:Thing instead. - * Make use of vitro:mostSpecificType so that, for example, an individual is both a + * Make use of vitro:mostSpecificType so that, for example, an individual is both a * core:InvitedTalk and a core:Presentation, core:InvitedTalk is selected. * vitro:mostSpecificType alone may not suffice, since it does not guarantee that the value returned * is in the select list. - * We could still have problems if the value from the select list is not a vitro:mostSpecificType, + * We could still have problems if the value from the select list is not a vitro:mostSpecificType, * but that is unlikely. - * + * */ - private String getActivityTypeQuery(VitroRequest vreq) throws Exception { + private String getActivityTypeQuery(VitroRequest vreq) throws Exception { String activityTypeQuery = null; - - FieldOptions fieldOpts = getRoleActivityFieldOptions(vreq); + + FieldOptions fieldOpts = getRoleActivityFieldOptions(vreq); try{ if( fieldOpts == null ){ activityTypeQuery = getDefaultActivityTypeQuery(vreq); }if( fieldOpts instanceof ConstantFieldOptions ){ - activityTypeQuery = getActivityTypeQueryForConstantOptions(vreq, (ConstantFieldOptions)fieldOpts); // + activityTypeQuery = getActivityTypeQueryForConstantOptions(vreq, (ConstantFieldOptions)fieldOpts); // }else if (fieldOpts instanceof ChildVClassesOptions ){ activityTypeQuery = getActivityTypeQueryForChildVClassOptions(vreq, (ChildVClassesOptions)fieldOpts); }else if( fieldOpts instanceof IndividualsViaClassGroupOptions){ - activityTypeQuery = getActivityTypeQueryForIndividualsViaClassGroupOptions(vreq, (IndividualsViaClassGroupOptions)fieldOpts); + activityTypeQuery = getActivityTypeQueryForIndividualsViaClassGroupOptions(vreq, (IndividualsViaClassGroupOptions)fieldOpts); } }catch(Exception ex){ log.debug("error while building activity type query",ex); - } + } activityTypeQuery = getDefaultActivityTypeQuery(vreq); //The replacement of activity type query's predicate was only relevant when we actually //know which predicate is definitely being used here - //Here we have multiple values possible for predicate so the original - //Replacement should only happen when we have an actual predicate + //Here we have multiple values possible for predicate so the original + //Replacement should only happen when we have an actual predicate //String replaceRoleToActivityPredicate = getRoleToActivityPredicate(vreq); activityTypeQuery = QueryUtils.replaceQueryVar(activityTypeQuery, "predicate", getRoleToActivityPlaceholderName()); - - log.debug("Activity type query: " + activityTypeQuery); + + log.debug("Activity type query: " + activityTypeQuery); return activityTypeQuery; } - + private String getDefaultActivityTypeQuery(VitroRequest vreq) { String query = "PREFIX core: <" + VIVO_NS + ">\n" + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + @@ -503,7 +503,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura " ?role ?predicate ?existingActivity . \n" + " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n"; query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; + query+= "}"; return query; } @@ -516,7 +516,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + " ?existingActivityType rdfs:subClassOf ?objectClassUri . \n"; query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; + query+= "}"; return query; } @@ -528,7 +528,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + " ?existingActivityType vitro:inClassGroup ?classgroup . \n"; query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; + query+= "}"; return query; } @@ -536,31 +536,31 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura private String getExistingRoleActivityQuery(VitroRequest vreq) { //If role to activity predicate is the default query, then we need to replace with a union //of both realizedIn and the other - String query = "PREFIX core: <" + VIVO_NS + ">"; - - query += "SELECT ?existingRoleActivity WHERE { \n" + - " ?role ?predicate ?existingRoleActivity . \n "; + String query = "PREFIX core: <" + VIVO_NS + ">"; + + query += "SELECT ?existingRoleActivity WHERE { \n" + + " ?role ?predicate ?existingRoleActivity . \n "; query += getFilterRoleToActivityPredicate("predicate"); query += "}"; return query; } - + private String getExistingEndDateQuery(VitroRequest vreq) { - String query = " SELECT ?existingEndDate WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + + String query = " SELECT ?existingEndDate WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + "?endNode <" + DateTimeValueURI + "> ?existingEndDate . }"; return query; } private String getExistingStartDateQuery(VitroRequest vreq) { - String query = "SELECT ?existingDateStart WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToStartURI+ "> ?startNode .\n" + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + + String query = "SELECT ?existingDateStart WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToStartURI+ "> ?startNode .\n" + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + "?startNode <" + DateTimeValueURI + "> ?existingDateStart . }"; return query; @@ -573,23 +573,23 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura } private String getActivityLabelQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + VIVO_NS + ">" + + String query = "PREFIX core: <" + VIVO_NS + ">" + "PREFIX rdfs: <" + RDFS.getURI() + "> \n"; - query += "SELECT ?existingTitle WHERE { \n" + - "?role ?predicate ?existingActivity . \n" + + query += "SELECT ?existingTitle WHERE { \n" + + "?role ?predicate ?existingActivity . \n" + "?existingActivity rdfs:label ?existingTitle . \n"; query += getFilterRoleToActivityPredicate("predicate"); - query += "}"; + query += "}"; return query; } /** - * + * * Set Fields and supporting methods - * @throws Exception + * @throws Exception */ - + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) throws Exception { Map fields = new HashMap(); //Multiple fields @@ -606,71 +606,71 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura getActivityToRolePredicateField(editConfiguration, vreq, fields); editConfiguration.setFields(fields); } - + //This is a literal technically? private void getActivityToRolePredicateField( EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { - + FieldVTwo field = new FieldVTwo(); - + String fieldName = "activityToRolePredicate"; - field.setName(fieldName); - + field.setName(fieldName); + //get range data type uri and range language String stringDatatypeUri = XSD.xstring.toString(); field.setRangeDatatypeUri( stringDatatypeUri ); - - fields.put(field.getName(), field); + + fields.put(field.getName(), field); } private void getRoleToActivityPredicateField( EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { - + FieldVTwo field = new FieldVTwo(); - + String fieldName = "roleToActivityPredicate"; - field.setName(fieldName); - + field.setName(fieldName); + //get range data type uri and range language String stringDatatypeUri = XSD.xstring.toString(); field.setRangeDatatypeUri(stringDatatypeUri); - - fields.put(field.getName(), field); + + fields.put(field.getName(), field); } //Label of "right side" of role, i.e. label for role roleIn Activity private void getActivityLabelField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { - + FieldVTwo field = new FieldVTwo(); String fieldName = "activityLabel"; - field.setName(fieldName); - + field.setName(fieldName); + //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); + String stringDatatypeUri = XSD.xstring.toString(); field.setRangeDatatypeUri(stringDatatypeUri); - + List validators = new ArrayList(); validators.add("datatype:" + stringDatatypeUri); - field.setValidators(validators); - - fields.put(field.getName(), field); + field.setValidators(validators); + + fields.put(field.getName(), field); } - + private void getActivityLabelDisplayField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { + VitroRequest vreq, Map fields) { FieldVTwo field = new FieldVTwo(); - + String fieldName = "activityLabelDisplay"; - field.setName(fieldName); - + field.setName(fieldName); + //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); + String stringDatatypeUri = XSD.xstring.toString(); field.setRangeDatatypeUri(stringDatatypeUri); - - fields.put(field.getName(), field); + + fields.put(field.getName(), field); } //type of "right side" of role, i.e. type of activity from role roleIn activity @@ -679,21 +679,21 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura Map fields) throws Exception { String fieldName = "roleActivityType"; //get range data type uri and range language - + FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - + field.setName(fieldName); + List validators = new ArrayList(); if(isAddMode(vreq) || isRepairMode(vreq)) { validators.add("nonempty"); } field.setValidators(validators); - + field.setOptions( getRoleActivityFieldOptions(vreq) ); - -// field.setOptionsType(getRoleActivityTypeOptionsType().toString()); -// field.setObjectClassUri(getRoleActivityTypeObjectClassUri(vreq)); -// + +// field.setOptionsType(getRoleActivityTypeOptionsType().toString()); +// field.setObjectClassUri(getRoleActivityTypeObjectClassUri(vreq)); +// // HashMap literalOptionsMap = getRoleActivityTypeLiteralOptions(); // List> fieldLiteralOptions = new ArrayList>(); // Set optionUris = literalOptionsMap.keySet(); @@ -704,84 +704,84 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura // fieldLiteralOptions.add(uriLabelArray); // } // field.setLiteralOptions(fieldLiteralOptions); - + fields.put(field.getName(), field); - - } - + + } + //Assuming URI for activity for role? private void getExistingRoleActivityField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { String fieldName = "existingRoleActivity"; - + FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - - fields.put(field.getName(), field); + field.setName(fieldName); + + fields.put(field.getName(), field); } - + private void getRoleLabelField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { String fieldName = "roleLabel"; - + FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - + field.setName(fieldName); + String stringDatatypeUri = XSD.xstring.toString(); field.setRangeDatatypeUri(stringDatatypeUri); List validators = new ArrayList(); validators.add("datatype:" + stringDatatypeUri); - field.setValidators(validators); - - fields.put(field.getName(), field); - } + field.setValidators(validators); + + fields.put(field.getName(), field); + } private void getStartField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { FieldVTwo field = new FieldVTwo(); - - String fieldName = "startField"; - field.setName(fieldName); - + + String fieldName = "startField"; + field.setName(fieldName); + field.setEditElement( - new DateTimeWithPrecisionVTwo(field, + new DateTimeWithPrecisionVTwo(field, getStartDatePrecision(), - VitroVocabulary.Precision.NONE.uri())); - - fields.put(field.getName(), field); + VitroVocabulary.Precision.NONE.uri())); + + fields.put(field.getName(), field); } private void getEndField(EditConfigurationVTwo editConfiguration, VitroRequest vreq, Map fields) { FieldVTwo field = new FieldVTwo(); - - String fieldName = "endField"; - field.setName(fieldName); + + String fieldName = "endField"; + field.setName(fieldName); field.setEditElement( - new DateTimeWithPrecisionVTwo(field, + new DateTimeWithPrecisionVTwo(field, getEndDatePrecision(), VitroVocabulary.Precision.NONE.uri())); - - fields.put(field.getName(), field); + + fields.put(field.getName(), field); } - + private void addPreprocessors(EditConfigurationVTwo editConfiguration, WebappDaoFactory wadf) { //Add preprocessor that will replace the role to activity predicate and inverse //with correct properties based on the activity type editConfiguration.addEditSubmissionPreprocessor( new RoleToActivityPredicatePreprocessor(editConfiguration, wadf)); - + } - + //This has a default value, but note that even that will not be used //in the update with realized in or contributes to //Overridden when need be in subclassed generator - //Also note that for now we're going to actually going to return a - //placeholder value by default + //Also note that for now we're going to actually going to return a + //placeholder value by default public String getRoleToActivityPredicate(VitroRequest vreq) { //TODO: and ?placeholder are incompatible return getRoleToActivityPlaceholder(); @@ -793,12 +793,12 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura public List getPossibleRoleToActivityPredicates() { return ModelUtils.getPossiblePropertiesForRole(); } - + public List getPossibleActivityToRolePredicates() { return ModelUtils.getPossibleInversePropertiesForRole(); } - - /* Methods that check edit mode */ + + /* Methods that check edit mode */ public EditMode getEditMode(VitroRequest vreq) { List roleToGrantPredicates = getPossibleRoleToActivityPredicates(); return EditModeUtils.getEditMode(vreq, roleToGrantPredicates); @@ -807,28 +807,28 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura private boolean isAddMode(VitroRequest vreq) { return EditModeUtils.isAddMode(getEditMode(vreq)); } - + private boolean isEditMode(VitroRequest vreq) { return EditModeUtils.isEditMode(getEditMode(vreq)); } - + private boolean isRepairMode(VitroRequest vreq) { return EditModeUtils.isRepairMode(getEditMode(vreq)); } - + /* URIS for various predicates */ private final String VIVO_NS="http://vivoweb.org/ontology/core#"; - - private final String RoleToIntervalURI = VIVO_NS + "dateTimeInterval"; - private final String IntervalTypeURI = VIVO_NS + "DateTimeInterval"; - private final String IntervalToStartURI = VIVO_NS + "start"; - private final String IntervalToEndURI = VIVO_NS + "end"; - private final String StartYearPredURI = VIVO_NS + "startYear"; + + private final String RoleToIntervalURI = VIVO_NS + "dateTimeInterval"; + private final String IntervalTypeURI = VIVO_NS + "DateTimeInterval"; + private final String IntervalToStartURI = VIVO_NS + "start"; + private final String IntervalToEndURI = VIVO_NS + "end"; + private final String StartYearPredURI = VIVO_NS + "startYear"; private final String EndYearPredURI = VIVO_NS + "endYear"; - private final String DateTimeValueTypeURI=VIVO_NS + "DateTimeValue"; - private final String DateTimePrecisionURI=VIVO_NS + "dateTimePrecision"; - private final String DateTimeValueURI = VIVO_NS + "dateTime"; - + private final String DateTimeValueTypeURI=VIVO_NS + "DateTimeValue"; + private final String DateTimePrecisionURI=VIVO_NS + "dateTimePrecision"; + private final String DateTimeValueURI = VIVO_NS + "dateTime"; + //Form specific data public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); @@ -844,7 +844,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura //Put in the fact that we require field editConfiguration.setFormSpecificData(formSpecificData); } - + public String getFilterRoleToActivityPredicate(String predicateVar) { String addFilter = "FILTER ("; List predicates = getPossibleRoleToActivityPredicates(); @@ -856,16 +856,16 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura addFilter += ")"; return addFilter; } - + private String getRoleToActivityPlaceholder() { return "?" + getRoleToActivityPlaceholderName(); } - + private String getRoleToActivityPlaceholderName() { return "roleToActivityPredicate"; } - - + + private String getActivityToRolePlaceholder() { return "?activityToRolePredicate"; } @@ -876,9 +876,9 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura CHILD_VCLASSES, HARDCODED_LITERALS }; - + private final String N3_PREFIX = "@prefix core: ."; - + protected String getStartDatePrecision() { String precision = VitroVocabulary.Precision.YEAR.uri(); return precision; @@ -888,6 +888,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura String precision = VitroVocabulary.Precision.YEAR.uri(); return precision; } - - + + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java index 968b6586..c1ae9621 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java @@ -6,19 +6,19 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; -public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - +public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { + private static String OPTION_CLASS_URI = "http://xmlns.com/foaf/0.1/Organization"; @Override String getTemplate() { return "addServiceProviderRoleToPerson.ftl"; } @Override - String getRoleType() { + String getRoleType() { return "http://purl.obolibrary.org/obo/ERO_0000012"; - } + } - /** Service Provider role involves hard-coded options for the + /** Service Provider role involves hard-coded options for the * "right side" of the role or activity. */ @Override FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { @@ -74,11 +74,11 @@ FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { "http://purl.org/ontology/bibo/Workshop", "Workshop", "http://vivoweb.org/ontology/core#WorkshopSeries", "Workshop Series"); } - + @Override boolean isShowRoleLabelField(){return true;} - /* + /* * Use the methods below to change the date/time precision in the * custom form associated with this generator. When not used, the * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, @@ -94,5 +94,5 @@ FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { String precision = VitroVocabulary.Precision.DAY.uri(); return precision; } -*/ +*/ } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddTeacherRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddTeacherRoleToPersonGenerator.java index b059f952..49dbc911 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddTeacherRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddTeacherRoleToPersonGenerator.java @@ -1,55 +1,55 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; - -public class AddTeacherRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { - - private static String template = "addTeacherRoleToPerson.ftl"; - - @Override - String getTemplate() { - return template; - } - - @Override - String getRoleType() { - return "http://vivoweb.org/ontology/core#TeacherRole"; - } - - - /** Teacher role involves hard-coded options for the "right side" - * of the role or activity. */ - @Override - FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { - return new ConstantFieldOptions( - "", "Select one", - "http://purl.org/ontology/bibo/Conference", "Conference", - "http://vivoweb.org/ontology/core#Course", "Course", - "http://purl.org/ontology/bibo/Workshop", "Workshop"); - } - - @Override - boolean isShowRoleLabelField(){return true;} - - /* - * Use the methods below to change the date/time precision in the - * custom form associated with this generator. When not used, the - * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, - * MINUTE, TIME and NONE. - */ -/* - public String getStartDatePrecision() { - String precision = VitroVocabulary.Precision.MONTH.uri(); - return precision; - } - - public String getEndDatePrecision() { - String precision = VitroVocabulary.Precision.DAY.uri(); - return precision; - } -*/ -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; + +public class AddTeacherRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { + + private static String template = "addTeacherRoleToPerson.ftl"; + + @Override + String getTemplate() { + return template; + } + + @Override + String getRoleType() { + return "http://vivoweb.org/ontology/core#TeacherRole"; + } + + + /** Teacher role involves hard-coded options for the "right side" + * of the role or activity. */ + @Override + FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { + return new ConstantFieldOptions( + "", "Select one", + "http://purl.org/ontology/bibo/Conference", "Conference", + "http://vivoweb.org/ontology/core#Course", "Course", + "http://purl.org/ontology/bibo/Workshop", "Workshop"); + } + + @Override + boolean isShowRoleLabelField(){return true;} + + /* + * Use the methods below to change the date/time precision in the + * custom form associated with this generator. When not used, the + * precision will be YEAR. The other precisons are MONTH, DAY, HOUR, + * MINUTE, TIME and NONE. + */ +/* + public String getStartDatePrecision() { + String precision = VitroVocabulary.Precision.MONTH.uri(); + return precision; + } + + public String getEndDatePrecision() { + String precision = VitroVocabulary.Precision.DAY.uri(); + return precision; + } +*/ +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddUserDefinedConceptGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddUserDefinedConceptGenerator.java index 4661793a..100df8fc 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddUserDefinedConceptGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddUserDefinedConceptGenerator.java @@ -1,311 +1,311 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpSession; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.vocabulary.XSD; - -import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; -import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; -import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; -/** - * Generates the edit configuration for importing concepts from external - * search services, e.g. UMLS etc. - */ -public class AddUserDefinedConceptGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { - - private Log log = LogFactory.getLog(AddUserDefinedConceptGenerator.class); - private boolean isObjectPropForm = false; - private String subjectUri = null; - private String predicateUri = null; - private String objectUri = null; - private String datapropKeyStr= null; - private int dataHash = 0; - private DataPropertyStatement dps = null; - private String dataLiteral = null; - private String template = "addUserDefinedConcept.ftl"; - private static HashMap defaultsForXSDtypes ; - private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; - - @Override - public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); - initBasics(editConfiguration, vreq); - initPropertyParameters(vreq, session, editConfiguration); - initObjectPropForm(editConfiguration, vreq); - - editConfiguration.setTemplate(template); - - setVarNames(editConfiguration); - - //Assumes this is a simple case of subject predicate var - editConfiguration.setN3Required(this.generateN3Required(vreq)); - - //n3 optional - editConfiguration.setN3Optional(this.generateN3Optional()); - - //Todo: what do new resources depend on here? - //In original form, these variables start off empty - editConfiguration.setNewResources(generateNewResources(vreq)); - //In scope - this.setUrisAndLiteralsInScope(editConfiguration, vreq); - - //on Form - this.setUrisAndLiteralsOnForm(editConfiguration, vreq); - - editConfiguration.setFilesOnForm(new ArrayList()); - - //Sparql queries - this.setSparqlQueries(editConfiguration, vreq); - - //set fields - setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); - - - setTemplate(editConfiguration, vreq); - - editConfiguration.addValidator(new AntiXssValidation()); - - //Add preprocessors - addPreprocessors(editConfiguration, vreq.getWebappDaoFactory()); - //Adding additional data, specifically edit mode - addFormSpecificData(editConfiguration, vreq); - //One override for basic functionality, changing url pattern - //and entity - //Adding term should return to this same page, not the subject - //Return takes the page back to the individual form - editConfiguration.setUrlPatternToReturnTo(getUrlPatternToReturnTo(vreq)); - prepare(vreq, editConfiguration); - return editConfiguration; - } - - - - private String getUrlPatternToReturnTo(VitroRequest vreq) { - String subjectUri = EditConfigurationUtils.getSubjectUri(vreq); - String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); - String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAssociatedConceptGenerator"; - String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq); - return editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + - "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + - "&editForm=" + UrlBuilder.urlEncode(generatorName); - } - - - - private void setVarNames(EditConfigurationVTwo editConfiguration) { - editConfiguration.setVarNameForSubject("subject"); - editConfiguration.setVarNameForPredicate("predicate"); - editConfiguration.setVarNameForObject("conceptNode"); - } - - protected void setTemplate(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.setTemplate(template); - - } - - - - /* - * N3 Required and Optional Generators as well as supporting methods - */ - - private String getPrefixesString() { - //TODO: Include dynamic way of including this - return "@prefix core: ."; - } - - - //Here, the node is typed as a skos concept - private List generateN3Required(VitroRequest vreq) { - List n3Required = list( - getPrefixesString() + "\n" + - "?subject ?predicate ?conceptNode .\n" - ); - List inversePredicate = getInversePredicate(vreq); - //Adding inverse predicate if it exists - if(inversePredicate.size() > 0) { - n3Required.add("?conceptNode <" + inversePredicate.get(0) + "> ?subject ."); - } - return n3Required; - } - - //Optional b/c user may select an existing SKOS concept - private List generateN3Optional() { - return list( - "?conceptNode <" + VitroVocabulary.RDF_TYPE + "> <" + SKOSConceptType + "> .\n" + - "?conceptNode <" + label + "> ?conceptLabel ." - ); - - } - - - - - /* - * Get new resources - */ - private Map generateNewResources(VitroRequest vreq) { - HashMap newResources = new HashMap(); - newResources.put("conceptNode", null); - //There are no new resources here, the concept node uri doesn't - //get created but already exists, and vocab uri should already exist as well - return newResources; - } - - - - - /* - * Set URIS and Literals In Scope and on form and supporting methods - */ - - private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap> urisInScope = new HashMap>(); - //note that at this point the subject, predicate, and object var parameters have already been processed - //these two were always set when instantiating an edit configuration object from json, - //although the json itself did not specify subject/predicate as part of uris in scope - urisInScope.put(editConfiguration.getVarNameForSubject(), - Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), - Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); - //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); - - - editConfiguration.setUrisInScope(urisInScope); - //Uris in scope include subject, predicate, and object var - //literals in scope empty initially, usually populated by code in prepare for update - //with existing values for variables - editConfiguration.setLiteralsInScope(new HashMap>()); - } - - private List getInversePredicate(VitroRequest vreq) { - List inversePredicateArray = new ArrayList(); - ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); - if(op != null && op.getURIInverse() != null) { - inversePredicateArray.add(op.getURIInverse()); - } - return inversePredicateArray; - } - - //n3 should look as follows - //?subject ?predicate ?objectVar - - private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); - List literalsOnForm = new ArrayList(); - //The URI of the node that defines the concept - urisOnForm.add("conceptNode"); - editConfiguration.setUrisOnform(urisOnForm); - //In case the user defines a new concept, will add a concept label - literalsOnForm.add("conceptLabel"); - editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - - /** - * Set SPARQL Queries and supporting methods - */ - - - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - //Sparql queries defining retrieval of literals etc. - editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); - Map urisInScope = new HashMap(); - editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); - editConfiguration.setSparqlForExistingLiterals(new HashMap()); - editConfiguration.setSparqlForExistingUris(new HashMap()); - } - - /** - * - * Set Fields and supporting methods - */ - - private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { - setConceptNodeField(editConfiguration, vreq); - setConceptLabelField(editConfiguration, vreq); - } - - //this field will be hidden and include the concept node URI - private void setConceptNodeField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptNode")); - } - - - private void setConceptLabelField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq) { - editConfiguration.addField(new FieldVTwo(). - setName("conceptLabel"). - setValidators(list("datatype:" + XSD.xstring.toString())). - setRangeDatatypeUri(XSD.xstring.toString()) - ); - } - - - - - - - - - //Add preprocessor - - private void addPreprocessors(EditConfigurationVTwo editConfiguration, WebappDaoFactory wadf) { - //Will be a completely different type of preprocessor - /* - editConfiguration.addEditSubmissionPreprocessor( - new RoleToActivityPredicatePreprocessor(editConfiguration, wadf)); - */ - } - - - //Form specific data - public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap formSpecificData = new HashMap(); - formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq)); - formSpecificData.put("conceptType", SKOSConceptType); - editConfiguration.setFormSpecificData(formSpecificData); - } - - - public String getSparqlForAcFilter(VitroRequest vreq) { - String subject = EditConfigurationUtils.getSubjectUri(vreq); - String predicate = EditConfigurationUtils.getPredicateUri(vreq); - String query = "PREFIX core:<" + vivoCore + "> " + - "SELECT ?conceptNode WHERE { " + - "<" + subject + "> <" + predicate + "> ?conceptNode ." + - "?conceptNode <" + VitroVocabulary.RDF_TYPE + "> <" + SKOSConceptType + "> . }"; - return query; - } - - //skos concepts can be added for either research areas or subject areas - //IF coming in from a different form then can get the predicate here as it will be stored - public String getCurrentPredicate(VitroRequest vreq) { - return vreq.getParameter("conceptPredicate"); - } - - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpSession; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.vocabulary.XSD; + +import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; +/** + * Generates the edit configuration for importing concepts from external + * search services, e.g. UMLS etc. + */ +public class AddUserDefinedConceptGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { + + private Log log = LogFactory.getLog(AddUserDefinedConceptGenerator.class); + private boolean isObjectPropForm = false; + private String subjectUri = null; + private String predicateUri = null; + private String objectUri = null; + private String datapropKeyStr= null; + private int dataHash = 0; + private DataPropertyStatement dps = null; + private String dataLiteral = null; + private String template = "addUserDefinedConcept.ftl"; + private static HashMap defaultsForXSDtypes ; + private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; + + @Override + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + initBasics(editConfiguration, vreq); + initPropertyParameters(vreq, session, editConfiguration); + initObjectPropForm(editConfiguration, vreq); + + editConfiguration.setTemplate(template); + + setVarNames(editConfiguration); + + //Assumes this is a simple case of subject predicate var + editConfiguration.setN3Required(this.generateN3Required(vreq)); + + //n3 optional + editConfiguration.setN3Optional(this.generateN3Optional()); + + //Todo: what do new resources depend on here? + //In original form, these variables start off empty + editConfiguration.setNewResources(generateNewResources(vreq)); + //In scope + this.setUrisAndLiteralsInScope(editConfiguration, vreq); + + //on Form + this.setUrisAndLiteralsOnForm(editConfiguration, vreq); + + editConfiguration.setFilesOnForm(new ArrayList()); + + //Sparql queries + this.setSparqlQueries(editConfiguration, vreq); + + //set fields + setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); + + + setTemplate(editConfiguration, vreq); + + editConfiguration.addValidator(new AntiXssValidation()); + + //Add preprocessors + addPreprocessors(editConfiguration, vreq.getWebappDaoFactory()); + //Adding additional data, specifically edit mode + addFormSpecificData(editConfiguration, vreq); + //One override for basic functionality, changing url pattern + //and entity + //Adding term should return to this same page, not the subject + //Return takes the page back to the individual form + editConfiguration.setUrlPatternToReturnTo(getUrlPatternToReturnTo(vreq)); + prepare(vreq, editConfiguration); + return editConfiguration; + } + + + + private String getUrlPatternToReturnTo(VitroRequest vreq) { + String subjectUri = EditConfigurationUtils.getSubjectUri(vreq); + String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); + String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAssociatedConceptGenerator"; + String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq); + return editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) + + "&predicateUri=" + UrlBuilder.urlEncode(predicateUri) + + "&editForm=" + UrlBuilder.urlEncode(generatorName); + } + + + + private void setVarNames(EditConfigurationVTwo editConfiguration) { + editConfiguration.setVarNameForSubject("subject"); + editConfiguration.setVarNameForPredicate("predicate"); + editConfiguration.setVarNameForObject("conceptNode"); + } + + protected void setTemplate(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.setTemplate(template); + + } + + + + /* + * N3 Required and Optional Generators as well as supporting methods + */ + + private String getPrefixesString() { + //TODO: Include dynamic way of including this + return "@prefix core: ."; + } + + + //Here, the node is typed as a skos concept + private List generateN3Required(VitroRequest vreq) { + List n3Required = list( + getPrefixesString() + "\n" + + "?subject ?predicate ?conceptNode .\n" + ); + List inversePredicate = getInversePredicate(vreq); + //Adding inverse predicate if it exists + if(inversePredicate.size() > 0) { + n3Required.add("?conceptNode <" + inversePredicate.get(0) + "> ?subject ."); + } + return n3Required; + } + + //Optional b/c user may select an existing SKOS concept + private List generateN3Optional() { + return list( + "?conceptNode <" + VitroVocabulary.RDF_TYPE + "> <" + SKOSConceptType + "> .\n" + + "?conceptNode <" + label + "> ?conceptLabel ." + ); + + } + + + + + /* + * Get new resources + */ + private Map generateNewResources(VitroRequest vreq) { + HashMap newResources = new HashMap(); + newResources.put("conceptNode", null); + //There are no new resources here, the concept node uri doesn't + //get created but already exists, and vocab uri should already exist as well + return newResources; + } + + + + + /* + * Set URIS and Literals In Scope and on form and supporting methods + */ + + private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap> urisInScope = new HashMap>(); + //note that at this point the subject, predicate, and object var parameters have already been processed + //these two were always set when instantiating an edit configuration object from json, + //although the json itself did not specify subject/predicate as part of uris in scope + urisInScope.put(editConfiguration.getVarNameForSubject(), + Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); + urisInScope.put(editConfiguration.getVarNameForPredicate(), + Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); + //Setting inverse role predicate + urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); + + + editConfiguration.setUrisInScope(urisInScope); + //Uris in scope include subject, predicate, and object var + //literals in scope empty initially, usually populated by code in prepare for update + //with existing values for variables + editConfiguration.setLiteralsInScope(new HashMap>()); + } + + private List getInversePredicate(VitroRequest vreq) { + List inversePredicateArray = new ArrayList(); + ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); + if(op != null && op.getURIInverse() != null) { + inversePredicateArray.add(op.getURIInverse()); + } + return inversePredicateArray; + } + + //n3 should look as follows + //?subject ?predicate ?objectVar + + private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + List urisOnForm = new ArrayList(); + List literalsOnForm = new ArrayList(); + //The URI of the node that defines the concept + urisOnForm.add("conceptNode"); + editConfiguration.setUrisOnform(urisOnForm); + //In case the user defines a new concept, will add a concept label + literalsOnForm.add("conceptLabel"); + editConfiguration.setLiteralsOnForm(literalsOnForm); + } + + + /** + * Set SPARQL Queries and supporting methods + */ + + + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + //Sparql queries defining retrieval of literals etc. + editConfiguration.setSparqlForAdditionalLiteralsInScope(new HashMap()); + Map urisInScope = new HashMap(); + editConfiguration.setSparqlForAdditionalUrisInScope(new HashMap()); + editConfiguration.setSparqlForExistingLiterals(new HashMap()); + editConfiguration.setSparqlForExistingUris(new HashMap()); + } + + /** + * + * Set Fields and supporting methods + */ + + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { + setConceptNodeField(editConfiguration, vreq); + setConceptLabelField(editConfiguration, vreq); + } + + //this field will be hidden and include the concept node URI + private void setConceptNodeField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptNode")); + } + + + private void setConceptLabelField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq) { + editConfiguration.addField(new FieldVTwo(). + setName("conceptLabel"). + setValidators(list("datatype:" + XSD.xstring.toString())). + setRangeDatatypeUri(XSD.xstring.toString()) + ); + } + + + + + + + + + //Add preprocessor + + private void addPreprocessors(EditConfigurationVTwo editConfiguration, WebappDaoFactory wadf) { + //Will be a completely different type of preprocessor + /* + editConfiguration.addEditSubmissionPreprocessor( + new RoleToActivityPredicatePreprocessor(editConfiguration, wadf)); + */ + } + + + //Form specific data + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq)); + formSpecificData.put("conceptType", SKOSConceptType); + editConfiguration.setFormSpecificData(formSpecificData); + } + + + public String getSparqlForAcFilter(VitroRequest vreq) { + String subject = EditConfigurationUtils.getSubjectUri(vreq); + String predicate = EditConfigurationUtils.getPredicateUri(vreq); + String query = "PREFIX core:<" + vivoCore + "> " + + "SELECT ?conceptNode WHERE { " + + "<" + subject + "> <" + predicate + "> ?conceptNode ." + + "?conceptNode <" + VitroVocabulary.RDF_TYPE + "> <" + SKOSConceptType + "> . }"; + return query; + } + + //skos concepts can be added for either research areas or subject areas + //IF coming in from a different form then can get the predicate here as it will be stored + public String getCurrentPredicate(VitroRequest vreq) { + return vreq.getParameter("conceptPredicate"); + } + + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AutocompleteDataPropertyFormGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AutocompleteDataPropertyFormGenerator.java index d73a7d0e..065af470 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AutocompleteDataPropertyFormGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AutocompleteDataPropertyFormGenerator.java @@ -1,67 +1,67 @@ - -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; - -import java.util.HashMap; - -import javax.servlet.http.HttpSession; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; - -/** - * Generates the edit configuration for a default property form. - * - */ -public class AutocompleteDataPropertyFormGenerator extends DefaultDataPropertyFormGenerator { - - //The only thing that changes here are the templates - private Log log = LogFactory.getLog(AutocompleteObjectPropertyFormGenerator.class); - private String dataPropertyTemplate = "autoCompleteDataPropForm.ftl"; - - - @Override - public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - EditConfigurationVTwo ec = super.getEditConfiguration(vreq, session); - this.addFormSpecificData(ec, vreq); - return ec; - } - - public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap formSpecificData = new HashMap(); - //Filter setting - i.e. sparql query for filtering out results from autocomplete - formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq)); - editConfiguration.setTemplate(dataPropertyTemplate); - //Add edit model - formSpecificData.put("editMode", getEditMode(vreq)); - editConfiguration.setFormSpecificData(formSpecificData); - } - - public String getSparqlForAcFilter(VitroRequest vreq) { - String subject = EditConfigurationUtils.getSubjectUri(vreq); - String predicate = EditConfigurationUtils.getPredicateUri(vreq); - //Get all objects for existing predicate, filters out results from addition and edit - String query = "SELECT ?dataLiteral WHERE { " + - "<" + subject + "> <" + predicate + "> ?dataLiteral .} "; - return query; - } - - //Get edit mode - public String getEditMode(VitroRequest vreq) { - if(isUpdate(vreq)) - return "edit"; - else - return "add"; - } - - private boolean isUpdate(VitroRequest vreq) { - Integer dataHash = EditConfigurationUtils.getDataHash(vreq); - return ( dataHash != null ); - } - -} + +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import java.util.HashMap; + +import javax.servlet.http.HttpSession; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; + +/** + * Generates the edit configuration for a default property form. + * + */ +public class AutocompleteDataPropertyFormGenerator extends DefaultDataPropertyFormGenerator { + + //The only thing that changes here are the templates + private Log log = LogFactory.getLog(AutocompleteObjectPropertyFormGenerator.class); + private String dataPropertyTemplate = "autoCompleteDataPropForm.ftl"; + + + @Override + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { + EditConfigurationVTwo ec = super.getEditConfiguration(vreq, session); + this.addFormSpecificData(ec, vreq); + return ec; + } + + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + //Filter setting - i.e. sparql query for filtering out results from autocomplete + formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq)); + editConfiguration.setTemplate(dataPropertyTemplate); + //Add edit model + formSpecificData.put("editMode", getEditMode(vreq)); + editConfiguration.setFormSpecificData(formSpecificData); + } + + public String getSparqlForAcFilter(VitroRequest vreq) { + String subject = EditConfigurationUtils.getSubjectUri(vreq); + String predicate = EditConfigurationUtils.getPredicateUri(vreq); + //Get all objects for existing predicate, filters out results from addition and edit + String query = "SELECT ?dataLiteral WHERE { " + + "<" + subject + "> <" + predicate + "> ?dataLiteral .} "; + return query; + } + + //Get edit mode + public String getEditMode(VitroRequest vreq) { + if(isUpdate(vreq)) + return "edit"; + else + return "add"; + } + + private boolean isUpdate(VitroRequest vreq) { + Integer dataHash = EditConfigurationUtils.getDataHash(vreq); + return ( dataHash != null ); + } + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java index f83bd860..5dadb7f8 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java @@ -16,42 +16,42 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class GrantAdministeredByGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { - + public GrantAdministeredByGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("grantAdministeredBy.ftl"); - + conf.setVarNameForSubject("grant"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("adminRole"); - + conf.setN3Required( Arrays.asList( n3ForNewAdminRole) ); - conf.setN3Optional( Arrays.asList( n3ForNewAdminOrganization, + conf.setN3Optional( Arrays.asList( n3ForNewAdminOrganization, n3ForExistingAdminOrganization ) ); - + conf.addNewResource("newOrganization", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("adminRole", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setUrisOnform(Arrays.asList("existingOrganization")); conf.setLiteralsOnForm(Arrays.asList("orgLabel", "orgLabelDisplay" )); - - conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery); + + conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery); conf.addSparqlForExistingUris("existingOrganization", existingOrganizationQuery); - + conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS setName("existingOrganization") - ); + ); conf.addField( new FieldVTwo(). setName("orgLabel"). @@ -67,7 +67,7 @@ public class GrantAdministeredByGenerator extends VivoBaseGenerator implements conf.addValidator(new AntiXssValidation()); conf.addValidator(new AutocompleteRequiredInputValidator("existingOrganization", "orgLabel")); - + // addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; @@ -75,29 +75,29 @@ public class GrantAdministeredByGenerator extends VivoBaseGenerator implements /* N3 assertions */ - final static String n3ForNewAdminRole = - "@prefix vivo: <" + vivoCore + "> . \n" + + final static String n3ForNewAdminRole = + "@prefix vivo: <" + vivoCore + "> . \n" + "?grant vivo:relates ?adminRole . \n" + - "?adminRole a vivo:AdministratorRole . \n" + - "?adminRole vivo:relatedBy ?grant . " ; - - final static String n3ForNewAdminOrganization = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + "?adminRole a vivo:AdministratorRole . \n" + + "?adminRole vivo:relatedBy ?grant . " ; + + final static String n3ForNewAdminOrganization = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?adminRole ?newOrganization . \n" + "?newOrganization a . \n" + "?newOrganization ?adminRole . \n" + "?newOrganization vivo:relatedBy ?grant . \n" + "?grant vivo:relates ?newOrganization . \n" + "?newOrganization <"+ label + "> ?orgLabel ."; - - final static String n3ForExistingAdminOrganization = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + + final static String n3ForExistingAdminOrganization = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?adminRole ?existingOrganization . \n" + "?existingOrganization a . \n" + "?existingOrganization ?adminRole . " + "?existingOrganization vivo:relatedBy ?grant . \n" + "?grant vivo:relates ?existingOrganization . \n" ; - + /* Queries for editing an existing entry */ final static String existingOrganizationQuery = diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java index e1ac2f79..fc6ed234 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java @@ -20,35 +20,35 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; -public class GrantHasContributorGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ +public class GrantHasContributorGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ // NOTE: This generator is for contract as well as grants. //TODO: can we get rid of the session and get it form the vreq? public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("grantHasContributor.ftl"); - + conf.setVarNameForSubject("subject"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("theRole"); - + conf.setN3Required( Arrays.asList( n3ForNewProjectRole, roleTypeAssertion ) ); conf.setN3Optional(Arrays.asList( n3ForNewPerson, n3ForExistingPerson, firstNameAssertion, lastNameAssertion ) ); - + conf.addNewResource("theRole", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newPerson",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardPerson", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform( Arrays.asList( "existingPerson", "roleType")); conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "firstName", "lastName")); @@ -56,12 +56,12 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); conf.addSparqlForExistingUris("roleType", roleTypeQuery); - + conf.addField( new FieldVTwo(). setName("existingPerson") - //options will be added in browser by auto complete JS - ); - + //options will be added in browser by auto complete JS + ); + conf.addField( new FieldVTwo(). setName("personLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -82,27 +82,27 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements setRangeDatatypeUri(XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()) ) ); - + conf.addField( new FieldVTwo(). setName("roleType"). setValidators( list("nonempty") ). - setOptions( + setOptions( new ChildVClassesWithParent("http://vivoweb.org/ontology/core#ResearcherRole"))); - + //Add validator conf.addValidator(new AntiXssValidation()); conf.addValidator(new FirstAndLastNameValidator("existingPerson")); - + //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; } - + /* N3 assertions for working with educational training */ - - final static String n3ForNewProjectRole = + + final static String n3ForNewProjectRole = "@prefix core: <"+ vivoCore +"> .\n" + "@prefix rdfs: <"+ rdfs +"> . \n"+ "?subject core:relates ?theRole .\n" + @@ -111,7 +111,7 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements final static String roleTypeAssertion = "?theRole a ?roleType ."; - final static String n3ForNewPerson = + final static String n3ForNewPerson = "@prefix core: <"+ vivoCore +"> .\n" + "?theRole ?newPerson . \n" + "?newPerson ?theRole . \n" + @@ -120,40 +120,40 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements "?newPerson a . \n" + "?newPerson <"+ label +"> ?personLabel . "; - final static String n3ForExistingPerson = + final static String n3ForExistingPerson = "@prefix core: <"+ vivoCore +"> .\n" + "?theRole ?existingPerson . \n" + "?existingPerson ?theRole . \n" + "?subject core:relates ?newPerson . \n" + "?newPerson core:relatedBy ?subject . \n" + " "; - - final static String firstNameAssertion = + + final static String firstNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; - - final static String lastNameAssertion = + + final static String lastNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; /* Queries for editing an existing educational training entry */ - final static String roleTypeQuery = + final static String roleTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?roleType WHERE { \n" + + "SELECT ?roleType WHERE { \n" + " ?theRole vitro:mostSpecificType ?roleType . }"; - final static String existingPersonQuery = + final static String existingPersonQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPerson WHERE {\n"+ "?theRole ?existingPerson . \n" + @@ -161,7 +161,7 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements "?existingPerson a . \n " + " }"; - final static String personLabelQuery = + final static String personLabelQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPersonLabel WHERE {\n"+ "?theRole ?existingPerson . \n" + @@ -170,14 +170,14 @@ public class GrantHasContributorGenerator extends VivoBaseGenerator implements "?existingPerson a . \n " + " }"; - + //Adding form specific data such as edit mode public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); editConfiguration.setFormSpecificData(formSpecificData); } - + public EditMode getEditMode(VitroRequest vreq) { List predicates = new ArrayList(); predicates.add("http://purl.obolibrary.org/obo/RO_0000053"); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForPersonGenerator.java index 71b23856..7610387c 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForPersonGenerator.java @@ -46,7 +46,7 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DataProper /** * This generator is specifically for handling labels for a FOAF Person individual and is an object property form. *This allows the page to show all the labels for a particular individual and sets up code - *enabling the addition of a new label. Links on the page will allow for removal or editing of a given label. + *enabling the addition of a new label. Links on the page will allow for removal or editing of a given label. */ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { public static Log log = LogFactory.getLog(ManageLabelsForIndividualGenerator.class); @@ -68,13 +68,13 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat //be employed when the 'add' button is used, we will set this is an object property form //although label will mean we need to add a data property statement as well //URL to return to is the same page once addition is complete - initObjectPropForm(config, vreq); + initObjectPropForm(config, vreq); + - this.setUrlToReturnTo(config, vreq); config.setSubjectUri(EditConfigurationUtils.getSubjectUri(vreq)); - + setVarNames(config); //config.setDatapropKey( EditConfigurationUtils.getDataHash(vreq) ); //Add n3, fields, etc. in the case where the user wants to add a label @@ -86,10 +86,10 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat this.setUrisAndLiteralsInScope(config); this.setFields(config, vreq, EditConfigurationUtils .getPredicateUri(vreq)); - + //Get existing labels //this.initExistingLabels(config, vreq); - + //Add form specific data used to populate template addFormSpecificData(config, vreq); //This preprocessor handles getting the correct label language and putting the attribute on the label @@ -97,24 +97,24 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat new ManageLabelsForPersonPreprocessor(config)); //This will handle generating the label from the first name, middle, and last names and also make sure to associate //a language with that label - config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor()); + config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor()); prepare(vreq, config); return config; } - + /**With ISF Changes**/ //For addition of a label, with ISF changes, the name is now linked to a vcard which in turn is linked to a "fullname" that then has first/middle/last names - + private void addNewResources(EditConfigurationVTwo config) { config.addNewResource("fullName", DEFAULT_NS_FOR_NEW_RESOURCE); config.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); } - + private void setUrlToReturnTo(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); + editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); } - + private void setVarNames(EditConfigurationVTwo editConfiguration) { editConfiguration.setVarNameForSubject("subject"); editConfiguration.setVarNameForPredicate("predicate"); @@ -129,29 +129,29 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat private List generateN3Optional(VitroRequest vreq) { List n3Optional = new ArrayList(); - - String personFullNameN3 = this.N3_PREFIX + + + String personFullNameN3 = this.N3_PREFIX + "?subject ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?subject . \n" + "?individualVcard ?fullName . \n" + "?fullName a ."; - String personFirstNameN3 = + String personFirstNameN3 = "?fullName ?firstName . "; - String personLastNameN3 = + String personLastNameN3 = "?fullName ?lastName ."; String personMiddleNameN3 = "?subject ?middleName ."; n3Optional.add(personFullNameN3 + "\n " + personFirstNameN3 + "\n " + personLastNameN3); n3Optional.add(personMiddleNameN3); return n3Optional; } - - - + + + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { Map fields = new HashMap(); editConfiguration.setFields(fields); - + editConfiguration.addField(new FieldVTwo( ).setName("newLabelLanguage")); //no validators since all of this is optional @@ -161,41 +161,41 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat setValidators(getFirstNameValidators(vreq, editConfiguration))); editConfiguration.addField(new FieldVTwo(). setName("middleName"). - setValidators(getMiddleNameValidators(vreq, editConfiguration))); - + setValidators(getMiddleNameValidators(vreq, editConfiguration))); + editConfiguration.addField(new FieldVTwo(). setName("lastName"). - setValidators(getLastNameValidators(vreq, editConfiguration))); - + setValidators(getLastNameValidators(vreq, editConfiguration))); + //With ISF Changes, also include middle name - + } - + //first and last name have validators if is person is true private List getFirstNameValidators(VitroRequest vreq, EditConfigurationVTwo config) { List validators = new ArrayList(); validators.add("nonempty"); - + return validators; } - + private List getMiddleNameValidators(VitroRequest vreq, EditConfigurationVTwo config) { List validators = new ArrayList(); - + return validators; } private List getLastNameValidators(VitroRequest vreq, EditConfigurationVTwo config) { List validators = new ArrayList(); validators.add("nonempty"); - + return validators; } - - - + + + private void setUrisAndLiteralsOnForm(EditConfigurationVTwo config, VitroRequest vreq) { List literalsOnForm = new ArrayList(); @@ -205,29 +205,29 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat literalsOnForm.add("lastName"); literalsOnForm.add("middleName"); config.setLiteralsOnForm(literalsOnForm); - + } private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration) { HashMap> urisInScope = new HashMap>(); //note that at this point the subject, predicate, and object var parameters have already been processed - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); editConfiguration.setUrisInScope(urisInScope); //Uris in scope include subject, predicate, and object var - + editConfiguration.setLiteralsInScope(new HashMap>()); } - + private void initExistingLabels(EditConfigurationVTwo config, VitroRequest vreq) { this.existingLabelLiterals = this.getExistingLabels(config.getSubjectUri(), vreq); - + } - + private List getExistingSortedLanguageNamesList() { HashSet existingLanguages = new HashSet(); @@ -258,7 +258,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat //Get available locales for the drop down for adding a new label, also sorted by language name HashSet existingLanguageNames = new HashSet(existingLabelsByLanguageName.keySet()); List> availableLocalesForAdd = getAvailableLocales(locales, existingLanguageNames); - + //Save all locales config.addFormSpecificData("selectLocaleFullList", locales); @@ -266,27 +266,27 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat config.addFormSpecificData("labelsSortedByLanguageName", existingLabelsByLanguageName); config.addFormSpecificData("selectLocale",availableLocalesForAdd); config.addFormSpecificData("displayRemoveLink", (numberExistingLabels > 1)); - - - //How do we edit? Will need to see - config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete"); - + + //How do we edit? Will need to see + config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete"); + + Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(config.getSubjectUri()); if( subject != null && subject.getName() != null ){ config.addFormSpecificData("subjectName", subject.getName()); }else{ config.addFormSpecificData("subjectName", null); } - + config.addFormSpecificData("isPersonType", "true"); //Include whether or not editable to enable edit/remove links and add to show up config.addFormSpecificData("editable", isEditable(vreq, config)); } - - //Based on what locales have already been selected for labels, return a list of + + //Based on what locales have already been selected for labels, return a list of //locales for which new labels can be added and have these sorted by the name of the language private List> getAvailableLocales(List> allLocales, HashSet existingLabelsLanguageNames) { @@ -309,7 +309,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat return languageName1.compareTo(languageName2); } }); - + return availableLocales; } @@ -319,7 +319,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat AddDataPropertyStatement adps = new AddDataPropertyStatement( vreq.getJenaOntModel(), individual.getURI(), SOME_URI, SOME_LITERAL); - + AddObjectPropertyStatement aops = new AddObjectPropertyStatement( vreq.getJenaOntModel(), individual.getURI(), SOME_PREDICATE, SOME_URI); @@ -331,7 +331,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat public String getFOAFPersonClassURI() { return "http://xmlns.com/foaf/0.1/Person"; } - + public boolean isPersonType(VitroRequest vreq, EditConfigurationVTwo config) { WebappDaoFactory wdf = vreq.getWebappDaoFactory(); Boolean isPersonType = Boolean.FALSE; @@ -344,11 +344,11 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat isPersonType = Boolean.TRUE; break; } - } + } } return isPersonType; } - + //how to get the type of the individual in question public List getVClasses(EditConfigurationVTwo config, VitroRequest vreq) { Individual subject = EditConfigurationUtils.getIndividual(vreq, config.getSubjectUri()); @@ -365,7 +365,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat prop.setURI(propertyUri); //Iterate through the labels and create a hashmap HashMap> labelsHash= new HashMap>(); - + for(Literal l: labels) { String languageTag = l.getLanguage(); String languageName = ""; @@ -377,7 +377,7 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat } else { log.warn("This language tag " + languageTag + " does not have corresponding name in the system and was not processed"); } - + if(!StringUtils.isEmpty(languageName)) { if(!labelsHash.containsKey(languageName)) { labelsHash.put(languageName, new ArrayList()); @@ -386,14 +386,14 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat //This should put the label in the list //Create label information instance with the required information //To generate link - + DataPropertyStatementTemplateModel dpstm = new DataPropertyStatementTemplateModel(subjectUri, prop, l, template, vreq); labelsList.add(new LabelInformation( l, dpstm.getEditUrl(), dpstm.getDeleteUrl(), languageTag, languageName)); } } - + //Sort each label list LabelInformationComparator lic = new LabelInformationComparator(); for(String languageName: labelsHash.keySet()) { @@ -401,12 +401,12 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat labelInfo.sort(lic); } return labelsHash; - + } - - + + public static class LabelInformationComparator implements Comparator { - + public int compare(LabelInformation l1, LabelInformation l2) { return l1.getLabelStringValue().compareTo(l2.getLabelStringValue()); } @@ -418,8 +418,8 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat + "SELECT DISTINCT ?label WHERE { \n" + " ?subject rdfs:label ?label \n" + "} ORDER BY ?label"; - - + + private ArrayList getExistingLabels(String subjectUri, VitroRequest vreq) { String queryStr = QueryUtils.subUriForQueryVar(LABEL_QUERY, "subject", subjectUri); log.debug("queryStr = " + queryStr); @@ -431,31 +431,31 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat while (results.hasNext()) { QuerySolution soln = results.nextSolution(); Literal nodeLiteral = soln.get("label").asLiteral(); - labels.add(nodeLiteral); + labels.add(nodeLiteral); } } catch (Exception e) { log.error(e, e); - } + } return labels; } - - + + //Putting this into a method allows overriding it in subclasses protected String getEditForm() { return null; //return AddEditWebpageFormGenerator.class.getName(); } - - + + protected String getTemplate() { return template; } - - - + + + //get locales public List> getLocales(VitroRequest vreq) { List selectables = SelectedLocale.getSelectableLocales(vreq); @@ -472,27 +472,27 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat + "': " + e); } } - + return list; } - - - + + + public HashMap getFullCodeToLanguageNameMap(List> localesList) { HashMap codeToLanguageMap = new HashMap(); for(Map locale: localesList) { String code = (String) locale.get("code"); String label = (String) locale.get("label"); if(!codeToLanguageMap.containsKey(code)) { - codeToLanguageMap.put(code, label); - } + codeToLanguageMap.put(code, label); + } else { - log.warn("Language code " + code + " for " + label + " was not associated in map becayse label already exists"); + log.warn("Language code " + code + " for " + label + " was not associated in map becayse label already exists"); } } return codeToLanguageMap; } - + public List getFullLanguagesNamesSortedList(List> localesList) { HashSet languageNamesSet = new HashSet(); for(Map locale: localesList) { @@ -500,13 +500,13 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat if(!languageNamesSet.contains(label)) { languageNamesSet.add(label); } - + } List languageNames = new ArrayList(languageNamesSet); Collections.sort(languageNames); return languageNames; } - + //copied from locale selection data getter but don't need all this information private HashMap buildLocaleMap(Locale locale, Locale currentLocale) throws FileNotFoundException { @@ -516,14 +516,14 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat map.put("label", locale.getDisplayName(currentLocale)); return map; } - + //Class used to store the information needed for the template, such as the labels, their languages, their edit links public class LabelInformation { private Literal labelLiteral = null; private String editLinkURL; private String deleteLinkURL; private String languageCode; //languageCode - private String languageName; + private String languageName; public LabelInformation(Literal inputLiteral, String inputEditLinkURL, String inputDeleteLinkURL, String inputLanguageCode, String inputLanguageName) { this.labelLiteral = inputLiteral; this.editLinkURL = inputEditLinkURL; @@ -531,32 +531,32 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat this.languageCode = inputLanguageCode; this.languageName = inputLanguageName; } - - + + public Literal getLabelLiteral() { return this.labelLiteral; } - + public String getLabelStringValue() { return this.labelLiteral.getString(); } - + public String getEditLinkURL() { return this.editLinkURL; } - + public String getDeleteLinkURL() { return this.deleteLinkURL; } public String getLanguageCode() { return this.languageCode; } - + public String getLanguageName() { return this.languageName; } } - + private String N3_PREFIX = "@prefix foaf: .\n"; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java index 2e2a2961..1c43cfa1 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageWebpagesForIndividualGenerator.java @@ -31,13 +31,13 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTw * This is an odd controller that is just drawing a page with links on it. * It is not an example of the normal use of the RDF editing system and * was just migrated over from an odd use of the JSP RDF editing system - * during the 1.4 release. - * + * during the 1.4 release. + * * This mainly sets up pageData for the template to use. */ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { public static Log log = LogFactory.getLog(ManageWebpagesForIndividualGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { @@ -55,8 +55,8 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG config.addFormSpecificData("webpages",webpages); config.addFormSpecificData("rankPredicate", "http://vivoweb.org/ontology/core#rank" ); - config.addFormSpecificData("reorderUrl", "/edit/reorder" ); - config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete"); + config.addFormSpecificData("reorderUrl", "/edit/reorder" ); + config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete"); ParamMap paramMap = new ParamMap(); paramMap.put("subjectUri", config.getSubjectUri()); @@ -64,7 +64,7 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG paramMap.put("view", "form"); String path = UrlBuilder.getUrl( UrlBuilder.Route.EDIT_REQUEST_DISPATCH ,paramMap); - config.addFormSpecificData("baseEditWebpageUrl", path); + config.addFormSpecificData("baseEditWebpageUrl", path); //Also add domainUri and rangeUri if they exist, adding here instead of template String domainUri = (String) vreq.getParameter("domainUri"); @@ -82,7 +82,7 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG } path = UrlBuilder.getUrl( UrlBuilder.Route.EDIT_REQUEST_DISPATCH ,paramMap); - config.addFormSpecificData("showAddFormUrl", path); + config.addFormSpecificData("showAddFormUrl", path); Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(config.getSubjectUri()); if( subject != null && subject.getName() != null ){ @@ -162,10 +162,10 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG + " OPTIONAL { ?link core:rank ?rank } \n" + " OPTIONAL { ?link vitro:mostSpecificType ?type } \n" + " OPTIONAL { ?type rdfs:label ?typeLabel } \n" - + "} GROUP BY ?rank ?vcard ?link ?url ?typeLabel \n" + + "} GROUP BY ?rank ?vcard ?link ?url ?typeLabel \n" + " ORDER BY ?rank"; - - + + private List> getWebpages(String subjectUri, VitroRequest vreq) { RDFService rdfService = vreq.getRDFService(); @@ -195,20 +195,20 @@ public class ManageWebpagesForIndividualGenerator extends BaseEditConfigurationG } } catch (Exception e) { log.error(e, e); - } + } log.debug("webpages = " + webpages); return webpages; } - + //Putting this into a method allows overriding it in subclasses protected String getEditForm() { return AddEditWebpageFormGenerator.class.getName(); } - + protected String getQuery() { return WEBPAGE_QUERY; } - + protected String getTemplate() { return "manageWebpagesForIndividual.ftl"; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationAdministersGrantGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationAdministersGrantGenerator.java index 57fdfc1c..f7187b0d 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationAdministersGrantGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationAdministersGrantGenerator.java @@ -16,42 +16,42 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class OrganizationAdministersGrantGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { - + public OrganizationAdministersGrantGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("organizationAdministersGrant.ftl"); - + conf.setVarNameForSubject("organization"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("adminRole"); - + conf.setN3Required( Arrays.asList( n3ForNewAdminRole) ); - conf.setN3Optional( Arrays.asList( n3ForNewAdminGrant, + conf.setN3Optional( Arrays.asList( n3ForNewAdminGrant, n3ForExistingAdminGrant ) ); - + conf.addNewResource("newGrant", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("adminRole", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setUrisOnform(Arrays.asList("existingGrant")); conf.setLiteralsOnForm(Arrays.asList("grantLabel", "grantLabelDisplay" )); - - conf.addSparqlForExistingLiteral("grantLabel", grantLabelQuery); + + conf.addSparqlForExistingLiteral("grantLabel", grantLabelQuery); conf.addSparqlForExistingUris("existingGrant", existingGrantQuery); - + conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS setName("existingGrant") - ); + ); conf.addField( new FieldVTwo(). setName("grantLabel"). @@ -67,7 +67,7 @@ public class OrganizationAdministersGrantGenerator extends VivoBaseGenerator imp conf.addValidator(new AntiXssValidation()); conf.addValidator(new AutocompleteRequiredInputValidator("existingGrant", "grantLabel")); - + // addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; @@ -75,29 +75,29 @@ public class OrganizationAdministersGrantGenerator extends VivoBaseGenerator imp /* N3 assertions */ - final static String n3ForNewAdminRole = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + final static String n3ForNewAdminRole = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?organization ?adminRole . \n" + - "?adminRole a vivo:AdministratorRole . \n" + - "?adminRole ?organization . " ; - - final static String n3ForNewAdminGrant = - "@prefix vivo: <" + vivoCore + "> . \n" + + "?adminRole a vivo:AdministratorRole . \n" + + "?adminRole ?organization . " ; + + final static String n3ForNewAdminGrant = + "@prefix vivo: <" + vivoCore + "> . \n" + "?adminRole vivo:relatedBy ?newGrant . \n" + "?newGrant a vivo:Grant . \n" + "?newGrant vivo:relates ?adminRole . \n" + "?organization vivo:relatedBy ?newGrant . \n" + "?newGrant vivo:relates ?organization . \n" + "?newGrant <"+ label + "> ?grantLabel ."; - - final static String n3ForExistingAdminGrant = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + + final static String n3ForExistingAdminGrant = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?adminRole vivo:relatedBy ?existingGrant . \n" + "?existingGrant a . \n" + "?existingGrant vivo:relates ?adminRole . \n" + "?organization vivo:relatedBy ?newGrant . \n" + "?newGrant vivo:relates ?organization . " ; - + /* Queries for editing an existing entry */ final static String existingGrantQuery = diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java index 8b30e432..07a6eca9 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java @@ -23,28 +23,28 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; -public class OrganizationForTrainingGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ +public class OrganizationForTrainingGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ //TODO: can we get rid of the session and get it form the vreq? public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("organizationForTraining.ftl"); - + conf.setVarNameForSubject("organization"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("edTraining"); - + conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewPerson, n3ForExistingPerson, - n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, + n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, n3ForEnd, firstNameAssertion, lastNameAssertion )); - + conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("awardedDegree",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newPerson",DEFAULT_NS_FOR_NEW_RESOURCE); @@ -53,10 +53,10 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.addNewResource("endNode",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardPerson", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform( Arrays.asList( "existingPerson", "degreeType", "trainingType")); conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "awardedDegreeLabel", "majorField", "dept", "info", "firstName", "lastName")); @@ -68,7 +68,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("awardedDegree", existingAwardedDegreeQuery); conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); conf.addSparqlForExistingUris("trainingType", trainingTypeQuery); @@ -80,8 +80,8 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); //Add sparql to include inverse property as well conf.addSparqlForAdditionalUrisInScope("inverseTrainingAtPerson", inverseTrainingAtPersonQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("degreeType"). setOptions( new IndividualsViaVClassOptions( degreeTypeClass))); @@ -90,16 +90,16 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme setName("majorField"). setRangeDatatypeUri( XSD.xstring.toString() ). setValidators(list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("existingPerson") - //options will be added in browser by auto complete JS - ); - + //options will be added in browser by auto complete JS + ); + conf.addField( new FieldVTwo(). setName("awardedDegree") - //options will be added in browser by auto complete JS - ); + //options will be added in browser by auto complete JS + ); conf.addField( new FieldVTwo(). setName("personLabel"). @@ -115,11 +115,11 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme setName("existingAwardedDegreeLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("personLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() )); - + conf.addField( new FieldVTwo(). setName("firstName"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -135,14 +135,14 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.addField( new FieldVTwo(). setName("trainingType"). setValidators( list("nonempty") ). - setOptions( + setOptions( new ChildVClassesWithParent(edProcessClass))); conf.addField( new FieldVTwo(). setName("dept"). setRangeDatatypeUri( XSD.xstring.toString() ). setValidators(list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("info"). setRangeDatatypeUri( XSD.xstring.toString() ). @@ -150,33 +150,33 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme FieldVTwo startField = new FieldVTwo(). setName("startField"); - conf.addField(startField. + conf.addField(startField. setEditElement( - new DateTimeWithPrecisionVTwo(startField, + new DateTimeWithPrecisionVTwo(startField, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()))); - + FieldVTwo endField = new FieldVTwo(). setName("endField"); - conf.addField( endField. + conf.addField( endField. setEditElement( - new DateTimeWithPrecisionVTwo(endField, + new DateTimeWithPrecisionVTwo(endField, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()))); //Add validator conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); conf.addValidator(new AntiXssValidation()); conf.addValidator(new FirstAndLastNameValidator("existingPerson")); - + //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; } - + /* N3 assertions for working with educational training */ - - final static String n3ForNewEdTraining = + + final static String n3ForNewEdTraining = "@prefix core: <"+ vivoCore +"> .\n"+ "?organization ?edTraining .\n" + "?edTraining a core:EducationalProcess .\n" + @@ -185,7 +185,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme final static String trainingTypeAssertion = "?edTraining a ?trainingType ."; - final static String n3ForAwardedDegree = + final static String n3ForAwardedDegree = "@prefix core: <"+ vivoCore +"> .\n"+ "?edTraining ?awardedDegree . \n" + "?awardedDegree ?edTraining . \n" + @@ -196,49 +196,49 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?degreeType ?awardedDegree . \n"+ "?awardedDegree a core:AwardedDegree ."; - final static String n3ForNewPerson = + final static String n3ForNewPerson = "?edTraining ?newPerson . \n" + "?newPerson ?edTraining . \n" + "?newPerson a . \n" + "?newPerson <"+ label +"> ?personLabel . "; - final static String n3ForExistingPerson = + final static String n3ForExistingPerson = "?edTraining ?existingPerson . \n" + "?existingPerson ?edTraining . \n" + " "; - - final static String n3ForNewPersonAwardedDegree = + + final static String n3ForNewPersonAwardedDegree = "?awardedDegree ?newPerson . \n" + "?newPerson ?awardedDegree . \n" + "?newPerson a . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?newPerson <"+ label +"> ?personLabel . "; - final static String firstNameAssertion = + final static String firstNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; - - final static String lastNameAssertion = + + final static String lastNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; - final static String n3ForExistingPersonAwardedDegree = + final static String n3ForExistingPersonAwardedDegree = "?awardedDegree ?existingPerson . \n" + "?existingPerson ?awardedDegree . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?existingPerson a . "; - final static String majorFieldAssertion = + final static String majorFieldAssertion = "?edTraining <"+ majorFieldPred +"> ?majorField ."; final static String n3ForStart = @@ -257,24 +257,24 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?endNode <"+ dateTimeValue +"> ?endField-value .\n"+ "?endNode <"+ dateTimePrecision +"> ?endField-precision ."; - final static String deptAssertion = + final static String deptAssertion = "?edTraining <"+ deptPred +"> ?dept ."; - final static String infoAssertion = + final static String infoAssertion = "?edTraining <"+ infoPred +"> ?info ."; /* Queries for editing an existing educational training entry */ - final static String existingAwardedDegreeQuery = + final static String existingAwardedDegreeQuery = "SELECT ?existingAwardedDegree WHERE {\n"+ "?edTraining ?existingAwardedDegree . }\n"; - final static String existingAwardedDegreeLabelQuery = + final static String existingAwardedDegreeLabelQuery = "SELECT ?existingAwardedDegreeLabel WHERE {\n"+ "?edTraining ?existingAwardedDegree . \n" + "?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel }\n"; - final static String existingPersonQuery = + final static String existingPersonQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPerson WHERE {\n"+ "?edTraining ?existingPerson . \n" + @@ -282,7 +282,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?existingPerson a . \n " + " }"; - final static String personLabelQuery = + final static String personLabelQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPersonLabel WHERE {\n"+ "?edTraining ?existingPerson . \n" + @@ -291,12 +291,12 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?existingPerson a . \n " + " }"; - final static String trainingTypeQuery = + final static String trainingTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingTrainingType WHERE { \n" + + "SELECT ?existingTrainingType WHERE { \n" + " ?edTraining vitro:mostSpecificType ?existingTrainingType . }"; - - final static String degreeTypeQuery = + + final static String degreeTypeQuery = "PREFIX core: <"+ vivoCore +"> \n"+ "SELECT ?existingDegreeType WHERE {\n"+ "?edTraining ?existingAwardedDegree . \n"+ @@ -304,31 +304,31 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?existingAwardedDegree core:relates ?existingDegreeType . \n" + "?existingDegreeType a core:AcademicDegree }"; - final static String majorFieldQuery = + final static String majorFieldQuery = "SELECT ?existingMajorField WHERE {\n"+ "?edTraining <"+ majorFieldPred +"> ?existingMajorField . }"; - final static String deptQuery = + final static String deptQuery = "SELECT ?existingDept WHERE {\n"+ "?edTraining <"+ deptPred +"> ?existingDept . }"; - final static String infoQuery = + final static String infoQuery = "SELECT ?existingInfo WHERE {\n"+ "?edTraining <"+ infoPred +"> ?existingInfo . }"; - final static String existingIntervalNodeQuery = + final static String existingIntervalNodeQuery = "SELECT ?existingIntervalNode WHERE {\n"+ "?edTraining <"+ toInterval +"> ?existingIntervalNode .\n"+ "?existingIntervalNode <"+ type +"> <"+ intervalType +"> . }"; - - final static String existingStartNodeQuery = + + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToStart +"> ?existingStartNode . \n"+ "?existingStartNode <"+ type +"> <"+ dateTimeValueType +"> .}"; - final static String existingStartDateQuery = + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -336,7 +336,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?startNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?startNode <"+ dateTimeValue +"> ?existingDateStart . }"; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -344,14 +344,14 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?startNode <"+ type +"> <"+ dateTimeValueType +"> . \n"+ "?startNode <"+ dateTimePrecision +"> ?existingStartPrecision . }"; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToEnd +"> ?existingEndNode . \n"+ "?existingEndNode <"+ type +"> <"+ dateTimeValueType +"> .}"; - final static String existingEndDateQuery = + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -359,28 +359,28 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?endNode <"+ dateTimeValue +"> ?existingEndDate . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToEnd +"> ?endNode .\n"+ "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?endNode <"+ dateTimePrecision +"> ?existingEndPrecision . }"; - + //Query for inverse property final static String inverseTrainingAtPersonQuery = "PREFIX owl: " + " SELECT ?inverseTrainingAtPerson " + " WHERE { ?inverseTrainingAtPerson owl:inverseOf . } "; - - + + //Adding form specific data such as edit mode public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); editConfiguration.setFormSpecificData(formSpecificData); } - + public EditMode getEditMode(VitroRequest vreq) { List predicates = new ArrayList(); predicates.add("http://vivoweb.org/ontology/core#relates"); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java index c048996e..2dc592b3 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java @@ -113,7 +113,7 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator + "@prefix core: . \n" + "@prefix rdfs: . \n" + "?organization core:relatedBy ?position . \n" - + "?position a core:Position . \n" + + "?position a core:Position . \n" + "?position a ?positionType . \n" + "?position rdfs:label ?positionTitle . \n" + "?position core:relates ?organization . "; @@ -122,7 +122,7 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator + "@prefix core: . \n" + "@prefix rdfs: . \n" + "@prefix foaf: . \n" - + "?position core:relates ?person . \n" + + "?position core:relates ?person . \n" + "?person core:relatedBy ?position . \n" + "?person a foaf:Person . \n" + "?person rdfs:label ?personLabel . "; @@ -147,7 +147,7 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator private static final String N3_EXISTING_PERSON = "" + "@prefix core: . \n" - + "?position core:relates ?existingPerson . \n" + + "?position core:relates ?existingPerson . \n" + "?existingPerson core:relatedBy ?position . \n"; private static final String N3_NEW_START_NODE = "" @@ -221,7 +221,7 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator conf.addField(new FieldVTwo() .setName("positionType") .setValidators(list("nonempty")) - .setOptions( + .setOptions( new ChildVClassesWithParent(URI_POSITION_CLASS)) ); @@ -260,7 +260,7 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator conf.addValidator(new AntiXssValidation()); conf.addValidator(new DateTimeIntervalValidationVTwo("startField", "endField")); - + prepare(vreq, conf); return conf; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdviseeRelationshipGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdviseeRelationshipGenerator.java index 8d842089..21fa93eb 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdviseeRelationshipGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdviseeRelationshipGenerator.java @@ -37,25 +37,25 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public PersonHasAdviseeRelationshipGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasAdviseeRelationship.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("adviseeRole"); - + conf.setN3Required( Arrays.asList( n3ForNewAdvisingRelationship, advisingRelLabelAssertion, advisingRelTypeAssertion ) ); @@ -66,9 +66,9 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp lastNameAssertion, n3ForExistingSubjAreaAssertion, //relationship to existing subject area n3ForNewSubjAreaAssertion, //this will include all the new information that needs to be captured - n3ForStart, + n3ForStart, n3ForEnd ) ); - + conf.addNewResource("advisingRelationship", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newAdvisor", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardAdvisor", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -79,19 +79,19 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform(Arrays.asList("advisingRelType", "existingSubjArea", "degree", "existingAdvisor")); conf.setLiteralsOnForm(Arrays.asList("advisingRelLabel", "subjAreaLabel", "advisorLabel", "firstName", "lastName", "subjAreaLabelDisplay", "advisorLabelDisplay" )); - + conf.addSparqlForExistingLiteral("advisingRelLabel", advisingRelLabelQuery); conf.addSparqlForExistingLiteral("advisorLabel", advisorLabelQuery); conf.addSparqlForExistingLiteral("subjAreaLabel", subjAreaLabelQuery); conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("advisingRelType", advisingRelTypeQuery); conf.addSparqlForExistingUris("advisingRelationship", existingAdvisingRelQuery); conf.addSparqlForExistingUris("advisorRole", existingAdvisorRoleQuery); @@ -103,8 +103,8 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp conf.addSparqlForExistingUris("endNode", existingEndNodeQuery); conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("advisingRelType"). setValidators( list("nonempty") ). setOptions( new ChildVClassesWithParent(advisingRelClass)) @@ -129,8 +129,8 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp ); conf.addField( new FieldVTwo(). // options set by auto complete JS - setName("existingSubjArea") - ); + setName("existingSubjArea") + ); conf.addField( new FieldVTwo(). setName("subjAreaLabel"). @@ -140,13 +140,13 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp conf.addField( new FieldVTwo(). setName("degree"). - setOptions( + setOptions( new IndividualsViaVClassOptions(degreeClass)) ); conf.addField( new FieldVTwo(). // options set by auto complete JS - setName("existingAdvisor") - ); + setName("existingAdvisor") + ); conf.addField( new FieldVTwo(). setName("advisorLabel"). @@ -167,16 +167,16 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp ); conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) @@ -186,98 +186,98 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp conf.addValidator(new AntiXssValidation()); conf.addValidator(new FirstAndLastNameValidator("existingAdvisor")); addFormSpecificData(conf, vreq); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewAdvisingRelationship = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + final static String n3ForNewAdvisingRelationship = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?person ?advisingRelationship . \n" + - "?advisingRelationship a <" + advisingRelClass + "> . \n" + + "?advisingRelationship a <" + advisingRelClass + "> . \n" + "?advisingRelationship ?person . \n" + "?advisingRelationship ?adviseeRole . \n" + - "?adviseeRole a <" + adviseeRoleClass + "> . \n" + + "?adviseeRole a <" + adviseeRoleClass + "> . \n" + "?adviseeRole ?advisingRelationship . \n" + "?person ?adviseeRole . \n" + "?adviseeRole ?person . "; - - final static String advisingRelLabelAssertion = + + final static String advisingRelLabelAssertion = "?advisingRelationship <"+ label + "> ?advisingRelLabel ."; - - final static String advisingRelTypeAssertion = + + final static String advisingRelTypeAssertion = "?advisingRelationship a ?advisingRelType ."; - final static String n3ForNewAdvisorAssertion = + final static String n3ForNewAdvisorAssertion = "?advisingRelationship ?newAdvisor . \n" + "?newAdvisor ?advisingRelationship . \n" + "?newAdvisor <" + label + "> ?advisorLabel . \n" + "?newAdvisor a <" + advisorClass + "> . \n" + "?newAdvisor ?advisorRole . \n" + "?advisorRole ?newAdvisor . \n" + - "?advisorRole a <" + advisorRoleClass + "> . \n" + + "?advisorRole a <" + advisorRoleClass + "> . \n" + "?advisingRelationship ?advisorRole . \n" + "?advisorRole ?advisingRelationship . "; - - final static String n3ForExistingAdvisorAssertion = + + final static String n3ForExistingAdvisorAssertion = "?advisingRelationship ?existingAdvisor . \n" + "?existingAdvisor ?advisingRelationship . \n" + "?existingAdvisor ?advisorRole . \n" + "?advisorRole ?existingAdvisor . \n" + - "?advisorRole a <" + advisorRoleClass + "> . \n" + + "?advisorRole a <" + advisorRoleClass + "> . \n" + "?advisingRelationship ?advisorRole . \n" + "?advisorRole ?advisingRelationship . "; - - final static String firstNameAssertion = + + final static String firstNameAssertion = "@prefix vcard: . \n" + "?newAdvisor ?vcardAdvisor . \n" + "?vcardAdvisor ?newAdvisor . \n" + - "?vcardAdvisor a . \n" + + "?vcardAdvisor a . \n" + "?vcardAdvisor vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; - - final static String lastNameAssertion = + + final static String lastNameAssertion = "@prefix vcard: . \n" + "?newAdvisor ?vcardAdvisor . \n" + "?vcardAdvisor ?newAdvisor . \n" + - "?vcardAdvisor a . \n" + + "?vcardAdvisor a . \n" + "?vcardAdvisor vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; - - final static String degreeAssertion = + + final static String degreeAssertion = "?advisingRelationship ?degree . \n" + " "; //This is for an existing subject area //Where we only need the existing subject area label - final static String n3ForExistingSubjAreaAssertion = + final static String n3ForExistingSubjAreaAssertion = "?advisingRelationship ?existingSubjArea . \n" + - "?existingSubjArea ?advisingRelationship . "; + "?existingSubjArea ?advisingRelationship . "; //For new subject area, we include all new information //new subject area should always be a new resource - //and the following should only get evaluated + //and the following should only get evaluated //when there is something in the label - - final static String n3ForNewSubjAreaAssertion = - "?advisingRelationship ?newSubjArea . \n" + - "?newSubjArea ?advisingRelationship . \n" + - "?newSubjArea <"+ label + "> ?subjAreaLabel . \n" + - "?newSubjArea a <" + subjAreaClass + "> . "; + + final static String n3ForNewSubjAreaAssertion = + "?advisingRelationship ?newSubjArea . \n" + + "?newSubjArea ?advisingRelationship . \n" + + "?newSubjArea <"+ label + "> ?subjAreaLabel . \n" + + "?newSubjArea a <" + subjAreaClass + "> . "; final static String n3ForStart = - "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + + "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + + "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + @@ -286,7 +286,7 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp /* Queries for editing an existing entry */ - final static String existingAdvisingRelQuery = + final static String existingAdvisingRelQuery = "SELECT ?advisingRelationship WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + @@ -297,7 +297,7 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp "SELECT ?advisingRelType WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + - " ?advisingRelationship vitro:mostSpecificType ?advisingRelType . \n" + + " ?advisingRelationship vitro:mostSpecificType ?advisingRelType . \n" + "}"; final static String advisingRelLabelQuery = @@ -307,7 +307,7 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?advisingRelationship <" + label + "> ?existingAdvisingRelLabel . \n" + "}"; - final static String advisorQuery = + final static String advisorQuery = "SELECT ?existingAdvisor WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + @@ -330,13 +330,13 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?existingAdvisorRole a <" + advisorRoleClass + "> . \n" + "}"; - final static String existingAdvisorRoleQuery = + final static String existingAdvisorRoleQuery = "SELECT ?existingAdvisorRole WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship ?existingAdvisorRole . \n" + " ?existingAdvisorRole ?advisingRelationship . \n" + - " ?existingAdvisorRole a <" + advisorRoleClass + "> . \n" + + " ?existingAdvisorRole a <" + advisorRoleClass + "> . \n" + "}"; final static String subjAreaQuery = @@ -348,7 +348,7 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?existingSubjArea ?type \n" + "}"; - final static String subjAreaLabelQuery = + final static String subjAreaLabelQuery = "SELECT ?existingSubjAreaLabel WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + @@ -358,14 +358,14 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?existingSubjArea ?type \n" + "}"; - final static String degreeQuery = + final static String degreeQuery = "SELECT ?existingDegree WHERE {\n"+ " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship ?existingDegree . \n" + " ?existingDegree a <" + degreeClass + "> . \n" + "}"; - + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + @@ -375,7 +375,7 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingDateStart . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + @@ -387,48 +387,48 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - final static String existingStartNodeQuery = + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> .} "; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> } "; + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> } "; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?adviseeRole ?advisingRelationship . \n" + " ?advisingRelationship ?adviseeRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { @@ -438,10 +438,10 @@ public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator imp } public String getSparqlForAcFilter(VitroRequest vreq) { - String subject = EditConfigurationUtils.getSubjectUri(vreq); + String subject = EditConfigurationUtils.getSubjectUri(vreq); String predicate = EditConfigurationUtils.getPredicateUri(vreq); //Get all objects for existing predicate, filters out results from addition and edit - String query = "SELECT ?objectVar WHERE { " + + String query = "SELECT ?objectVar WHERE { " + "<" + subject + "> <" + predicate + "> ?objectVar .} "; return query; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java index 184fe17d..6c22bd4a 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java @@ -37,25 +37,25 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public PersonHasAdvisorRelationshipGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasAdvisorRelationship.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("advisorRole"); - + conf.setN3Required( Arrays.asList( n3ForNewAdvisingRelationship, advisingRelLabelAssertion, advisingRelTypeAssertion ) ); @@ -66,9 +66,9 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp lastNameAssertion, n3ForExistingSubjAreaAssertion, //relationship to existing subject area n3ForNewSubjAreaAssertion, //this will include all the new information that needs to be captured - n3ForStart, + n3ForStart, n3ForEnd ) ); - + conf.addNewResource("advisingRelationship", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newAdvisee", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardAdvisee", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -79,19 +79,19 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform(Arrays.asList("advisingRelType", "existingSubjArea", "degree", "existingAdvisee")); conf.setLiteralsOnForm(Arrays.asList("advisingRelLabel", "subjAreaLabel", "adviseeLabel", "firstName", "lastName", "subjAreaLabelDisplay", "adviseeLabelDisplay" )); - + conf.addSparqlForExistingLiteral("advisingRelLabel", advisingRelLabelQuery); conf.addSparqlForExistingLiteral("adviseeLabel", adviseeLabelQuery); conf.addSparqlForExistingLiteral("subjAreaLabel", subjAreaLabelQuery); conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("advisingRelType", advisingRelTypeQuery); conf.addSparqlForExistingUris("advisingRelationship", existingAdvisingRelQuery); conf.addSparqlForExistingUris("adviseeRole", existingAdviseeRoleQuery); @@ -103,8 +103,8 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp conf.addSparqlForExistingUris("endNode", existingEndNodeQuery); conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("advisingRelType"). setValidators( list("nonempty") ). setOptions( new ChildVClassesWithParent(advisingRelClass)) @@ -129,8 +129,8 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp ); conf.addField( new FieldVTwo(). // options set by auto complete JS - setName("existingSubjArea") - ); + setName("existingSubjArea") + ); conf.addField( new FieldVTwo(). setName("subjAreaLabel"). @@ -140,13 +140,13 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp conf.addField( new FieldVTwo(). setName("degree"). - setOptions( + setOptions( new IndividualsViaVClassOptions(degreeClass)) ); conf.addField( new FieldVTwo(). // options set by auto complete JS - setName("existingAdvisee") - ); + setName("existingAdvisee") + ); conf.addField( new FieldVTwo(). setName("adviseeLabel"). @@ -167,16 +167,16 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp ); conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) @@ -186,98 +186,98 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp conf.addValidator(new AntiXssValidation()); conf.addValidator(new FirstAndLastNameValidator("existingAdvisee")); addFormSpecificData(conf, vreq); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewAdvisingRelationship = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + final static String n3ForNewAdvisingRelationship = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?person ?advisingRelationship . \n" + - "?advisingRelationship a <" + advisingRelClass + "> . \n" + + "?advisingRelationship a <" + advisingRelClass + "> . \n" + "?advisingRelationship ?person . \n" + "?advisingRelationship ?advisorRole . \n" + - "?advisorRole a <" + advisorRoleClass + "> . \n" + + "?advisorRole a <" + advisorRoleClass + "> . \n" + "?advisorRole ?advisingRelationship . \n" + "?person ?advisorRole . \n" + "?advisorRole ?person . "; - - final static String advisingRelLabelAssertion = + + final static String advisingRelLabelAssertion = "?advisingRelationship <"+ label + "> ?advisingRelLabel ."; - - final static String advisingRelTypeAssertion = + + final static String advisingRelTypeAssertion = "?advisingRelationship a ?advisingRelType ."; - final static String n3ForNewAdviseeAssertion = + final static String n3ForNewAdviseeAssertion = "?advisingRelationship ?newAdvisee . \n" + "?newAdvisee ?advisingRelationship . \n" + "?newAdvisee <" + label + "> ?adviseeLabel . \n" + "?newAdvisee a <" + adviseeClass + "> . \n" + "?newAdvisee ?adviseeRole . \n" + "?adviseeRole ?newAdvisee . \n" + - "?adviseeRole a <" + adviseeRoleClass + "> . \n" + + "?adviseeRole a <" + adviseeRoleClass + "> . \n" + "?advisingRelationship ?adviseeRole . \n" + "?adviseeRole ?advisingRelationship . "; - - final static String n3ForExistingAdviseeAssertion = + + final static String n3ForExistingAdviseeAssertion = "?advisingRelationship ?existingAdvisee . \n" + "?existingAdvisee ?advisingRelationship . \n" + "?existingAdvisee ?adviseeRole . \n" + "?adviseeRole ?existingAdvisee . \n" + - "?adviseeRole a <" + adviseeRoleClass + "> . \n" + + "?adviseeRole a <" + adviseeRoleClass + "> . \n" + "?advisingRelationship ?adviseeRole . \n" + "?adviseeRole ?advisingRelationship . "; - - final static String firstNameAssertion = + + final static String firstNameAssertion = "@prefix vcard: . \n" + "?newAdvisee ?vcardAdvisee . \n" + "?vcardAdvisee ?newAdvisee . \n" + - "?vcardAdvisee a . \n" + + "?vcardAdvisee a . \n" + "?vcardAdvisee vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; - - final static String lastNameAssertion = + + final static String lastNameAssertion = "@prefix vcard: . \n" + "?newAdvisee ?vcardAdvisee . \n" + "?vcardAdvisee ?newAdvisee . \n" + - "?vcardAdvisee a . \n" + + "?vcardAdvisee a . \n" + "?vcardAdvisee vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; - - final static String degreeAssertion = + + final static String degreeAssertion = "?advisingRelationship ?degree . \n" + " "; //This is for an existing subject area //Where we only need the existing subject area label - final static String n3ForExistingSubjAreaAssertion = + final static String n3ForExistingSubjAreaAssertion = "?advisingRelationship ?existingSubjArea . \n" + - "?existingSubjArea ?advisingRelationship"; + "?existingSubjArea ?advisingRelationship"; //For new subject area, we include all new information //new subject area should always be a new resource - //and the following should only get evaluated + //and the following should only get evaluated //when there is something in the label - - final static String n3ForNewSubjAreaAssertion = - "?advisingRelationship ?newSubjArea . \n" + - "?newSubjArea ?advisingRelationship . \n" + - "?newSubjArea <"+ label + "> ?subjAreaLabel . \n" + - "?newSubjArea a <" + subjAreaClass + "> . "; + + final static String n3ForNewSubjAreaAssertion = + "?advisingRelationship ?newSubjArea . \n" + + "?newSubjArea ?advisingRelationship . \n" + + "?newSubjArea <"+ label + "> ?subjAreaLabel . \n" + + "?newSubjArea a <" + subjAreaClass + "> . "; final static String n3ForStart = - "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + + "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + + "?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + @@ -286,7 +286,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp /* Queries for editing an existing entry */ - final static String existingAdvisingRelQuery = + final static String existingAdvisingRelQuery = "SELECT ?advisingRelationship WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + @@ -294,10 +294,10 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp final static String advisingRelTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?advisingRelType WHERE { \n" + + "SELECT ?advisingRelType WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + - " ?advisingRelationship vitro:mostSpecificType ?advisingRelType . \n" + + " ?advisingRelationship vitro:mostSpecificType ?advisingRelType . \n" + "}"; final static String advisingRelLabelQuery = @@ -307,7 +307,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?advisingRelationship <" + label + "> ?existingAdvisingRelLabel . \n" + "}"; - final static String adviseeQuery = + final static String adviseeQuery = "SELECT ?existingAdvisee WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + @@ -332,13 +332,13 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" + "}"; - final static String existingAdviseeRoleQuery = + final static String existingAdviseeRoleQuery = "SELECT ?existingAdviseeRole WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship ?existingAdviseeRole . \n" + " ?existingAdviseeRole ?advisingRelationship . \n" + - " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" + + " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" + "}"; final static String subjAreaQuery = @@ -350,7 +350,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?existingSubjArea ?type \n" + "}"; - final static String subjAreaLabelQuery = + final static String subjAreaLabelQuery = "SELECT ?existingSubjAreaLabel WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + @@ -360,14 +360,14 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?existingSubjArea ?type \n" + "}"; - final static String degreeQuery = + final static String degreeQuery = "SELECT ?existingDegree WHERE {\n"+ " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship ?existingDegree . \n" + " ?existingDegree a <" + degreeClass + "> . \n" + "}"; - + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + @@ -377,7 +377,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingDateStart . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + @@ -389,48 +389,48 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - final static String existingStartNodeQuery = + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> .} "; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> } "; + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> } "; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?advisorRole ?advisingRelationship . \n" + " ?advisingRelationship ?advisorRole . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { @@ -440,10 +440,10 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp } public String getSparqlForAcFilter(VitroRequest vreq) { - String subject = EditConfigurationUtils.getSubjectUri(vreq); + String subject = EditConfigurationUtils.getSubjectUri(vreq); String predicate = EditConfigurationUtils.getPredicateUri(vreq); //Get all objects for existing predicate, filters out results from addition and edit - String query = "SELECT ?objectVar WHERE { " + + String query = "SELECT ?objectVar WHERE { " + "<" + subject + "> <" + predicate + "> ?objectVar .} "; return query; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java index 4a79ae92..ede14f45 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAwardOrHonorGenerator.java @@ -38,38 +38,38 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public PersonHasAwardOrHonorGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasAwardOrHonor.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("awardReceipt"); - + conf.setN3Required( Arrays.asList( n3ForNewAwardReceipt, awardReceiptLabelAssertion ) ); - conf.setN3Optional( Arrays.asList( n3ForNewAwardAssertion, - n3ForExistingAwardAssertion, - descriptionAssertion, + conf.setN3Optional( Arrays.asList( n3ForNewAwardAssertion, + n3ForExistingAwardAssertion, + descriptionAssertion, n3ForNewOrgNewAwardAssertion, n3ForExistingOrgNewAwardAssertion, n3ForNewOrgExistingAwardAssertion, n3ForExistingOrgExistingAwardAssertion, - n3ForYearAwarded, - n3ForStart, + n3ForYearAwarded, + n3ForStart, n3ForEnd ) ); - + conf.addNewResource("award", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("awardReceipt", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newOrg", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -77,13 +77,13 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none - //literals in scope: none - + + //uris in scope: none + //literals in scope: none + conf.setUrisOnform(Arrays.asList("existingAward", "existingOrg")); conf.setLiteralsOnForm(Arrays.asList("description", "awardReceiptLabel", "awardLabel", "orgLabel", "yearAwardedDisplay", "orgLabelDisplay", "awardLabelDisplay" )); - + conf.addSparqlForExistingLiteral("awardReceiptLabel", awardReceiptLabelQuery); conf.addSparqlForExistingLiteral("awardLabel", awardLabelQuery); conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery); @@ -91,9 +91,9 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements conf.addSparqlForExistingLiteral("yearAwarded-value", existingYearAwardedQuery); conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("existingAward", existingAwardQuery); - conf.addSparqlForExistingUris("existingOrg", existingOrgQuery); + conf.addSparqlForExistingUris("existingOrg", existingOrgQuery); conf.addSparqlForExistingUris("yearAwardedNode",existingYearAwardedNodeQuery); conf.addSparqlForExistingUris("intervalNode",existingIntervalNodeQuery); conf.addSparqlForExistingUris("startNode", existingStartNodeQuery); @@ -101,20 +101,20 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements conf.addSparqlForExistingUris("yearAwarded-precision", existingYearAwardedPrecisionQuery); conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("description") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()) ) ); conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS - setName("existingOrg") + setName("existingOrg") ); conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS setName("existingAward") - ); + ); conf.addField( new FieldVTwo(). setName("awardReceiptLabel"). @@ -153,24 +153,24 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements ); conf.addField( new FieldVTwo().setName("yearAwarded"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) @@ -185,66 +185,66 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements /* N3 assertions */ - final static String n3ForNewAwardReceipt = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + final static String n3ForNewAwardReceipt = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?person <" + awardReceiptPred + "> ?awardReceipt . \n" + - "?awardReceipt a <" + awardReceiptClass + "> . \n" + - "?awardReceipt <" + awardForPred + "> ?person . " ; - - final static String awardReceiptLabelAssertion = + "?awardReceipt a <" + awardReceiptClass + "> . \n" + + "?awardReceipt <" + awardForPred + "> ?person . " ; + + final static String awardReceiptLabelAssertion = "?awardReceipt <"+ label + "> ?awardReceiptLabel ."; - - final static String n3ForNewAwardAssertion = + + final static String n3ForNewAwardAssertion = "?awardReceipt <" + receiptOfPred + "> ?award . \n" + "?award a <" + awardClass + "> . \n" + "?award <" + receiptPred + "> ?awardReceipt . \n" + "?award <"+ label + "> ?awardLabel ."; - - final static String n3ForExistingAwardAssertion = + + final static String n3ForExistingAwardAssertion = "?awardReceipt <" + receiptOfPred + "> ?existingAward . \n" + "?existingAward <" + receiptPred + "> ?awardReceipt . " ; - - final static String descriptionAssertion = + + final static String descriptionAssertion = "?awardReceipt <"+ descriptionPred +"> ?description ."; - final static String n3ForExistingOrgNewAwardAssertion = + final static String n3ForExistingOrgNewAwardAssertion = "?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" + "?existingOrg <" + awardConferredPred + "> ?awardReceipt . \n" + - "?award <"+ label + "> ?awardLabel ."; + "?award <"+ label + "> ?awardLabel ."; - final static String n3ForExistingOrgExistingAwardAssertion = + final static String n3ForExistingOrgExistingAwardAssertion = "?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" + - "?existingOrg <" + awardConferredPred + "> ?awardReceipt . "; + "?existingOrg <" + awardConferredPred + "> ?awardReceipt . "; - final static String n3ForNewOrgNewAwardAssertion = + final static String n3ForNewOrgNewAwardAssertion = "?newOrg a <" + orgClass + "> . \n" + "?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" + "?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" + - "?award <"+ label + "> ?awardLabel . \n" + - "?newOrg <"+ label + "> ?orgLabel ."; + "?award <"+ label + "> ?awardLabel . \n" + + "?newOrg <"+ label + "> ?orgLabel ."; - final static String n3ForNewOrgExistingAwardAssertion = + final static String n3ForNewOrgExistingAwardAssertion = "?newOrg a <" + orgClass + "> . \n" + "?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" + - "?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" + - "?newOrg <"+ label + "> ?orgLabel ."; + "?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" + + "?newOrg <"+ label + "> ?orgLabel ."; - final static String n3ForYearAwarded = + final static String n3ForYearAwarded = "?awardReceipt <" + yearAwardedPred + "> ?yearAwardedNode . \n" + "?yearAwardedNode a <" + dateTimeValueType + "> . \n" + "?yearAwardedNode <" + dateTimeValue + "> ?yearAwarded-value . \n" + "?yearAwardedNode <" + dateTimePrecision + "> ?yearAwarded-precision ."; - + final static String n3ForStart = - "?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + + "?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + + "?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + @@ -259,7 +259,7 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements " ?existingAward a <" + awardClass + "> . \n" + "}"; - final static String existingOrgQuery = + final static String existingOrgQuery = "SELECT ?existingOrg WHERE { \n" + " ?awardReceipt <" + awardConferredByPred + "> ?existingOrg . \n" + " ?existingOrg a <" + orgClass + "> . \n" + @@ -277,24 +277,24 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements " ?existingAward <" + label + "> ?existingAwardLabel . \n" + "}"; - final static String orgLabelQuery = + final static String orgLabelQuery = "SELECT ?existingOrgLabel WHERE { \n" + " ?awardReceipt <" + awardConferredByPred + "> ?existingOrg . \n" + " ?existingOrg a <" + orgClass + "> . \n" + " ?existingOrg <" + label + "> ?existingOrgLabel . \n" + "}"; - final static String descriptionQuery = + final static String descriptionQuery = "SELECT ?existingDescription WHERE {\n"+ " ?awardReceipt <"+ descriptionPred +"> ?existingDescription . }"; - final static String existingYearAwardedQuery = + final static String existingYearAwardedQuery = "SELECT ?existingYearAwardedValue WHERE { \n" + " ?awardReceipt <" + yearAwardedPred + "> ?yearAwardedNode . \n" + " ?yearAwardedNode a <" + dateTimeValueType + "> . \n" + " ?yearAwardedNode <" + dateTimeValue + "> ?existingYearAwardedValue }"; - final static String existingYearAwardedNodeQuery = + final static String existingYearAwardedNodeQuery = "SELECT ?existingYearAwardedNode WHERE { \n" + " ?awardReceipt <" + yearAwardedPred + "> ?existingYearAwardedNode . }"; @@ -305,7 +305,7 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingStartDate . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + @@ -315,44 +315,44 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - final static String existingStartNodeQuery = + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> . } "; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> } "; + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> } "; - final static String existingYearAwardedPrecisionQuery = + final static String existingYearAwardedPrecisionQuery = "SELECT ?existingYearAwardedPrecision WHERE { \n" + " ?awardReceipt <" + yearAwardedPred + "> ?yearAwarded . \n" + - " ?yearAwarded a <" + dateTimeValueType + "> . \n" + + " ?yearAwarded a <" + dateTimeValueType + "> . \n" + " ?yearAwarded <" + dateTimePrecision + "> ?existingYearAwardedPrecision . }"; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?awardReceipt <" + awardReceiptToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java index f1a1a6c9..876ab4c2 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java @@ -26,60 +26,60 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; /** Form for adding an educational attainment to an individual - Classes: + Classes: core:EducationalProcess - primary new individual being created foaf:Person - existing individual foaf:Organization - new or existing individual core:AcademicDegree - existing individual core:AwardedDegree - new or existing individual - - - There are 4 modes that this form can be in: - 1. Add, there is a subject and a predicate but no position and nothing else. - + + + There are 4 modes that this form can be in: + 1. Add, there is a subject and a predicate but no position and nothing else. + 2. normal edit where everything should already be filled out. There is a subject, a object and an individual on - the other end of the object's relationship. - - 3. Repair a bad role node. There is a subject, prediate and object but there is no individual on the + the other end of the object's relationship. + + 3. Repair a bad role node. There is a subject, prediate and object but there is no individual on the other end of the object's relationship. This should be similar to an add but the form should be expanded. - + 4. Really bad node. multiple statements on the other end of the object's relationship. * @author bdc34 * */ -public class PersonHasEducationalTraining extends VivoBaseGenerator implements EditConfigurationGenerator{ +public class PersonHasEducationalTraining extends VivoBaseGenerator implements EditConfigurationGenerator{ //TODO: can we get rid of the session and get it form the vreq? public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasEducationalTraining.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("edTraining"); - + conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewOrganization, n3ForExistingOrganization, n3ForNewOrgAwardedDegree, n3ForExistingOrgAwardedDegree, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); - + conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("awardedDegree",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newOrg",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("intervalNode",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode",DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform( Arrays.asList( "existingOrg", "orgType", "degreeType", "trainingType")); conf.setLiteralsOnForm( Arrays.asList("orgLabel", "orgLabelDisplay", "awardedDegreeLabel", "majorField", "dept", "info")); @@ -92,7 +92,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("awardedDegree", existingAwardedDegreeQuery); conf.addSparqlForExistingUris("existingOrg", existingOrgQuery); conf.addSparqlForExistingUris("orgType", orgTypeQuery); @@ -105,8 +105,8 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); //Add sparql to include inverse property as well conf.addSparqlForAdditionalUrisInScope("inverseTrainingAtOrg", inverseTrainingAtOrgQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("degreeType"). setOptions( new IndividualsViaVClassOptions( degreeTypeClass))); @@ -115,16 +115,16 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements setName("majorField"). setRangeDatatypeUri( XSD.xstring.toString() ). setValidators(list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("existingOrg") - //options will be added in browser by auto complete JS - ); - + //options will be added in browser by auto complete JS + ); + conf.addField( new FieldVTwo(). setName("awardedDegree") - //options will be added in browser by auto complete JS - ); + //options will be added in browser by auto complete JS + ); conf.addField( new FieldVTwo(). setName("orgLabel"). @@ -140,28 +140,28 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements setName("existingAwardedDegreeLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("orgLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() )); - + conf.addField( new FieldVTwo(). setName("orgType"). setValidators( list("nonempty")). setOptions( new ChildVClassesOptions( orgClass))); - + conf.addField( new FieldVTwo(). setName("trainingType"). setValidators( list("nonempty") ). - setOptions( + setOptions( new ChildVClassesWithParent(edProcessClass))); conf.addField( new FieldVTwo(). setName("dept"). setRangeDatatypeUri( XSD.xstring.toString() ). setValidators(list("datatype:" + XSD.xstring.toString()))); - + conf.addField( new FieldVTwo(). setName("info"). setRangeDatatypeUri( XSD.xstring.toString() ). @@ -169,32 +169,32 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements FieldVTwo startField = new FieldVTwo(). setName("startField"); - conf.addField(startField. + conf.addField(startField. setEditElement( - new DateTimeWithPrecisionVTwo(startField, + new DateTimeWithPrecisionVTwo(startField, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()))); - + FieldVTwo endField = new FieldVTwo(). setName("endField"); - conf.addField( endField. + conf.addField( endField. setEditElement( - new DateTimeWithPrecisionVTwo(endField, + new DateTimeWithPrecisionVTwo(endField, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()))); //Add validator conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); conf.addValidator(new AntiXssValidation()); - + //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; } - + /* N3 assertions for working with educational training */ - - final static String n3ForNewEdTraining = + + final static String n3ForNewEdTraining = "@prefix core: <"+ vivoCore +"> .\n"+ "?person ?edTraining .\n" + "?edTraining a core:EducationalProcess .\n" + @@ -203,7 +203,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements final static String trainingTypeAssertion = "?edTraining a ?trainingType ."; - final static String n3ForAwardedDegree = + final static String n3ForAwardedDegree = "@prefix core: <"+ vivoCore +"> .\n"+ "?edTraining ?awardedDegree . \n" + "?awardedDegree ?edTraining . \n" + @@ -214,31 +214,31 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?degreeType ?awardedDegree . \n"+ "?awardedDegree a core:AwardedDegree ."; - final static String n3ForNewOrganization = + final static String n3ForNewOrganization = "?edTraining ?newOrg . \n" + "?newOrg ?edTraining . \n" + "?newOrg a ?orgType . \n" + "?newOrg <"+ label +"> ?orgLabel . "; - final static String n3ForExistingOrganization = + final static String n3ForExistingOrganization = "?edTraining ?existingOrg . \n" + "?existingOrg ?edTraining . \n" + "?existingOrg a ?orgType . "; - - final static String n3ForNewOrgAwardedDegree = + + final static String n3ForNewOrgAwardedDegree = "?awardedDegree ?newOrg . \n" + "?newOrg ?awardedDegree . \n" + "?newOrg a ?orgType . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?newOrg <"+ label +"> ?orgLabel . "; - final static String n3ForExistingOrgAwardedDegree = + final static String n3ForExistingOrgAwardedDegree = "?awardedDegree ?existingOrg . \n" + "?existingOrg ?awardedDegree . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?existingOrg a ?orgType . "; - final static String majorFieldAssertion = + final static String majorFieldAssertion = "?edTraining <"+ majorFieldPred +"> ?majorField ."; final static String n3ForStart = @@ -257,24 +257,24 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?endNode <"+ dateTimeValue +"> ?endField-value .\n"+ "?endNode <"+ dateTimePrecision +"> ?endField-precision ."; - final static String deptAssertion = + final static String deptAssertion = "?edTraining <"+ deptPred +"> ?dept ."; - final static String infoAssertion = + final static String infoAssertion = "?edTraining <"+ infoPred +"> ?info ."; /* Queries for editing an existing educational training entry */ - final static String existingAwardedDegreeQuery = + final static String existingAwardedDegreeQuery = "SELECT ?existingAwardedDegree WHERE {\n"+ "?edTraining ?existingAwardedDegree . }\n"; - final static String existingAwardedDegreeLabelQuery = + final static String existingAwardedDegreeLabelQuery = "SELECT ?existingAwardedDegreeLabel WHERE {\n"+ "?edTraining ?existingAwardedDegree . \n" + "?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel }\n"; - final static String existingOrgQuery = + final static String existingOrgQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingOrg WHERE {\n"+ "?edTraining ?existingOrg . \n" + @@ -282,7 +282,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?existingOrg a ?existingOrgType . \n " + "?existingOrgType rdfs:subClassOf <"+ orgClass +"> . }"; - final static String orgLabelQuery = + final static String orgLabelQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingOrgLabel WHERE {\n"+ "?edTraining ?existingOrg . \n" + @@ -293,7 +293,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements /* Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another type is returned and we don't get a match to the select element options. */ - final static String orgTypeQuery = + final static String orgTypeQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingOrgType WHERE {\n"+ "?edTraining ?existingOrg . \n" + @@ -302,12 +302,12 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?existingOrgType rdfs:subClassOf <"+ orgClass +"> .\n"+ "}"; - final static String trainingTypeQuery = + final static String trainingTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingTrainingType WHERE { \n" + + "SELECT ?existingTrainingType WHERE { \n" + " ?edTraining vitro:mostSpecificType ?existingTrainingType . }"; - - final static String degreeTypeQuery = + + final static String degreeTypeQuery = "PREFIX core: <"+ vivoCore +"> \n"+ "SELECT ?existingDegreeType WHERE {\n"+ "?edTraining ?existingAwardedDegree . \n"+ @@ -315,31 +315,31 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?existingAwardedDegree core:relates ?existingDegreeType . \n" + "?existingDegreeType a core:AcademicDegree }"; - final static String majorFieldQuery = + final static String majorFieldQuery = "SELECT ?existingMajorField WHERE {\n"+ "?edTraining <"+ majorFieldPred +"> ?existingMajorField . }"; - final static String deptQuery = + final static String deptQuery = "SELECT ?existingDept WHERE {\n"+ "?edTraining <"+ deptPred +"> ?existingDept . }"; - final static String infoQuery = + final static String infoQuery = "SELECT ?existingInfo WHERE {\n"+ "?edTraining <"+ infoPred +"> ?existingInfo . }"; - final static String existingIntervalNodeQuery = + final static String existingIntervalNodeQuery = "SELECT ?existingIntervalNode WHERE {\n"+ "?edTraining <"+ toInterval +"> ?existingIntervalNode .\n"+ "?existingIntervalNode <"+ type +"> <"+ intervalType +"> . }"; - - final static String existingStartNodeQuery = + + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToStart +"> ?existingStartNode . \n"+ "?existingStartNode <"+ type +"> <"+ dateTimeValueType +"> .}"; - final static String existingStartDateQuery = + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -347,7 +347,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?startNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?startNode <"+ dateTimeValue +"> ?existingDateStart . }"; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -355,14 +355,14 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?startNode <"+ type +"> <"+ dateTimeValueType +"> . \n"+ "?startNode <"+ dateTimePrecision +"> ?existingStartPrecision . }"; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToEnd +"> ?existingEndNode . \n"+ "?existingEndNode <"+ type +"> <"+ dateTimeValueType +"> .}"; - final static String existingEndDateQuery = + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ @@ -370,28 +370,28 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?endNode <"+ dateTimeValue +"> ?existingEndDate . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE {\n"+ "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ "?intervalNode <"+ intervalToEnd +"> ?endNode .\n"+ "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ "?endNode <"+ dateTimePrecision +"> ?existingEndPrecision . }"; - + //Query for inverse property final static String inverseTrainingAtOrgQuery = "PREFIX owl: " + " SELECT ?inverseTrainingAtOrg " + " WHERE { ?inverseTrainingAtOrg owl:inverseOf . } "; - - + + //Adding form specific data such as edit mode public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); editConfiguration.setFormSpecificData(formSpecificData); } - + public EditMode getEditMode(VitroRequest vreq) { List predicates = new ArrayList(); predicates.add("http://vivoweb.org/ontology/core#relates"); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEmailGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEmailGenerator.java index a5fe5052..0ee5f955 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEmailGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEmailGenerator.java @@ -21,25 +21,25 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class PersonHasEmailGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(PersonHasEmailGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - String emailUri = getEmailUri(vreq); - String rangeUri = getRangeUri(vreq); - + initObjectPropForm(conf, vreq); + String emailUri = getEmailUri(vreq); + String rangeUri = getRangeUri(vreq); + conf.setTemplate("personHasEmailAddress.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("individualVcard"); - + if ( rangeUri.equals("http://www.w3.org/2006/vcard/ns#Work") ) { conf.setN3Required( Arrays.asList( n3ForNewPrimaryEmail ) ); } @@ -48,12 +48,12 @@ public class PersonHasEmailGenerator extends VivoBaseGenerator implements } conf.setN3Optional( Arrays.asList( emailAddressAssertion ) ); - + conf.addNewResource("email", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setLiteralsOnForm(Arrays.asList("emailAddress" )); - + conf.addSparqlForExistingLiteral("emailAddress", emailAddressQuery); conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); @@ -63,37 +63,37 @@ public class PersonHasEmailGenerator extends VivoBaseGenerator implements conf.addUrisInScope(urisInScope); } - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("emailAddress") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - + conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewEmail = + final static String n3ForNewEmail = "?person ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?person . \n" + "?individualVcard ?email . \n" + - "?email a . " ; - - final static String n3ForNewPrimaryEmail = + "?email a . " ; + + final static String n3ForNewPrimaryEmail = "?person ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?person . \n" + "?individualVcard ?email . \n" + "?email a . \n" + - "?email a ." ; + "?email a ." ; - final static String emailAddressAssertion = + final static String emailAddressAssertion = "?email ?emailAddress ."; - + /* Queries for editing an existing entry */ final static String individualVcardQuery = @@ -101,18 +101,18 @@ public class PersonHasEmailGenerator extends VivoBaseGenerator implements "?person ?existingIndividualVcard . \n" + "}"; - final static String emailAddressQuery = + final static String emailAddressQuery = "SELECT ?existingEmailAddress WHERE {\n"+ "?email ?existingEmailAddress . }"; private String getRangeUri(VitroRequest vreq) { - String rangeUri = vreq.getParameter("rangeUri"); - + String rangeUri = vreq.getParameter("rangeUri"); + return rangeUri; } private String getEmailUri(VitroRequest vreq) { - String emailUri = vreq.getParameter("emailUri"); - + String emailUri = vreq.getParameter("emailUri"); + return emailUri; } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java index 8c400a7c..5f412c6a 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java @@ -33,50 +33,50 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public PersonHasIssuedCredentialGenerator() {} - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasIssuedCredential.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("issuedCredential"); - + conf.setN3Required( Arrays.asList( n3ForNewIssuedCredential, n3ForICTypeAssertion) ); - conf.setN3Optional( Arrays.asList( n3ForNewCredentialAssertion, - n3ForExistingCredentialAssertion, - n3ForYearCredentialed, - n3ForStart, + conf.setN3Optional( Arrays.asList( n3ForNewCredentialAssertion, + n3ForExistingCredentialAssertion, + n3ForYearCredentialed, + n3ForStart, n3ForEnd ) ); - + conf.addNewResource("credential", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("issuedCredential", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("yearCredentialedNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none - //literals in scope: none - + + //uris in scope: none + //literals in scope: none + conf.setUrisOnform(Arrays.asList("existingCredential", "issuedCredentialType", "credentialType")); conf.setLiteralsOnForm(Arrays.asList("yearCredentialedDisplay","credentialLabel", "credentialLabelDisplay" )); - + conf.addSparqlForExistingLiteral("credentialLabel", credentialLabelQuery); conf.addSparqlForExistingLiteral("yearCredentialed-value", existingYearCredentialedQuery); conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("existingCredential", existingCredentialQuery); conf.addSparqlForExistingUris("credentialType", existingCredentialTypeQuery); conf.addSparqlForExistingUris("issuedCredentialType", issuedCredentialTypeQuery); @@ -87,20 +87,20 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem conf.addSparqlForExistingUris("yearCredentialed-precision", existingYearCredentialedPrecisionQuery); conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("issuedCredentialType"). setRangeDatatypeUri(XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString())) ); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("credentialType"). setOptions(getCredentialTypeFieldOptions(vreq))); conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS setName("existingCredential") - ); + ); conf.addField( new FieldVTwo(). setName("credentialLabel"). @@ -121,24 +121,24 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem ); conf.addField( new FieldVTwo().setName("yearCredentialed"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) @@ -147,7 +147,7 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); conf.addValidator(new AntiXssValidation()); conf.addValidator(new AutocompleteRequiredInputValidator("existingCredential", "credentialLabel")); - + addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; @@ -155,46 +155,46 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem /* N3 assertions */ - final static String n3ForNewIssuedCredential = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + final static String n3ForNewIssuedCredential = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?person vivo:relatedBy ?issuedCredential . \n" + - "?issuedCredential a <" + issuedCredentialTypeClass + "> . \n" + - "?issuedCredential vivo:relates ?person . " ; - - final static String n3ForICTypeAssertion = + "?issuedCredential a <" + issuedCredentialTypeClass + "> . \n" + + "?issuedCredential vivo:relates ?person . " ; + + final static String n3ForICTypeAssertion = "?issuedCredential a ?issuedCredentialType ."; - - final static String n3ForNewCredentialAssertion = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + + final static String n3ForNewCredentialAssertion = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?issuedCredential vivo:relates ?credential . \n" + "?credential a <" + credentialTypeClass + "> . \n" + "?credential vivo:relatedBy ?issuedCredential . \n" + "?credential a ?credentialType . \n" + "?credential <"+ label + "> ?credentialLabel ."; - - final static String n3ForExistingCredentialAssertion = - "@prefix vivo: <" + vivoCore + "> . \n\n" + + + final static String n3ForExistingCredentialAssertion = + "@prefix vivo: <" + vivoCore + "> . \n\n" + "?issuedCredential vivo:relates ?existingCredential . \n" + /* "?existingCredential a <" + credentialTypeClass + "> . \n" + "?existingCredential a ?credentialType . \n" + */ "?existingCredential vivo:relatedBy ?issuedCredential . " ; - - final static String n3ForYearCredentialed = + + final static String n3ForYearCredentialed = "?issuedCredential <" + yearCredentialedPred + "> ?yearCredentialedNode . \n" + "?yearCredentialedNode a <" + dateTimeValueType + "> . \n" + "?yearCredentialedNode <" + dateTimeValue + "> ?yearCredentialed-value . \n" + "?yearCredentialedNode <" + dateTimePrecision + "> ?yearCredentialed-precision ."; - + final static String n3ForStart = - "?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + + "?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + + "?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + @@ -233,13 +233,13 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem " ?existingCredential <" + label + "> ?existingCredentialLabel . \n" + "}"; - final static String existingYearCredentialedQuery = + final static String existingYearCredentialedQuery = "SELECT ?existingYearCredentialedValue WHERE { \n" + " ?issuedCredential <" + yearCredentialedPred + "> ?yearCredentialedNode . \n" + " ?yearCredentialedNode a <" + dateTimeValueType + "> . \n" + " ?yearCredentialedNode <" + dateTimeValue + "> ?existingYearCredentialedValue }"; - final static String existingYearCredentialedNodeQuery = + final static String existingYearCredentialedNodeQuery = "SELECT ?existingYearCredentialedNode WHERE { \n" + " ?issuedCredential <" + yearCredentialedPred + "> ?existingYearCredentialedNode . }"; @@ -250,7 +250,7 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingStartDate . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + @@ -260,44 +260,44 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - final static String existingStartNodeQuery = + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> . } "; - final static String existingEndNodeQuery = + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> } "; + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> } "; - final static String existingYearCredentialedPrecisionQuery = + final static String existingYearCredentialedPrecisionQuery = "SELECT ?existingYearCredentialedPrecision WHERE { \n" + " ?issuedCredential <" + yearCredentialedPred + "> ?yearCredentialed . \n" + - " ?yearCredentialed a <" + dateTimeValueType + "> . \n" + + " ?yearCredentialed a <" + dateTimeValueType + "> . \n" + " ?yearCredentialed <" + dateTimePrecision + "> ?existingYearCredentialedPrecision . }"; - final static String existingStartPrecisionQuery = + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - final static String existingEndPrecisionQuery = + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?issuedCredential <" + issuedCredentialToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; //Form specific data @@ -306,7 +306,7 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem formSpecificData.put("credentialTypeMap", getCredentialTypeMap()); editConfiguration.setFormSpecificData(formSpecificData); } - + // Issued Credentials relate a Credential to a person. The class type of a Credential and its subclasses // are different than -- but correspond to -- the class type of an Issued Credential and its subclasses. // When a user picks a type of credential in the GUI, we need to set the corresponding type for the issued diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java index b7c1ffda..832f2457 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPositionHistoryGenerator.java @@ -37,64 +37,64 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme final static String dateTimeValueType = vivoCore + "DateTimeValue"; final static String dateTimeValue = vivoCore + "dateTime"; final static String dateTimePrecision = vivoCore + "dateTimePrecision"; - + public PersonHasPositionHistoryGenerator() {} - // There are 4 modes that this form can be in: - // 1. Add. There is a subject and a predicate but no position and - // nothing else. - // - // 2. Normal edit where everything should already be filled out. + // There are 4 modes that this form can be in: + // 1. Add. There is a subject and a predicate but no position and + // nothing else. + // + // 2. Normal edit where everything should already be filled out. // There is a subject, a object and an individual on - // the other end of the object's core:personInOrganization stmt. - // - // 3. Repair a bad role node. There is a subject, predicate and object - // but there is no individual on the other end of the object's - // core:personInOrganization stmt. This should be similar to an add + // the other end of the object's core:personInOrganization stmt. + // + // 3. Repair a bad role node. There is a subject, predicate and object + // but there is no individual on the other end of the object's + // core:personInOrganization stmt. This should be similar to an add // but the form should be expanded. - // - // 4. Really bad node. multiple core:personInOrganization statements. - + // + // 4. Really bad node. multiple core:personInOrganization statements. + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("personHasPositionHistory.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("position"); - - conf.setN3Required( Arrays.asList( n3ForNewPosition, - positionTitleAssertion, + + conf.setN3Required( Arrays.asList( n3ForNewPosition, + positionTitleAssertion, positionTypeAssertion ) ); conf.setN3Optional( Arrays.asList( n3ForNewOrg, n3ForExistingOrg, n3ForStart, n3ForEnd ) ); - + conf.addNewResource("position", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newOrg", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform(Arrays.asList("existingOrg", "orgType", "positionType")); conf.setLiteralsOnForm(Arrays.asList("positionTitle", "orgLabel", "orgLabelDisplay")); - + conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery); conf.addSparqlForExistingLiteral("positionTitle", positionTitleQuery); conf.addSparqlForExistingLiteral( "startField-value", existingStartDateQuery); conf.addSparqlForExistingLiteral( "endField-value", existingEndDateQuery); - + conf.addSparqlForExistingUris("existingOrg", existingOrgQuery); conf.addSparqlForExistingUris("orgType", orgTypeQuery); conf.addSparqlForExistingUris("positionType", positionTypeQuery); @@ -102,26 +102,26 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme "intervalNode", existingIntervalNodeQuery); conf.addSparqlForExistingUris("startNode", existingStartNodeQuery); conf.addSparqlForExistingUris("endNode", existingEndNodeQuery); - conf.addSparqlForExistingUris("startField-precision", + conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); - conf.addSparqlForExistingUris("endField-precision", + conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("positionTitle") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") ) ); - + conf.addField( new FieldVTwo(). setName("positionType"). - setValidators( list("nonempty") ). - setOptions( + setValidators( list("nonempty") ). + setOptions( new ChildVClassesWithParent(positionClass))); - + conf.addField( new FieldVTwo(). setName("existingOrg")); //options set in browser by auto complete JS - + conf.addField( new FieldVTwo(). setName("orgLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -130,89 +130,89 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme conf.addField( new FieldVTwo(). setName("orgLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() ) ); - + conf.addField( new FieldVTwo(). setName("orgType"). - setOptions( + setOptions( new ChildVClassesWithParent(orgClass))); - + conf.addField( new FieldVTwo().setName("startField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); - + conf.addField( new FieldVTwo().setName("endField"). - setEditElement( - new DateTimeWithPrecisionVTwo(null, + setEditElement( + new DateTimeWithPrecisionVTwo(null, VitroVocabulary.Precision.YEAR.uri(), VitroVocabulary.Precision.NONE.uri()) ) ); - + conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); conf.addValidator(new AntiXssValidation()); conf.addValidator(new AutocompleteRequiredInputValidator("existingOrg", "orgLabel")); - + //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; } - final static String n3ForNewPosition = - "@prefix core: <" + vivoCore + "> . \n" + + final static String n3ForNewPosition = + "@prefix core: <" + vivoCore + "> . \n" + "?person core:relatedBy ?position . \n" + - "?position a ?positionType . \n" + - "?position core:relates ?person ; "; - + "?position a ?positionType . \n" + + "?position core:relates ?person ; "; + final static String positionTitleAssertion = "?position <" + label + "> ?positionTitle ."; - - final static String positionTypeAssertion = - "?position a ?positionType ."; - final static String n3ForNewOrg = + final static String positionTypeAssertion = + "?position a ?positionType ."; + + final static String n3ForNewOrg = "?position <" + positionInOrgPred + "> ?newOrg . \n" + "?newOrg <" + orgForPositionPred + "> ?position . \n" + "?newOrg <" + label + "> ?orgLabel . \n" + - "?newOrg a ?orgType ."; + "?newOrg a ?orgType ."; - final static String n3ForExistingOrg = + final static String n3ForExistingOrg = "?position <" + positionInOrgPred + "> ?existingOrg . \n" + "?existingOrg <" + orgForPositionPred + "> ?position . \n" + "?existingOrg a ?orgType ."; - + final static String n3ForStart = - "?position <" + positionToInterval + "> ?intervalNode . \n" + + "?position <" + positionToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + - "?intervalNode <" + intervalToStart + "> ?startNode . \n" + + "?intervalNode <" + intervalToStart + "> ?startNode . \n" + "?startNode a <" + dateTimeValueType + "> . \n" + "?startNode <" + dateTimeValue + "> ?startField-value . \n" + "?startNode <" + dateTimePrecision + "> ?startField-precision . \n"; - + final static String n3ForEnd = - "?position <" + positionToInterval + "> ?intervalNode . \n" + + "?position <" + positionToInterval + "> ?intervalNode . \n" + "?intervalNode a <" + intervalType + "> . \n" + "?intervalNode <" + intervalToEnd + "> ?endNode . \n" + "?endNode a <" + dateTimeValueType + "> . \n" + "?endNode <" + dateTimeValue + "> ?endField-value . \n" + "?endNode <" + dateTimePrecision + "> ?endField-precision . \n"; - -// Queries for existing values + +// Queries for existing values final static String orgLabelQuery = "SELECT ?existingOrgLabel WHERE { \n" + " ?position <" + positionInOrgPred + "> ?existingOrg . \n" + " ?existingOrg a <" + orgClass + "> . \n" + " ?existingOrg <" + label + "> ?existingOrgLabel . \n" + "}"; - + final static String positionTitleQuery = "SELECT ?existingPositionTitle WHERE { \n" + "?position <" + label + "> ?existingPositionTitle . }"; - + final static String existingStartDateQuery = "SELECT ?existingDateStart WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + @@ -220,7 +220,7 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + " ?startNode a <" + dateTimeValueType +"> . \n" + " ?startNode <" + dateTimeValue + "> ?existingDateStart . }"; - + final static String existingEndDateQuery = "SELECT ?existingEndDate WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + @@ -229,60 +229,60 @@ public class PersonHasPositionHistoryGenerator extends VivoBaseGenerator impleme " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimeValue + "> ?existingEndDate . }"; - final static String existingOrgQuery = + final static String existingOrgQuery = "SELECT ?existingOrg WHERE { \n" + " ?position <" + positionInOrgPred + "> ?existingOrg . \n" + " ?existingOrg a <" + orgClass + "> }"; - - final static String orgTypeQuery = - "PREFIX rdfs: <" + rdfs + "> \n" + + + final static String orgTypeQuery = + "PREFIX rdfs: <" + rdfs + "> \n" + "SELECT ?existingOrgType WHERE { \n" + " ?position <" + positionInOrgPred + "> ?existingOrg . \n" + " ?existingOrg a ?existingOrgType . \n" + " ?existingOrgType rdfs:subClassOf <" + orgClass + "> " + "} "; - + //Huda: changed this from rdf:type to vitro:mostSpecificType since returning thing - final static String positionTypeQuery = + final static String positionTypeQuery = "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingPositionType WHERE { \n" + + "SELECT ?existingPositionType WHERE { \n" + " ?position vitro:mostSpecificType ?existingPositionType . }"; - + final static String existingIntervalNodeQuery = - "SELECT ?existingIntervalNode WHERE { \n" + + "SELECT ?existingIntervalNode WHERE { \n" + " ?position <" + positionToInterval + "> ?existingIntervalNode . \n" + " ?existingIntervalNode a <" + intervalType + "> . }"; - - final static String existingStartNodeQuery = + + final static String existingStartNodeQuery = "SELECT ?existingStartNode WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + + " ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" + " ?existingStartNode a <" + dateTimeValueType + "> .} "; - - final static String existingEndNodeQuery = + + final static String existingEndNodeQuery = "SELECT ?existingEndNode WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + - " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + - " ?existingEndNode a <" + dateTimeValueType + "> } "; - - final static String existingStartPrecisionQuery = + " ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" + + " ?existingEndNode a <" + dateTimeValueType + "> } "; + + final static String existingStartPrecisionQuery = "SELECT ?existingStartPrecision WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToStart + "> ?startNode . \n" + - " ?startNode a <" + dateTimeValueType + "> . \n" + + " ?startNode a <" + dateTimeValueType + "> . \n" + " ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }"; - - final static String existingEndPrecisionQuery = + + final static String existingEndPrecisionQuery = "SELECT ?existingEndPrecision WHERE { \n" + " ?position <" + positionToInterval + "> ?intervalNode . \n" + " ?intervalNode a <" + intervalType + "> . \n" + " ?intervalNode <" + intervalToEnd + "> ?endNode . \n" + - " ?endNode a <" + dateTimeValueType + "> . \n" + + " ?endNode a <" + dateTimeValueType + "> . \n" + " ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }"; - + //Adding form specific data such as edit mode public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPreferredTitleGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPreferredTitleGenerator.java index ccc71551..131c8ff9 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPreferredTitleGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasPreferredTitleGenerator.java @@ -21,64 +21,64 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class PersonHasPreferredTitleGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(PersonHasPreferredTitleGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - String titleUri = getTitleUri(vreq); - + initObjectPropForm(conf, vreq); + String titleUri = getTitleUri(vreq); + conf.setTemplate("personHasPreferredTitle.ftl"); - + conf.setVarNameForSubject("person"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("individualVcard"); - + conf.setN3Required( Arrays.asList( n3ForNewPhone ) ); conf.setN3Optional( Arrays.asList( preferredTitleAssertion ) ); - + conf.addNewResource("title", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setLiteralsOnForm(Arrays.asList("preferredTitle" )); - + conf.addSparqlForExistingLiteral("preferredTitle", preferredTitleQuery); conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); - + if ( conf.isUpdate() ) { HashMap> urisInScope = new HashMap>(); urisInScope.put("title", Arrays.asList(new String[]{titleUri})); conf.addUrisInScope(urisInScope); } - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("preferredTitle") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - + conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewPhone = + final static String n3ForNewPhone = "?person ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?person . \n" + "?individualVcard ?title . \n" + - "?title a . " ; - - final static String preferredTitleAssertion = + "?title a . " ; + + final static String preferredTitleAssertion = "?title ?preferredTitle ."; - + /* Queries for editing an existing entry */ final static String individualVcardQuery = @@ -86,13 +86,13 @@ public class PersonHasPreferredTitleGenerator extends VivoBaseGenerator implemen "?person ?existingIndividualVcard . \n" + "}"; - final static String preferredTitleQuery = + final static String preferredTitleQuery = "SELECT ?existingPreferredTitle WHERE {\n"+ "?title ?existingPreferredTitle . }"; private String getTitleUri(VitroRequest vreq) { - String titleUri = vreq.getParameter("titleUri"); - + String titleUri = vreq.getParameter("titleUri"); + return titleUri; } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java index c0f7e785..83d03a55 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java @@ -18,48 +18,48 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; -public class ProjectHasParticipantGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ +public class ProjectHasParticipantGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ //TODO: can we get rid of the session and get it form the vreq? public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - + initObjectPropForm(conf, vreq); + conf.setTemplate("projectHasParticipant.ftl"); - + conf.setVarNameForSubject("project"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("projectRole"); - + conf.setN3Required( Arrays.asList( n3ForNewProjectRole ) ); conf.setN3Optional(Arrays.asList( n3ForNewPerson, n3ForExistingPerson, firstNameAssertion, lastNameAssertion ) ); - + conf.addNewResource("projectRole", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("newPerson",DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardPerson", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); - - //uris in scope: none + + //uris in scope: none //literals in scope: none - + conf.setUrisOnform( Arrays.asList( "existingPerson")); - conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "roleLabel", + conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "roleLabel", "roleLabeldisplay", "firstName", "lastName")); conf.addSparqlForExistingLiteral("personLabel", personLabelQuery); conf.addSparqlForExistingLiteral("roleLabel", roleLabelQuery); conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); - + conf.addField( new FieldVTwo(). setName("existingPerson") - //options will be added in browser by auto complete JS - ); - + //options will be added in browser by auto complete JS + ); + conf.addField( new FieldVTwo(). setName("personLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -69,7 +69,7 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement setName("roleLabel"). setRangeDatatypeUri(XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString(),"nonempty"))); - + conf.addField( new FieldVTwo(). setName("personLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() )); @@ -77,7 +77,7 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement conf.addField( new FieldVTwo(). setName("roleLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() )); - + conf.addField( new FieldVTwo(). setName("firstName"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -93,16 +93,16 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement //Add validator conf.addValidator(new AntiXssValidation()); conf.addValidator(new FirstAndLastNameValidator("existingPerson")); - + //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); prepare(vreq, conf); return conf; } - + /* N3 assertions for working with educational training */ - - final static String n3ForNewProjectRole = + + final static String n3ForNewProjectRole = "@prefix core: <"+ vivoCore +"> .\n" + "@prefix rdfs: <"+ rdfs +"> . \n"+ "?project ?projectRole .\n" + @@ -110,42 +110,42 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement "?projectRole ?project . \n" + "?projectRole <"+ label +"> ?roleLabel . \n" ; - final static String n3ForNewPerson = + final static String n3ForNewPerson = "?projectRole ?newPerson . \n" + "?newPerson ?projectRole . \n" + "?newPerson a . \n" + "?newPerson <"+ label +"> ?personLabel . "; - final static String n3ForExistingPerson = + final static String n3ForExistingPerson = "?projectRole ?existingPerson . \n" + "?existingPerson ?projectRole . \n" + " "; - - final static String firstNameAssertion = + + final static String firstNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:givenName ?firstName ."; - - final static String lastNameAssertion = + + final static String lastNameAssertion = "@prefix vcard: . \n" + "?newPerson ?vcardPerson . \n" + "?vcardPerson ?newPerson . \n" + - "?vcardPerson a . \n" + + "?vcardPerson a . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" + - "?vcardName a . \n" + + "?vcardName a . \n" + "?vcardName vcard:familyName ?lastName ."; /* Queries for editing an existing educational training entry */ - final static String roleLabelQuery = + final static String roleLabelQuery = "SELECT ?roleLabel WHERE {\n"+ "?projectRole <"+ label +"> ?roleLabel }\n"; - final static String existingPersonQuery = + final static String existingPersonQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPerson WHERE {\n"+ "?projectRole ?existingPerson . \n" + @@ -153,7 +153,7 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement "?existingPerson a . \n " + " }"; - final static String personLabelQuery = + final static String personLabelQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPersonLabel WHERE {\n"+ "?projectRole ?existingPerson . \n" + @@ -162,14 +162,14 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement "?existingPerson a . \n " + " }"; - + //Adding form specific data such as edit mode public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); editConfiguration.setFormSpecificData(formSpecificData); } - + public EditMode getEditMode(VitroRequest vreq) { List predicates = new ArrayList(); predicates.add("http://purl.obolibrary.org/obo/RO_0000053"); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasMailingAddressGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasMailingAddressGenerator.java index 93d33a31..a36f630f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasMailingAddressGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasMailingAddressGenerator.java @@ -21,42 +21,42 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class SubjectHasMailingAddressGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(SubjectHasMailingAddressGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - String addressUri = vreq.getParameter("addressUri"); - + initObjectPropForm(conf, vreq); + String addressUri = vreq.getParameter("addressUri"); + conf.setTemplate("subjectHasMailingAddress.ftl"); - + conf.setVarNameForSubject("subject"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("individualVcard"); - + conf.setN3Required( Arrays.asList( n3ForNewAddress ) ); - conf.setN3Optional( Arrays.asList( streetAddressAssertion, - localityAssertion, - regionAssertion, - countryAssertion, + conf.setN3Optional( Arrays.asList( streetAddressAssertion, + localityAssertion, + regionAssertion, + countryAssertion, postalCodeAssertion ) ); - + conf.addNewResource("address", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setLiteralsOnForm(Arrays.asList("streetAddress", "locality", "postalCode", "country", "region" )); - + conf.addSparqlForExistingLiteral("streetAddress", streetAddressQuery); conf.addSparqlForExistingLiteral("locality", localityQuery); conf.addSparqlForExistingLiteral("postalCode", postalCodeQuery); conf.addSparqlForExistingLiteral("region", regionQuery); - conf.addSparqlForExistingLiteral("country", countryQuery); - + conf.addSparqlForExistingLiteral("country", countryQuery); + if ( conf.isUpdate() ) { HashMap> urisInScope = new HashMap>(); urisInScope.put("address", Arrays.asList(new String[]{addressUri})); @@ -66,58 +66,58 @@ public class SubjectHasMailingAddressGenerator extends VivoBaseGenerator impleme conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); } - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("streetAddress") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - - conf.addField( new FieldVTwo(). + + conf.addField( new FieldVTwo(). setName("country") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("postalCode") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("locality") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") ) ); - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("region") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("datatype:" + XSD.xstring.toString()) ) ); conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewAddress = + final static String n3ForNewAddress = "?subject ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?subject . \n" + "?individualVcard ?address . \n" + - "?address a . " ; - - final static String streetAddressAssertion = + "?address a . " ; + + final static String streetAddressAssertion = "?address ?streetAddress ."; - - final static String localityAssertion = + + final static String localityAssertion = "?address ?locality ."; - final static String postalCodeAssertion = - "?address ?postalCode ."; - - final static String regionAssertion = - "?address ?region ."; - + final static String postalCodeAssertion = + "?address ?postalCode ."; + + final static String regionAssertion = + "?address ?region ."; + final static String countryAssertion = "?address ?country ."; @@ -129,23 +129,23 @@ public class SubjectHasMailingAddressGenerator extends VivoBaseGenerator impleme "?subject ?individualVcard . \n" + "}"; - final static String streetAddressQuery = + final static String streetAddressQuery = "SELECT ?existingStreetAddress WHERE {\n"+ "?address ?existingStreetAddress . }"; - final static String localityQuery = + final static String localityQuery = "SELECT ?existingLocality WHERE {\n"+ "?address ?existingLocality . }"; - final static String regionQuery = + final static String regionQuery = "SELECT ?existingRegion WHERE {\n"+ "?address ?existingRegion . }"; - final static String postalCodeQuery = + final static String postalCodeQuery = "SELECT ?existingPostalCode WHERE {\n"+ "?address ?existingPostalCode . }"; - final static String countryQuery = + final static String countryQuery = "SELECT ?existingCountry WHERE {\n"+ "?address ?existingCountry . }"; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasPhoneFaxNumberGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasPhoneFaxNumberGenerator.java index a0953454..2744d8da 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasPhoneFaxNumberGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/SubjectHasPhoneFaxNumberGenerator.java @@ -25,27 +25,27 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. public class SubjectHasPhoneFaxNumberGenerator extends VivoBaseGenerator implements EditConfigurationGenerator { private Log log = LogFactory.getLog(SubjectHasPhoneFaxNumberGenerator.class); - + @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - + EditConfigurationVTwo conf = new EditConfigurationVTwo(); Model model = ModelFactory.createDefaultModel(); - + initBasics(conf, vreq); initPropertyParameters(vreq, session, conf); - initObjectPropForm(conf, vreq); - String phoneUri = getPhoneUri(vreq); + initObjectPropForm(conf, vreq); + String phoneUri = getPhoneUri(vreq); String rangeUri = getRangeUri(vreq); - Literal numberType = null; - + Literal numberType = null; + conf.setTemplate("subjectHasPhoneFaxNumber.ftl"); - + conf.setVarNameForSubject("subject"); conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("individualVcard"); - + if ( rangeUri.equals("http://www.w3.org/2006/vcard/ns#Fax") ) { conf.setN3Required( Arrays.asList( n3ForNewFaxNumber ) ); numberType = model.createLiteral("fax"); @@ -56,15 +56,15 @@ public class SubjectHasPhoneFaxNumberGenerator extends VivoBaseGenerator impleme } conf.setN3Optional( Arrays.asList( telephoneNumberAssertion ) ); - + conf.addNewResource("phone", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); - + conf.setLiteralsOnForm(Arrays.asList("telephoneNumber" )); - + conf.addSparqlForExistingLiteral("telephoneNumber", telephoneNumberQuery); conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); - + conf.addLiteralInScope("numberType", numberType); if ( conf.isUpdate() ) { @@ -73,37 +73,37 @@ public class SubjectHasPhoneFaxNumberGenerator extends VivoBaseGenerator impleme conf.addUrisInScope(urisInScope); } - conf.addField( new FieldVTwo(). + conf.addField( new FieldVTwo(). setName("telephoneNumber") .setRangeDatatypeUri( XSD.xstring.toString() ). setValidators( list("nonempty") )); - + conf.addValidator(new AntiXssValidation()); - + prepare(vreq, conf); return conf; } /* N3 assertions */ - final static String n3ForNewPhoneNumber = + final static String n3ForNewPhoneNumber = "?subject ?individualVcard . \n" + - "?individualVcard a . \n" + + "?individualVcard a . \n" + "?individualVcard ?subject . \n" + "?individualVcard ?phone . \n" + - "?phone a . " ; - - final static String n3ForNewFaxNumber = - "?subject ?individualVcard . \n" + - "?individualVcard a . \n" + - "?individualVcard ?subject . \n" + - "?individualVcard ?phone . \n" + - "?phone a . \n " + - "?phone a . " ; + "?phone a . " ; - final static String telephoneNumberAssertion = + final static String n3ForNewFaxNumber = + "?subject ?individualVcard . \n" + + "?individualVcard a . \n" + + "?individualVcard ?subject . \n" + + "?individualVcard ?phone . \n" + + "?phone a . \n " + + "?phone a . " ; + + final static String telephoneNumberAssertion = "?phone ?telephoneNumber ."; - + /* Queries for editing an existing entry */ final static String individualVcardQuery = @@ -111,19 +111,19 @@ public class SubjectHasPhoneFaxNumberGenerator extends VivoBaseGenerator impleme "?subject ?existingIndividualVcard . \n" + "}"; - final static String telephoneNumberQuery = + final static String telephoneNumberQuery = "SELECT ?existingTelephoneNumber WHERE {\n"+ "?phone ?existingTelephoneNumber . }"; private String getPhoneUri(VitroRequest vreq) { - String phoneUri = vreq.getParameter("phoneUri"); - + String phoneUri = vreq.getParameter("phoneUri"); + return phoneUri; } private String getRangeUri(VitroRequest vreq) { - String rangeUri = vreq.getParameter("rangeUri"); - + String rangeUri = vreq.getParameter("rangeUri"); + return rangeUri; } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVODefaultAddMissingIndividualFormGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVODefaultAddMissingIndividualFormGenerator.java index 711d877c..e8783690 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVODefaultAddMissingIndividualFormGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVODefaultAddMissingIndividualFormGenerator.java @@ -22,7 +22,7 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; * */ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMissingIndividualFormGenerator { - + private Log log = LogFactory.getLog(VIVODefaultAddMissingIndividualFormGenerator.class); protected Map generateNewResources(VitroRequest vreq) { @@ -37,11 +37,11 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss prefixStrings.add("@prefix vcard: ."); return prefixStrings; } - + protected String getN3ForName() { return "?" + objectVarName + " rdfs:label ?label ."; } - + protected List generateN3Optional(VitroRequest vreq) { List n3Optional = super.generateN3Optional(vreq); n3Optional.add(getN3PrefixesAsString() @@ -52,7 +52,7 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss + " ?newVcardName a vcard:Name . \n" + " ?newVcardName vcard:givenName ?firstName . \n" + " ?newVcardName vcard:familyName ?lastName . \n"); - n3Optional.add(getN3PrefixesAsString() + n3Optional.add(getN3PrefixesAsString() + "?" + objectVarName + " ?newVcardInd . \n" + " ?newVcardInd a vcard:Individual . \n" + " ?newVcardInd vcard:hasName ?newVcardName . \n" @@ -75,39 +75,39 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss protected void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) { Map fields = new HashMap(); if(EditConfigurationUtils.isObjectProperty(EditConfigurationUtils.getPredicateUri(vreq), vreq)) { - + //make name field FieldVTwo labelField = new FieldVTwo(); - labelField.setName("label"); - + labelField.setName("label"); + FieldVTwo firstNameField = new FieldVTwo(); - firstNameField.setName("firstName"); - + firstNameField.setName("firstName"); + FieldVTwo middleNameField = new FieldVTwo(); - middleNameField.setName("middleName"); - + middleNameField.setName("middleName"); + FieldVTwo lastNameField = new FieldVTwo(); - lastNameField.setName("lastName"); - + lastNameField.setName("lastName"); + List validators = new ArrayList(); validators.add("nonempty"); - if(!isPersonType(vreq)) { - labelField.setValidators(validators); + if(!isPersonType(vreq)) { + labelField.setValidators(validators); } - if(isPersonType(vreq)) { - firstNameField.setValidators(validators); - lastNameField.setValidators(validators); + if(isPersonType(vreq)) { + firstNameField.setValidators(validators); + lastNameField.setValidators(validators); } - + fields.put(labelField.getName(), labelField); fields.put(firstNameField.getName(), firstNameField); fields.put(middleNameField.getName(), middleNameField); fields.put(lastNameField.getName(), lastNameField); - + } else { log.error("Is not object property so fields not set"); } - + editConfiguration.setFields(fields); } @@ -131,11 +131,11 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss VClass type = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(typeOfNew); return type.getName(); } - + public String getFOAFPersonClassURI() { return "http://xmlns.com/foaf/0.1/Person"; } - + public boolean isPersonType(VitroRequest vreq) { WebappDaoFactory wdf = vreq.getWebappDaoFactory(); Boolean isPersonType = Boolean.FALSE; @@ -150,7 +150,7 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss isPersonType = Boolean.TRUE; break; } - } + } } return isPersonType; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVOManageLabelsGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVOManageLabelsGenerator.java index df952439..e70b1cdb 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVOManageLabelsGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVOManageLabelsGenerator.java @@ -15,7 +15,7 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUti import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; /** - *This generator selects the actual generator to be employed based on whether the individual is a Person + *This generator selects the actual generator to be employed based on whether the individual is a Person *or another individual. Adding a label for a person relies on first/name last name information i.e. object properties. */ public class VIVOManageLabelsGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { @@ -30,14 +30,14 @@ public class VIVOManageLabelsGenerator extends BaseEditConfigurationGenerator im } else { //Non-Person individuals e = new ManageLabelsForIndividualGenerator().getEditConfiguration(vreq, session); - + } - + return e; - + } - - + + public boolean isPersonType(String subjectUri, VitroRequest vreq) { Boolean isPersonType = Boolean.FALSE; String foafPersonType = getFOAFPersonClassURI(); @@ -49,17 +49,17 @@ public class VIVOManageLabelsGenerator extends BaseEditConfigurationGenerator im isPersonType = Boolean.TRUE; break; } - } + } } return isPersonType; } - + //Copied from NewIndividualFormGenerator //TODO: Refactor so common code can be used by both generators public String getFOAFPersonClassURI() { return "http://xmlns.com/foaf/0.1/Person"; } - + //how to get the type of the individual in question public List getVClasses(String subjectUri, VitroRequest vreq) { Individual subject = EditConfigurationUtils.getIndividual(vreq, subjectUri); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVONewIndividualFormGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVONewIndividualFormGenerator.java index 3a4f9372..eee13bcb 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVONewIndividualFormGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VIVONewIndividualFormGenerator.java @@ -24,22 +24,22 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators. /** * Generates the edit configuration for a default property form. - * ModelChangePreprocessor creates the rdfs:label statement. + * ModelChangePreprocessor creates the rdfs:label statement. */ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { @Override public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) { - + EditConfigurationVTwo config = new EditConfigurationVTwo(); - + config.setTemplate( "newIndividualForm.ftl" ); - + config.setN3Required( list( "?newInd <" + VitroVocabulary.RDF_TYPE + "> <" + getTypeOfNew(vreq) + "> ." - )); + )); //Optional because user may have selected either person or individual of another kind - //Person uses first name and last name whereas individual of other class would use label + //Person uses first name and last name whereas individual of other class would use label //middle name is also optional config.setN3Optional(list( N3_PREFIX + "@prefix vcard: .\n" @@ -58,55 +58,55 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat + " ?newVcardName a vcard:Name . \n" + " ?newVcardName ?middleName ." )); - + config.addNewResource("newInd", vreq.getWebappDaoFactory().getDefaultNamespace()); config.addNewResource("newVcardInd", vreq.getWebappDaoFactory().getDefaultNamespace()); config.addNewResource("newVcardName", vreq.getWebappDaoFactory().getDefaultNamespace()); - + config.setUrisOnform(list ()); - config.setLiteralsOnForm( list( "label", "firstName", "lastName", "middleName" )); + config.setLiteralsOnForm( list( "label", "firstName", "lastName", "middleName" )); setUrisAndLiteralsInScope(config); - //No SPARQL queries for existing since this is only used to create new, never for edit - + //No SPARQL queries for existing since this is only used to create new, never for edit + config.addField(new FieldVTwo(). setName("firstName"). setRangeDatatypeUri(XSD.xstring.getURI()). setValidators(getFirstNameValidators(vreq))); - + config.addField(new FieldVTwo(). setName("middleName"). setRangeDatatypeUri(XSD.xstring.getURI()). setValidators(getMiddleNameValidators(vreq))); - + config.addField(new FieldVTwo(). setName("lastName"). setRangeDatatypeUri(XSD.xstring.getURI()). - setValidators(getLastNameValidators(vreq))); - + setValidators(getLastNameValidators(vreq))); + config.addField(new FieldVTwo(). setName("label"). setRangeDatatypeUri(XSD.xstring.getURI()). - setValidators(getLabelValidators(vreq))); - - addFormSpecificData(config, vreq); - + setValidators(getLabelValidators(vreq))); + + addFormSpecificData(config, vreq); + config.addValidator(new AntiXssValidation()); - + //This combines the first and last name into the rdfs:label // currently being done via javascript in the template. May use this again // when/if updated to ISF ontology. tlw72 -// config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor()); +// config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor()); - String formUrl = EditConfigurationUtils.getFormUrlWithoutContext(vreq); + String formUrl = EditConfigurationUtils.getFormUrlWithoutContext(vreq); config.setFormUrl(formUrl); - + //Note, the spaces are important - they were added by ProcessRdfFormController earlier //as a means of ensuring the substitution worked correctly - as the regex expects spaces config.setEntityToReturnTo(" ?newInd "); prepare(vreq, config); return config; } - + private List getMiddleNameValidators(VitroRequest vreq) { List validators = new ArrayList(); return validators; @@ -144,9 +144,9 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat if( typeUri == null || typeUri.trim().isEmpty() ) return getFOAFPersonClassURI(); else - return typeUri; + return typeUri; } - + //Form specific data public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { HashMap formSpecificData = new HashMap(); @@ -167,11 +167,11 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat VClass type = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(typeOfNew); return type.getName(); } - + public String getFOAFPersonClassURI() { return "http://xmlns.com/foaf/0.1/Person"; } - + public boolean isPersonType(VitroRequest vreq) { WebappDaoFactory wdf = vreq.getWebappDaoFactory(); Boolean isPersonType = Boolean.FALSE; @@ -186,22 +186,22 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat isPersonType = Boolean.TRUE; break; } - } + } } return isPersonType; } private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration) { HashMap> urisInScope = new HashMap>(); //note that at this point the subject, predicate, and object var parameters have already been processed - urisInScope.put(editConfiguration.getVarNameForSubject(), + urisInScope.put(editConfiguration.getVarNameForSubject(), Arrays.asList(new String[]{editConfiguration.getSubjectUri()})); - urisInScope.put(editConfiguration.getVarNameForPredicate(), + urisInScope.put(editConfiguration.getVarNameForPredicate(), Arrays.asList(new String[]{editConfiguration.getPredicateUri()})); editConfiguration.setUrisInScope(urisInScope); //Uris in scope include subject, predicate, and object var - + editConfiguration.setLiteralsInScope(new HashMap>()); } - + private String N3_PREFIX = "@prefix foaf: .\n"; } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VivoBaseGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VivoBaseGenerator.java index 2ea0413d..220f18db 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VivoBaseGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/VivoBaseGenerator.java @@ -5,7 +5,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; /** * Adds static Strings that may be useful for forms that are part of VIVO. - * + * * @author bdc34 * */ @@ -14,18 +14,18 @@ public abstract class VivoBaseGenerator extends BaseEditConfigurationGenerator i final static String vivoCore ="http://vivoweb.org/ontology/core#" ; final static String rdfs =VitroVocabulary.RDFS ; final static String foaf = "http://xmlns.com/foaf/0.1/"; - final static String type =VitroVocabulary.RDF_TYPE ; + final static String type =VitroVocabulary.RDF_TYPE ; final static String label =rdfs+"label" ; final static String bibo = "http://purl.org/ontology/bibo/"; - - final static String edProcessClass = vivoCore+"EducationalProcess" ; - final static String degreeTypeClass =vivoCore+"AcademicDegree" ; + + final static String edProcessClass = vivoCore+"EducationalProcess" ; + final static String degreeTypeClass =vivoCore+"AcademicDegree" ; final static String majorFieldPred =vivoCore+"majorField" ; final static String deptPred =vivoCore+"departmentOrSchool" ; final static String infoPred =vivoCore+"supplementalInformation" ; final static String authorRankPredicate = vivoCore + "authorRank"; final static String linkedAuthorPredicate = vivoCore + "relates"; - + final static String dateTimeValue =vivoCore+"dateTime"; final static String dateTimeValueType =vivoCore+"DateTimeValue"; final static String dateTimePrecision =vivoCore+"dateTimePrecision"; @@ -37,5 +37,5 @@ public abstract class VivoBaseGenerator extends BaseEditConfigurationGenerator i final static String orgClass ="http://xmlns.com/foaf/0.1/Organization" ; final static String personClass = foaf + "Person"; - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/AddAssociatedConceptsPreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/AddAssociatedConceptsPreprocessor.java index 856de69c..82792291 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/AddAssociatedConceptsPreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/AddAssociatedConceptsPreprocessor.java @@ -1,875 +1,875 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.jena.ontology.OntModel; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.OWL; -import org.apache.jena.vocabulary.RDF; -import org.apache.jena.vocabulary.RDFS; -import org.apache.jena.vocabulary.XSD; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.BaseEditSubmissionPreprocessorVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; -import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; -import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; - -public class AddAssociatedConceptsPreprocessor extends - BaseEditSubmissionPreprocessorVTwo { - - protected static final Log log = LogFactory - .getLog(AddAssociatedConceptsPreprocessor.class.getName()); - protected OntModel ontModel = null; - protected WebappDaoFactory wdf = null; - // Field names/variables names for n3 - these will have numbers added as - // suffix if more than one term - private static String conceptNodeBase = "conceptNode"; - private static String sourceBase = "conceptSource"; - private static String labelBase = "conceptLabel"; - private static String conceptSemanticTypeLabelBase = "conceptSemanticTypeLabel"; - private static String conceptSemanticTypeURIBase = "conceptSemanticTypeURI"; - private static String conceptBroaderURIBase = "conceptBroaderURI"; - private static String conceptNarrowerURIBase = "conceptNarrowerURI"; - - //keyed off label variable, specifies which uri variable should be used, useful if same label repeated twice - private HashMap labelVarToUriVarHash = null; - private HashMap> conceptSemanticTypeURIVarToValueMap = null; - //Also storing submission values - private static String conceptNodeValues = null; - private static String conceptLabelValues = null; - private static String conceptSourceValues = null; - private static String conceptSemanticTypeLabelValues = null; - private static String conceptSemanticTypeURIValues = null; - private static List conceptBroaderURIValues = null; - private static List conceptNarrowerURIValues = null; - private static MultiValueEditSubmission submission = null; - - private static String SKOSBroaderURI = "http://www.w3.org/2004/02/skos/core#broader"; - private static String SKOSNarrowerURI = "http://www.w3.org/2004/02/skos/core#narrower"; - private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; - - // String datatype - - // Will be editing the edit configuration as well as edit submission here - - public AddAssociatedConceptsPreprocessor(EditConfigurationVTwo editConfig) { - super(editConfig); - this.labelVarToUriVarHash = new HashMap(); - //Saves values of concept type uris - this.conceptSemanticTypeURIVarToValueMap = new HashMap>(); - } - - public void preprocess(MultiValueEditSubmission inputSubmission, VitroRequest vreq) { - submission = inputSubmission; - this.wdf = vreq.getWebappDaoFactory(); - this.ontModel = ModelAccess.on(vreq).getOntModel(); - //Set the models that we need here - // Get the input elements for concept node and concept label as well - // as vocab uri (which is based on thge - // For query parameters, check whether CUI - copySubmissionValues(); - - - if (conceptNodeValues != null) { - String[] conceptNodes = convertDelimitedStringToArray(conceptNodeValues); - int numberConcepts = conceptNodes.length; - //This will put the URI value in scope for the first semantic type label - //and generate the rest if need be - processConceptSemanticValues(); - //Also need to see if any broader or narrower uris for the concepts that already exist in the system - //and set up the appropriate relationships between this concept and the broader/narrower uri - getExistingConceptRelationships(); - if (numberConcepts > 1) { - processConceptNodes(numberConcepts); - } - - } else { - log.error("No concept nodes were added from the service"); - } - - } - - - - //Since we will change the uris and literals from form, we should make copies - //of the original values and store them, this will also make iterations - //and updates to the submission independent from accessing the values - private void copySubmissionValues() { - conceptLabelValues = getConceptLabelValues(); - conceptNodeValues = getConceptNodeValues(); - conceptSourceValues = getConceptSourceValues(); - conceptBroaderURIValues = getConceptBroaderURIValues(); - conceptNarrowerURIValues = getConceptNarrowerURIValues(); - log.debug("concept label values are " + conceptLabelValues); - - } - - - //For broader and narrower relationships, we will be - //linking the concept to broader and narrower terms where those terms already - //exist in the system - //This method or approach may change later in which case this method should change - private void getExistingConceptRelationships() { - List existingNarrowerURIs = getExistingNarrowerURIs(conceptNarrowerURIValues); - List existingBroaderURIs = getExistingBroaderURIs(conceptBroaderURIValues); - //Now set the submission values to these, overwriting the original - Map> urisFromForm = submission.getUrisFromForm(); - if(existingNarrowerURIs.size() > 0) { - urisFromForm.put("conceptNarrowerURI", existingNarrowerURIs); - } else { - //The original code for submission wouldn't put in a key if the values were null or size 0 - urisFromForm.remove("conceptNarrowerURI"); - } - //Set the copied values to this value as well so when if there are multiple - //concepts, the inputs get copied correctly for each of them - this.conceptNarrowerURIValues = existingNarrowerURIs; - if(existingBroaderURIs.size() > 0) { - urisFromForm.put("conceptBroaderURI", existingBroaderURIs); - } else { - urisFromForm.remove("conceptBroaderURI"); - } - this.conceptBroaderURIValues = existingBroaderURIs; - } - - //get the broader and narrower uri values that already exist in the system from the ones returned in the search - //and use those to populate relationships between the concept and other concepts already in the system - //We should also make sure to use bidirectional n3 so the graph has both sets of relationships represented - private List getConceptNarrowerURIValues() { - return this.getJSONFormURIValues("conceptNarrowerURI"); - } - - private List getConceptBroaderURIValues() { - return this.getJSONFormURIValues("conceptBroaderURI"); - } - - private List getJSONFormURIValues(String varName) { - Map> urisFromForm = submission.getUrisFromForm(); - List uris = urisFromForm.get(varName); - //This should be a JSON object stringified - if(uris.size() > 0) { - String jsonString = uris.get(0); - if(jsonString != null && !jsonString.isEmpty()) { - JsonNode json = JacksonUtils.parseJson(jsonString); - //This should be an array - if(json.isArray()) { - ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(jsonString); - //Convert to list of strings - return convertJsonArrayToList(jsonArray); - } - } - } - return uris; - } - - private List convertJsonArrayToList(ArrayNode jsonArray) { - List stringList = new ArrayList(); - int len = jsonArray.size(); - int i = 0; - for(i = 0; i < len; i++) { - stringList.add(jsonArray.get(i).asText()); - } - return stringList; - } - - private List getExistingBroaderURIs(List broaderURIs) { - if(broaderURIs == null) { - return new ArrayList(); - } - List existingBroaderURIs = this.getExistingURIs(broaderURIs); - return existingBroaderURIs; - } - - private List getExistingNarrowerURIs(List narrowerURIs) { - if(narrowerURIs == null) - return new ArrayList(); - List existingNarrowerURIs = this.getExistingURIs(narrowerURIs); - return existingNarrowerURIs; - } - - //We need to keep the number of elements the same if there are any entries at all in the original - //So we will use an empty string or null - private List getExistingURIs(List uris) { - //Important to keep the same formatting as original, because a comma delimited string as an element in the array - //refers to a list of uris appropriate for a given concept, where each element in the array corresponds to a different - //concept - List existingURIs = new ArrayList(); - for(String uri:uris) { - if(uri.indexOf(",") != -1) { - List existingURISet = new ArrayList(); - String[] uriSet = uri.split(","); - for(String u: uriSet) { - if(u != null && !u.isEmpty() && this.wdf.hasExistingURI(u)) { - existingURISet.add(u); - } - } - //Now add the comma delimited version back to the array - if(existingURISet.size() > 0) { - existingURIs.add(StringUtils.join(existingURISet, ",")); - } else { - //add empty string to indicate no value here - existingURIs.add(""); - } - } else { - if(uri != null && !uri.isEmpty() && this.wdf.hasExistingURI(uri)) { - existingURIs.add(uri); - } - else - { - existingURIs.add(""); - } - - } - } - return existingURIs; - } - - - //Process the semantic type label and URI values for the concepts - private void processConceptSemanticValues() { - conceptSemanticTypeLabelValues = getConceptSemanticTypeLabelValues(); - conceptSemanticTypeURIValues = getConceptSemanticTypeURIValues(); - - //We are first going to handle the single value case and then handle additional values - //where the rest of the additional values are handled - - } - - - //This is for additional concept nodes (i.e. if user selects more than one concept) - private void processConceptNodes(int numberConcepts) { - //There are no "new" resources b/c the concept nodes are URIs from external vocabularies - //New resources for concept semantic type uris - addNewResources(numberConcepts); - // Add N3Required - addN3Required(numberConcepts); - //Add N3 Optional as well - addN3Optional(numberConcepts); - // Add URIs on Form and Add Literals On Form - addLiteralsAndUrisOnForm(numberConcepts); - // Add fields - addFields(numberConcepts); - //Add input values to submission - addInputsToSubmission(numberConcepts); - - } - - //This is specifically for concept semantic type URIs which may need to be generated - private void addNewResources(int numberConcepts) { - // TODO Auto-generated method stub - addConceptSemanticTypeURIResources(numberConcepts); - } - - private void addConceptSemanticTypeURIResources(int numberConcepts) { - //Iterate through the labels and get the corresponding uris - HashSet urisToAdd = new HashSet(); - String[] conceptSemanticTypeLabels= convertDelimitedStringToArray(conceptSemanticTypeLabelValues); - //the number of existing values may not match up, or at least existing populated ones - //Now we can't determine whether all concepts will have semantic types - at some point what if - //we ran a search across all external vocabularies? So we can't compare labels to number of concepts - //but we can ensure that it isn't greater than then number of concepts - if(conceptSemanticTypeLabels != null && conceptSemanticTypeLabels.length <= numberConcepts) { - int i; - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String conceptSemanticTypeLabelVar = conceptSemanticTypeLabelBase + suffix; - if(this.labelVarToUriVarHash.containsKey(conceptSemanticTypeLabelVar)) { - String newResourceName = this.labelVarToUriVarHash.get(conceptSemanticTypeLabelVar); - if(!urisToAdd.contains(newResourceName)) { - urisToAdd.add(newResourceName); - editConfiguration.addNewResource(newResourceName, null); - } - } - - } - } else if(conceptSemanticTypeLabels != null && conceptSemanticTypeLabels.length > numberConcepts){ - log.error("Number of concept semantic type labels is greater than number of concepts"); - } else{ - log.error("Concept semantic type labels returned are null"); - } - - } - - //This is where the actual values will be submitted as if they were separate input fields - //Each field name will correspond to the names of the fileds/uris on form/literals on form - //generated here - - private void addInputsToSubmission(int numberConcepts) { - //This will essentially manufacture a set of query parameters - //And will add the appropriate fields to the multivalue submission - addConceptNodeInputs(numberConcepts); - addConceptSourceInputs(numberConcepts); - addConceptLabelInputs(numberConcepts); - //for concept semantic type labels and uris where they exist - addConceptSemanticTypeLabelAndURIInputs(numberConcepts); - //For broader and narrower uris where they exist (this of course is in the case of multiple broader and narrower uris - addConceptBroaderURIInputs(numberConcepts); - addConceptNarrowerURIInputs(numberConcepts); - } - - private void addConceptNodeInputs(int numberConcepts) { - - String[] conceptNodes = convertDelimitedStringToArray(conceptNodeValues); - if(conceptNodes != null && conceptNodes.length == numberConcepts) { - int i; - //iterate through the concept nodes converted string array - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String conceptInputName = conceptNodeBase + suffix; - String[] nodeValues = new String[1]; - nodeValues[0] = conceptNodes[i]; - //Add value for uri to form - submission.addUriToForm(editConfiguration, conceptInputName, nodeValues); - } - } else if(conceptNodes != null && conceptNodes.length != numberConcepts){ - log.error("Number of concept nodes did not match the number of concepts to be added"); - } else{ - log.error("Concept nodes returned were null"); - } - - } - - private void addConceptSourceInputs(int numberConcepts) { - String[] conceptSources = convertDelimitedStringToArray(conceptSourceValues); - if(conceptSources != null && conceptSources.length == numberConcepts) { - int i; - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String conceptInputName = sourceBase + suffix; - String[] sourceValues = new String[1]; - sourceValues[0] = conceptSources[i]; - //Add value for uri to form - submission.addUriToForm(editConfiguration, conceptInputName, sourceValues); - } - } else if(conceptSources != null && conceptSources.length != numberConcepts){ - log.error("Number of concept nodes did not match the number of concepts to be added"); - } else{ - log.error("Concept nodes returned were null"); - } - } - - private void addConceptLabelInputs(int numberConcepts) { - String[] labels = convertDelimitedStringToArray(conceptLabelValues); - if(labels != null && labels.length == numberConcepts) { - int i; - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String labelInputName = labelBase + suffix; - String[] labelValues = new String[1]; - labelValues[0] = labels[i]; - //TODO: Check if there are no funky typed information also stored - //At this point the field should already have been added to edit configuration - FieldVTwo labelField = editConfiguration.getField(labelInputName); - if(labelField != null) { - submission.addLiteralToForm(editConfiguration, labelField, labelInputName, labelValues); - } else { - log.error("Corresponding field for " + labelInputName + " was not added to edit configuration"); - } - - } - } else if(labels != null && labels.length != numberConcepts){ - log.error("Number of concept labels did not match the number of concepts to be added"); - } else{ - log.error("Concept labels returned were null"); - } - } - - private void addConceptSemanticTypeLabelAndURIInputs(int numberConcepts) { - String[] labels = convertDelimitedStringToArray(conceptSemanticTypeLabelValues); - HashSet uniqueLabelValues = new HashSet(); - if(labels != null && labels.length == numberConcepts) { - int i; - for(i = 0; i < numberConcepts; i++) { - String thisLabel = labels[i]; - int suffix = i + 1; - String labelInputName = conceptSemanticTypeLabelBase + suffix; - String[] labelValues = new String[1]; - labelValues[0] = thisLabel; - //TODO: Check if there are no funky typed information also stored - //At this point the field should already have been added to edit configuration - FieldVTwo labelField = editConfiguration.getField(labelInputName); - //TODO: Also check to see whether the label is actually populate or will n3 editing take care of that? - if(labelField != null) { - submission.addLiteralToForm(editConfiguration, labelField, labelInputName, labelValues); - //Associate URI - if(!uniqueLabelValues.contains(thisLabel)) { - uniqueLabelValues.add(thisLabel); - this.addConceptSemanticTypeURIInputForLabel(labelInputName, suffix); - } - } else { - log.error("Corresponding field for " + labelInputName + " was not added to edit configuration"); - } - - } - } else if(labels != null && labels.length != numberConcepts){ - log.error("Number of concept semantic type labels did not match the number of concepts to be added"); - } else{ - log.error("Concept labels returned were null"); - } - } - - private void addConceptSemanticTypeURIInputForLabel(String conceptSemanticTypeLabel, int suffix) { - //String[] conceptSemanticTypeURIs= convertDelimitedStringToArray(conceptSemanticTypeURIValues); - - //Get the semantic type URI variable name associated with this label - String uriInputName = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); - //List<> - if(this.conceptSemanticTypeURIVarToValueMap.containsKey(uriInputName)) { - List uriVals = this.conceptSemanticTypeURIVarToValueMap.get(uriInputName); - String[] uriValuesArray = uriVals.toArray(new String[uriVals.size()]); - submission.addUriToForm(editConfiguration, uriInputName, uriValuesArray); - } - } - - private void addConceptBroaderURIInputs(int numberConcepts) { - int i; - //Add inputs based on if there are any broader uris to add - //Can't really compare number of existing broader uris to concepts - //as each concept may or may not have a broader uri - if(this.conceptBroaderURIValues.size() > 0 && this.conceptBroaderURIValues.size() <= numberConcepts) { - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String conceptBroaderURIInputName = conceptBroaderURIBase + suffix; - String broaderURIs = this.conceptBroaderURIValues.get(i); - if(broaderURIs != null && !broaderURIs.isEmpty()) { - String[] broaderURISet = new String[1]; - if(broaderURIs.indexOf(",") != -1) { - broaderURISet = broaderURIs.split(","); - } else { - broaderURISet[0] = broaderURIs; - } - //Add value for uri to form - submission.addUriToForm(editConfiguration, conceptBroaderURIInputName, broaderURISet); - } - } - } - - } - private void addConceptNarrowerURIInputs(int numberConcepts) { - int i; - if(this.conceptNarrowerURIValues.size() > 0 && this.conceptNarrowerURIValues.size() <= numberConcepts) { - for(i = 0; i < numberConcepts; i++) { - int suffix = i + 1; - String conceptNarrowerURIInputName = conceptNarrowerURIBase + suffix; - String narrowerURIs = this.conceptNarrowerURIValues.get(i); - if(narrowerURIs != null && !narrowerURIs.isEmpty()) { - String[] narrowerURISet = new String[1]; - if(narrowerURIs.indexOf(",") != -1) { - narrowerURISet = narrowerURIs.split(","); - } else { - narrowerURISet[0] = narrowerURIs; - } - //Add value for uri to form - submission.addUriToForm(editConfiguration, conceptNarrowerURIInputName, narrowerURISet); - } - } - } - } - - //Fields - - private void addFields(int numberConcepts) { - //Clear out all fields in edit configuration first - editConfiguration.setFields(new HashMap()); - int index; - HashSet conceptSemanticTypeUris = new HashSet(); - // First one already included in generator so add additional ones here - for (index = 1; index <= numberConcepts; index++) { - int suffix = index; - String conceptNode = conceptNodeBase + suffix; - String label = labelBase + suffix; - String source = sourceBase + suffix; - String conceptSemanticTypeLabel = conceptSemanticTypeLabelBase + suffix; - String conceptSemanticTypeURI = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); - String conceptBroaderURI = conceptBroaderURIBase + suffix; - String conceptNarrowerURI = conceptNarrowerURIBase + suffix; - addConceptNodeField(conceptNode); - addLabelField(label); - addSourceField(source); - //Also add fields for concept semantic type label - addConceptSemanticTypeLabelField(conceptSemanticTypeLabel); - //and concept semantic type URI - if(!conceptSemanticTypeUris.contains(conceptSemanticTypeURI)) { - conceptSemanticTypeUris.add(conceptSemanticTypeURI); - addConceptSemanticTypeURIField(conceptSemanticTypeURI); - } - - //add fields for concept broader and narrower uris - addConceptBroaderURIField(conceptBroaderURI); - addConceptNarrowerURIField(conceptNarrowerURI); - } - } - - - - private void addConceptNodeField(String conceptNode) { - List validators = new ArrayList(); - validators.add("nonempty"); - editConfiguration.addField(new FieldVTwo(). - setName(conceptNode). - setValidators(validators)); - } - - private void addLabelField(String label) { - editConfiguration.addField(new FieldVTwo(). - setName(label). - setRangeDatatypeUri(XSD.xstring.toString()) - ); - - } - - private void addSourceField(String source) { - editConfiguration.addField(new FieldVTwo(). - setName(source)); - - } - - //TODO: Do we need to check if label is empty string? - private void addConceptSemanticTypeLabelField(String label) { - if(label != null) { - editConfiguration.addField(new FieldVTwo(). - setName(label). - setRangeDatatypeUri(XSD.xstring.toString()) - ); - } - - } - - private void addConceptSemanticTypeURIField(String conceptSemanticTypeURI) { - if(conceptSemanticTypeURI != null) { - editConfiguration.addField(new FieldVTwo(). - setName(conceptSemanticTypeURI)); - } - } - - private void addConceptNarrowerURIField(String conceptNarrowerURI) { - editConfiguration.addField(new FieldVTwo(). - setName(conceptNarrowerURI)); - - } - - private void addConceptBroaderURIField(String conceptBroaderURI) { - editConfiguration.addField(new FieldVTwo(). - setName(conceptBroaderURI)); - - } - - //original literals on form: label, uris on form: conceptNode and conceptSource - //This will overwrite the original values in the edit configuration - private void addLiteralsAndUrisOnForm(int numberTerms) { - List urisOnForm = new ArrayList(); - List literalsOnForm = new ArrayList(); - - int index; - HashSet conceptSemanticTypeURIs = new HashSet(); - // First one already included so add new ones here - for (index = 1; index <= numberTerms; index++) { - int suffix = index; - String conceptNode = conceptNodeBase + suffix; - String label = labelBase + suffix; - String source = sourceBase + suffix; - String conceptSemanticTypeLabel = conceptSemanticTypeLabelBase + suffix; - //String conceptSemanticTypeURI = conceptSemanticTypeURIBase + suffix; - String conceptSemanticTypeURI = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); - String conceptBroaderURI = conceptBroaderURIBase + suffix; - String conceptNarrowerURI = conceptNarrowerURIBase + suffix; - urisOnForm.add(conceptNode); - urisOnForm.add(source); - if(!conceptSemanticTypeURIs.contains(conceptSemanticTypeURI)) { - conceptSemanticTypeURIs.add(conceptSemanticTypeURI); - urisOnForm.add(conceptSemanticTypeURI); - } - urisOnForm.add(conceptBroaderURI); - urisOnForm.add(conceptNarrowerURI); - literalsOnForm.add(label); - literalsOnForm.add(conceptSemanticTypeLabel); - } - editConfiguration.setUrisOnform(urisOnForm); - editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - // N3 being reproduced - /* - * ?subject ?predicate ?conceptNode . - */ - //This will overwrite the original with the set of new n3 required - private void addN3Required(int numberConcepts) { - // List n3Required = editConfig.getN3Required(); - List n3Required = new ArrayList(); - int index; - String nodeBase = "?" + conceptNodeBase; - - String prefixStr = "@prefix core: ."; - // First one already included so add new ones here - for (index = 1; index <= numberConcepts; index++) { - int suffix = index; - String node = nodeBase + suffix; - String n3String = prefixStr; - n3String += "?subject ?predicate " + node + " . \n" + - node + " <" + RDF.type.getURI() + "> <" + this.SKOSConceptType + "> ."; - n3Required.add(n3String); - } - editConfiguration.setN3Required(n3Required); - } - //Add n3 optional - //TODO: Rewrite optional N3 - private void addN3Optional(int numberConcepts) { - List n3Optional = new ArrayList(); - int index; - String nodeBase = "?" + conceptNodeBase; - String labelVar = "?" + labelBase; - String sourceVar = "?" + sourceBase; - String conceptSemanticTypeLabelVar = "?" + conceptSemanticTypeLabelBase; - String conceptBroaderURIVar = "?" + conceptBroaderURIBase; - String conceptNarrowerURIVar = "?" + conceptNarrowerURIBase; - String prefixStr = "@prefix core: ."; - // First one already included so add new ones here - //We already have a label var to uri var setup - for (index = 1; index <= numberConcepts; index++) { - //Set up the variables based on which concept node - int suffix = index; - String node = nodeBase + suffix; - String label = labelVar + suffix; - String source = sourceVar + suffix; - String conceptSemanticTypeLabel = conceptSemanticTypeLabelVar + suffix; - //get the URI appropriate for the concept semantic type label var - String conceptSemanticTypeURI = getConceptSemanticTypeURIVar(conceptSemanticTypeLabelBase + suffix, suffix); - String conceptBroaderURI = conceptBroaderURIVar + suffix; - String conceptNarrowerURI = conceptNarrowerURIVar + suffix; - //Set up the n3 strings - String n3String = prefixStr; - n3String += node + " <" + RDFS.label.getURI() + "> " + label + " .\n" + - node + " <" + RDFS.isDefinedBy.getURI() + "> " + source + " ."; - String n3ConceptTypeString = prefixStr; - n3ConceptTypeString += node + " <" + RDF.type.getURI() + "> " + conceptSemanticTypeURI + " ." + - conceptSemanticTypeURI + " <" + RDFS.label.getURI() + "> " + conceptSemanticTypeLabel + " .\n" + - conceptSemanticTypeURI + " <" + RDFS.subClassOf.getURI() + "> .\n" ; - //String representing the broader and narrower uri(s) for each of the concepts - these may or may not exist - String n3ConceptBroaderURI = prefixStr + node + " <" + this.SKOSNarrowerURI + "> " + conceptNarrowerURI + " ." + - conceptNarrowerURI + " <" + this.SKOSBroaderURI + "> " + node + " ."; - String n3ConceptNarrowerURI = prefixStr + node + " <" + this.SKOSBroaderURI + "> " + conceptBroaderURI + " ." + - conceptBroaderURI + " <" + this.SKOSNarrowerURI + "> " + node + " ."; - - n3Optional.add(n3String); - //adding separately so their resolution does not depend on each other - n3Optional.add(n3ConceptTypeString); - n3Optional.add(n3ConceptBroaderURI); - n3Optional.add(n3ConceptNarrowerURI); - - } - //Already have n3 required so need to add to that - - editConfiguration.setN3Optional(n3Optional); - } - - //get the URI variable that is associated with this concept type URI, which might not be - //the same suffix because the same label value might be repeated and we need to use the same URI - //representing that concept semantic type - private String getConceptSemanticTypeURIVar(String labelVar, int suffix) { - // TODO Auto-generated method stub - return "?" + this.getConceptSemanticTypeURIFieldName(labelVar, suffix); - } - - private String getConceptSemanticTypeURIFieldName(String labelVar, int suffix) { - // TODO Auto-generated method stub - if(this.labelVarToUriVarHash.containsKey(labelVar)) { - return this.labelVarToUriVarHash.get(labelVar); - } - return this.conceptSemanticTypeURIBase + suffix; - } - - private String[] convertDelimitedStringToArray(String inputString) { - String[] inputArray = new String[1]; - if (inputString.indexOf(",") != -1) { - inputArray = inputString.split(","); - } else { - inputArray[0] = inputString; - } - return inputArray; - - } - - - //Get values from submission - private String getConceptNodeValues() { - Map> urisFromForm = submission.getUrisFromForm(); - List conceptNodes = urisFromForm.get("conceptNode"); - return (String) getFirstElement(conceptNodes); - } - - private String getConceptSourceValues() { - Map> urisFromForm = submission.getUrisFromForm(); - return (String) getFirstElement(urisFromForm.get("conceptSource")); - } - - private String getConceptLabelValues() { - Map> literalsFromForm = submission.getLiteralsFromForm(); - Map> transformed = EditConfigurationUtils.transformLiteralMap(literalsFromForm); - return (String) getFirstElement(transformed.get("conceptLabel")); - - } - - private String getConceptSemanticTypeLabelValues() { - Map> literalsFromForm = submission.getLiteralsFromForm(); - Map> transformed = EditConfigurationUtils.transformLiteralMap(literalsFromForm); - String label = (String) getFirstElement(transformed.get("conceptSemanticTypeLabel")); - if(label == null) { - label = ""; - } - - return label; - } - - //This will either generate or retrieve URIs for the concept semantic type labels if they exist - //We will then update the submission to include this - private String getConceptSemanticTypeURIValues() { - StringBuilder pseudoInputString = new StringBuilder(); - if(conceptSemanticTypeLabelValues != null && !conceptSemanticTypeLabelValues.isEmpty()) { - String[] conceptSemanticTypeLabels = convertDelimitedStringToArray(conceptSemanticTypeLabelValues); - //keep track of what label values already exist and to which label variables they map - HashMap> labelValueToVarSuffix = new HashMap>(); - int numberLabels = conceptSemanticTypeLabels.length; - - //The rest of this code is really only relevant for multiple values, so we could break out the old code above - //as we don't need to set up hashes etc. if there is only one concept node being added - if(numberLabels == 1) { - String label = conceptSemanticTypeLabels[0]; - String uri = getURIForSemanticTypeLabel(label); - if(!StringUtils.isEmpty(uri)) { - String[] urisToAdd = new String[1]; - urisToAdd[0] = uri; - pseudoInputString = new StringBuilder(uri); - log.debug("uris to add" + uri); - submission.addUriToForm(this.editConfiguration, "conceptSemanticTypeURI", urisToAdd); - } - - } - //if there is more than one concept node, we may have duplicate semantic types - //which will need to be referred to by the same semantic type uri - else if (numberLabels > 1){ - - for(int i = 0; i < numberLabels; i++) { - int suffix = i + 1; - String label = conceptSemanticTypeLabels[i]; - String labelVar = this.conceptSemanticTypeLabelBase + suffix; - //if label has not already been encountered, create entry for label value - //and list with the label variables that would refer to it - //for unique values, the uri variable will be the same as label - Integer thisSuffix = new Integer(suffix); - if(!labelValueToVarSuffix.containsKey(label)) { - labelValueToVarSuffix.put(label, new ArrayList()); - //Add suffix to list if not already there - labelValueToVarSuffix.get(label).add(thisSuffix); - } else { - //in this case, the label already exists, get the very first element in the list - //and use that as the uri variable - List suffixList = labelValueToVarSuffix.get(label); - if(suffixList != null && suffixList.size() > 0) { - thisSuffix = suffixList.get(0); - } - - } - - //Now add the uri var to the hash mapping label variable to uri variable - String uriVar = this.conceptSemanticTypeURIBase + thisSuffix.intValue(); - this.labelVarToUriVarHash.put(labelVar, uriVar); - - - //Make or retrieve URI for this label - //TODO: Do we create this string with empty inputs ? - String uri = getURIForSemanticTypeLabel(label); - if(!StringUtils.isEmpty(uri)) { - //uri var shouldn't be repeated? - if(!this.conceptSemanticTypeURIVarToValueMap.containsKey(uriVar)) { - this.conceptSemanticTypeURIVarToValueMap.put(uriVar, new ArrayList()); - this.conceptSemanticTypeURIVarToValueMap.get(uriVar).add(uri); - } - } - if(i != 0) { - pseudoInputString.append(","); - } - pseudoInputString.append(uri); - - } - - //Add this string to the uris for the form - String[] urisToAdd = new String[1]; - urisToAdd[0] = pseudoInputString.toString(); - log.debug("uris to add" + pseudoInputString); - submission.addUriToForm(this.editConfiguration, "conceptSemanticTypeURI", urisToAdd); - - } - } - return pseudoInputString.toString(); - } - - private String getURIForSemanticTypeLabel(String label) { - String existingURI = this.getExistingSemanticTypeURI(label); - if(existingURI != null) { - return existingURI; - } - //if we leave this as null, we should be able to generate a new resource - //empty string because there may be more than one value returned for labels - else return ""; - - } - - private String getExistingSemanticTypeURI(String label) { - String queryStr = "SELECT ?semanticType WHERE { ?semanticType <" + RDF.type.getURI() + "> <" + OWL.Class.getURI() + "> . " + - "?semanticType <" + RDFS.label.getURI() + "> \"" + label + "\"^^ . }"; - QueryExecution qe = null; - try{ - Query query = QueryFactory.create(queryStr); - qe = QueryExecutionFactory.create(query, this.ontModel); - ResultSet results = null; - results = qe.execSelect(); - - while( results.hasNext()){ - QuerySolution qs = results.nextSolution(); - if(qs.get("semanticType") != null) { - Resource semanticTypeURI = qs.getResource("semanticType"); - log.debug("Semantic Type URI returned " + semanticTypeURI.getURI()); - return semanticTypeURI.getURI(); - } - } - }catch(Exception ex){ - throw new Error("Error in executing query string: \n" + queryStr + '\n' + ex.getMessage()); - }finally{ - if( qe != null) - qe.close(); - } - return null; - } - - private Object getFirstElement(List inputList) { - if(inputList == null || inputList.size() == 0) - return null; - return inputList.get(0); - } - - - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.query.Query; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QueryFactory; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.OWL; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; +import org.apache.jena.vocabulary.XSD; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.BaseEditSubmissionPreprocessorVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; +import edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils; + +public class AddAssociatedConceptsPreprocessor extends + BaseEditSubmissionPreprocessorVTwo { + + protected static final Log log = LogFactory + .getLog(AddAssociatedConceptsPreprocessor.class.getName()); + protected OntModel ontModel = null; + protected WebappDaoFactory wdf = null; + // Field names/variables names for n3 - these will have numbers added as + // suffix if more than one term + private static String conceptNodeBase = "conceptNode"; + private static String sourceBase = "conceptSource"; + private static String labelBase = "conceptLabel"; + private static String conceptSemanticTypeLabelBase = "conceptSemanticTypeLabel"; + private static String conceptSemanticTypeURIBase = "conceptSemanticTypeURI"; + private static String conceptBroaderURIBase = "conceptBroaderURI"; + private static String conceptNarrowerURIBase = "conceptNarrowerURI"; + + //keyed off label variable, specifies which uri variable should be used, useful if same label repeated twice + private HashMap labelVarToUriVarHash = null; + private HashMap> conceptSemanticTypeURIVarToValueMap = null; + //Also storing submission values + private static String conceptNodeValues = null; + private static String conceptLabelValues = null; + private static String conceptSourceValues = null; + private static String conceptSemanticTypeLabelValues = null; + private static String conceptSemanticTypeURIValues = null; + private static List conceptBroaderURIValues = null; + private static List conceptNarrowerURIValues = null; + private static MultiValueEditSubmission submission = null; + + private static String SKOSBroaderURI = "http://www.w3.org/2004/02/skos/core#broader"; + private static String SKOSNarrowerURI = "http://www.w3.org/2004/02/skos/core#narrower"; + private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; + + // String datatype + + // Will be editing the edit configuration as well as edit submission here + + public AddAssociatedConceptsPreprocessor(EditConfigurationVTwo editConfig) { + super(editConfig); + this.labelVarToUriVarHash = new HashMap(); + //Saves values of concept type uris + this.conceptSemanticTypeURIVarToValueMap = new HashMap>(); + } + + public void preprocess(MultiValueEditSubmission inputSubmission, VitroRequest vreq) { + submission = inputSubmission; + this.wdf = vreq.getWebappDaoFactory(); + this.ontModel = ModelAccess.on(vreq).getOntModel(); + //Set the models that we need here + // Get the input elements for concept node and concept label as well + // as vocab uri (which is based on thge + // For query parameters, check whether CUI + copySubmissionValues(); + + + if (conceptNodeValues != null) { + String[] conceptNodes = convertDelimitedStringToArray(conceptNodeValues); + int numberConcepts = conceptNodes.length; + //This will put the URI value in scope for the first semantic type label + //and generate the rest if need be + processConceptSemanticValues(); + //Also need to see if any broader or narrower uris for the concepts that already exist in the system + //and set up the appropriate relationships between this concept and the broader/narrower uri + getExistingConceptRelationships(); + if (numberConcepts > 1) { + processConceptNodes(numberConcepts); + } + + } else { + log.error("No concept nodes were added from the service"); + } + + } + + + + //Since we will change the uris and literals from form, we should make copies + //of the original values and store them, this will also make iterations + //and updates to the submission independent from accessing the values + private void copySubmissionValues() { + conceptLabelValues = getConceptLabelValues(); + conceptNodeValues = getConceptNodeValues(); + conceptSourceValues = getConceptSourceValues(); + conceptBroaderURIValues = getConceptBroaderURIValues(); + conceptNarrowerURIValues = getConceptNarrowerURIValues(); + log.debug("concept label values are " + conceptLabelValues); + + } + + + //For broader and narrower relationships, we will be + //linking the concept to broader and narrower terms where those terms already + //exist in the system + //This method or approach may change later in which case this method should change + private void getExistingConceptRelationships() { + List existingNarrowerURIs = getExistingNarrowerURIs(conceptNarrowerURIValues); + List existingBroaderURIs = getExistingBroaderURIs(conceptBroaderURIValues); + //Now set the submission values to these, overwriting the original + Map> urisFromForm = submission.getUrisFromForm(); + if(existingNarrowerURIs.size() > 0) { + urisFromForm.put("conceptNarrowerURI", existingNarrowerURIs); + } else { + //The original code for submission wouldn't put in a key if the values were null or size 0 + urisFromForm.remove("conceptNarrowerURI"); + } + //Set the copied values to this value as well so when if there are multiple + //concepts, the inputs get copied correctly for each of them + this.conceptNarrowerURIValues = existingNarrowerURIs; + if(existingBroaderURIs.size() > 0) { + urisFromForm.put("conceptBroaderURI", existingBroaderURIs); + } else { + urisFromForm.remove("conceptBroaderURI"); + } + this.conceptBroaderURIValues = existingBroaderURIs; + } + + //get the broader and narrower uri values that already exist in the system from the ones returned in the search + //and use those to populate relationships between the concept and other concepts already in the system + //We should also make sure to use bidirectional n3 so the graph has both sets of relationships represented + private List getConceptNarrowerURIValues() { + return this.getJSONFormURIValues("conceptNarrowerURI"); + } + + private List getConceptBroaderURIValues() { + return this.getJSONFormURIValues("conceptBroaderURI"); + } + + private List getJSONFormURIValues(String varName) { + Map> urisFromForm = submission.getUrisFromForm(); + List uris = urisFromForm.get(varName); + //This should be a JSON object stringified + if(uris.size() > 0) { + String jsonString = uris.get(0); + if(jsonString != null && !jsonString.isEmpty()) { + JsonNode json = JacksonUtils.parseJson(jsonString); + //This should be an array + if(json.isArray()) { + ArrayNode jsonArray = (ArrayNode) JacksonUtils.parseJson(jsonString); + //Convert to list of strings + return convertJsonArrayToList(jsonArray); + } + } + } + return uris; + } + + private List convertJsonArrayToList(ArrayNode jsonArray) { + List stringList = new ArrayList(); + int len = jsonArray.size(); + int i = 0; + for(i = 0; i < len; i++) { + stringList.add(jsonArray.get(i).asText()); + } + return stringList; + } + + private List getExistingBroaderURIs(List broaderURIs) { + if(broaderURIs == null) { + return new ArrayList(); + } + List existingBroaderURIs = this.getExistingURIs(broaderURIs); + return existingBroaderURIs; + } + + private List getExistingNarrowerURIs(List narrowerURIs) { + if(narrowerURIs == null) + return new ArrayList(); + List existingNarrowerURIs = this.getExistingURIs(narrowerURIs); + return existingNarrowerURIs; + } + + //We need to keep the number of elements the same if there are any entries at all in the original + //So we will use an empty string or null + private List getExistingURIs(List uris) { + //Important to keep the same formatting as original, because a comma delimited string as an element in the array + //refers to a list of uris appropriate for a given concept, where each element in the array corresponds to a different + //concept + List existingURIs = new ArrayList(); + for(String uri:uris) { + if(uri.indexOf(",") != -1) { + List existingURISet = new ArrayList(); + String[] uriSet = uri.split(","); + for(String u: uriSet) { + if(u != null && !u.isEmpty() && this.wdf.hasExistingURI(u)) { + existingURISet.add(u); + } + } + //Now add the comma delimited version back to the array + if(existingURISet.size() > 0) { + existingURIs.add(StringUtils.join(existingURISet, ",")); + } else { + //add empty string to indicate no value here + existingURIs.add(""); + } + } else { + if(uri != null && !uri.isEmpty() && this.wdf.hasExistingURI(uri)) { + existingURIs.add(uri); + } + else + { + existingURIs.add(""); + } + + } + } + return existingURIs; + } + + + //Process the semantic type label and URI values for the concepts + private void processConceptSemanticValues() { + conceptSemanticTypeLabelValues = getConceptSemanticTypeLabelValues(); + conceptSemanticTypeURIValues = getConceptSemanticTypeURIValues(); + + //We are first going to handle the single value case and then handle additional values + //where the rest of the additional values are handled + + } + + + //This is for additional concept nodes (i.e. if user selects more than one concept) + private void processConceptNodes(int numberConcepts) { + //There are no "new" resources b/c the concept nodes are URIs from external vocabularies + //New resources for concept semantic type uris + addNewResources(numberConcepts); + // Add N3Required + addN3Required(numberConcepts); + //Add N3 Optional as well + addN3Optional(numberConcepts); + // Add URIs on Form and Add Literals On Form + addLiteralsAndUrisOnForm(numberConcepts); + // Add fields + addFields(numberConcepts); + //Add input values to submission + addInputsToSubmission(numberConcepts); + + } + + //This is specifically for concept semantic type URIs which may need to be generated + private void addNewResources(int numberConcepts) { + // TODO Auto-generated method stub + addConceptSemanticTypeURIResources(numberConcepts); + } + + private void addConceptSemanticTypeURIResources(int numberConcepts) { + //Iterate through the labels and get the corresponding uris + HashSet urisToAdd = new HashSet(); + String[] conceptSemanticTypeLabels= convertDelimitedStringToArray(conceptSemanticTypeLabelValues); + //the number of existing values may not match up, or at least existing populated ones + //Now we can't determine whether all concepts will have semantic types - at some point what if + //we ran a search across all external vocabularies? So we can't compare labels to number of concepts + //but we can ensure that it isn't greater than then number of concepts + if(conceptSemanticTypeLabels != null && conceptSemanticTypeLabels.length <= numberConcepts) { + int i; + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String conceptSemanticTypeLabelVar = conceptSemanticTypeLabelBase + suffix; + if(this.labelVarToUriVarHash.containsKey(conceptSemanticTypeLabelVar)) { + String newResourceName = this.labelVarToUriVarHash.get(conceptSemanticTypeLabelVar); + if(!urisToAdd.contains(newResourceName)) { + urisToAdd.add(newResourceName); + editConfiguration.addNewResource(newResourceName, null); + } + } + + } + } else if(conceptSemanticTypeLabels != null && conceptSemanticTypeLabels.length > numberConcepts){ + log.error("Number of concept semantic type labels is greater than number of concepts"); + } else{ + log.error("Concept semantic type labels returned are null"); + } + + } + + //This is where the actual values will be submitted as if they were separate input fields + //Each field name will correspond to the names of the fileds/uris on form/literals on form + //generated here + + private void addInputsToSubmission(int numberConcepts) { + //This will essentially manufacture a set of query parameters + //And will add the appropriate fields to the multivalue submission + addConceptNodeInputs(numberConcepts); + addConceptSourceInputs(numberConcepts); + addConceptLabelInputs(numberConcepts); + //for concept semantic type labels and uris where they exist + addConceptSemanticTypeLabelAndURIInputs(numberConcepts); + //For broader and narrower uris where they exist (this of course is in the case of multiple broader and narrower uris + addConceptBroaderURIInputs(numberConcepts); + addConceptNarrowerURIInputs(numberConcepts); + } + + private void addConceptNodeInputs(int numberConcepts) { + + String[] conceptNodes = convertDelimitedStringToArray(conceptNodeValues); + if(conceptNodes != null && conceptNodes.length == numberConcepts) { + int i; + //iterate through the concept nodes converted string array + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String conceptInputName = conceptNodeBase + suffix; + String[] nodeValues = new String[1]; + nodeValues[0] = conceptNodes[i]; + //Add value for uri to form + submission.addUriToForm(editConfiguration, conceptInputName, nodeValues); + } + } else if(conceptNodes != null && conceptNodes.length != numberConcepts){ + log.error("Number of concept nodes did not match the number of concepts to be added"); + } else{ + log.error("Concept nodes returned were null"); + } + + } + + private void addConceptSourceInputs(int numberConcepts) { + String[] conceptSources = convertDelimitedStringToArray(conceptSourceValues); + if(conceptSources != null && conceptSources.length == numberConcepts) { + int i; + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String conceptInputName = sourceBase + suffix; + String[] sourceValues = new String[1]; + sourceValues[0] = conceptSources[i]; + //Add value for uri to form + submission.addUriToForm(editConfiguration, conceptInputName, sourceValues); + } + } else if(conceptSources != null && conceptSources.length != numberConcepts){ + log.error("Number of concept nodes did not match the number of concepts to be added"); + } else{ + log.error("Concept nodes returned were null"); + } + } + + private void addConceptLabelInputs(int numberConcepts) { + String[] labels = convertDelimitedStringToArray(conceptLabelValues); + if(labels != null && labels.length == numberConcepts) { + int i; + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String labelInputName = labelBase + suffix; + String[] labelValues = new String[1]; + labelValues[0] = labels[i]; + //TODO: Check if there are no funky typed information also stored + //At this point the field should already have been added to edit configuration + FieldVTwo labelField = editConfiguration.getField(labelInputName); + if(labelField != null) { + submission.addLiteralToForm(editConfiguration, labelField, labelInputName, labelValues); + } else { + log.error("Corresponding field for " + labelInputName + " was not added to edit configuration"); + } + + } + } else if(labels != null && labels.length != numberConcepts){ + log.error("Number of concept labels did not match the number of concepts to be added"); + } else{ + log.error("Concept labels returned were null"); + } + } + + private void addConceptSemanticTypeLabelAndURIInputs(int numberConcepts) { + String[] labels = convertDelimitedStringToArray(conceptSemanticTypeLabelValues); + HashSet uniqueLabelValues = new HashSet(); + if(labels != null && labels.length == numberConcepts) { + int i; + for(i = 0; i < numberConcepts; i++) { + String thisLabel = labels[i]; + int suffix = i + 1; + String labelInputName = conceptSemanticTypeLabelBase + suffix; + String[] labelValues = new String[1]; + labelValues[0] = thisLabel; + //TODO: Check if there are no funky typed information also stored + //At this point the field should already have been added to edit configuration + FieldVTwo labelField = editConfiguration.getField(labelInputName); + //TODO: Also check to see whether the label is actually populate or will n3 editing take care of that? + if(labelField != null) { + submission.addLiteralToForm(editConfiguration, labelField, labelInputName, labelValues); + //Associate URI + if(!uniqueLabelValues.contains(thisLabel)) { + uniqueLabelValues.add(thisLabel); + this.addConceptSemanticTypeURIInputForLabel(labelInputName, suffix); + } + } else { + log.error("Corresponding field for " + labelInputName + " was not added to edit configuration"); + } + + } + } else if(labels != null && labels.length != numberConcepts){ + log.error("Number of concept semantic type labels did not match the number of concepts to be added"); + } else{ + log.error("Concept labels returned were null"); + } + } + + private void addConceptSemanticTypeURIInputForLabel(String conceptSemanticTypeLabel, int suffix) { + //String[] conceptSemanticTypeURIs= convertDelimitedStringToArray(conceptSemanticTypeURIValues); + + //Get the semantic type URI variable name associated with this label + String uriInputName = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); + //List<> + if(this.conceptSemanticTypeURIVarToValueMap.containsKey(uriInputName)) { + List uriVals = this.conceptSemanticTypeURIVarToValueMap.get(uriInputName); + String[] uriValuesArray = uriVals.toArray(new String[uriVals.size()]); + submission.addUriToForm(editConfiguration, uriInputName, uriValuesArray); + } + } + + private void addConceptBroaderURIInputs(int numberConcepts) { + int i; + //Add inputs based on if there are any broader uris to add + //Can't really compare number of existing broader uris to concepts + //as each concept may or may not have a broader uri + if(this.conceptBroaderURIValues.size() > 0 && this.conceptBroaderURIValues.size() <= numberConcepts) { + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String conceptBroaderURIInputName = conceptBroaderURIBase + suffix; + String broaderURIs = this.conceptBroaderURIValues.get(i); + if(broaderURIs != null && !broaderURIs.isEmpty()) { + String[] broaderURISet = new String[1]; + if(broaderURIs.indexOf(",") != -1) { + broaderURISet = broaderURIs.split(","); + } else { + broaderURISet[0] = broaderURIs; + } + //Add value for uri to form + submission.addUriToForm(editConfiguration, conceptBroaderURIInputName, broaderURISet); + } + } + } + + } + private void addConceptNarrowerURIInputs(int numberConcepts) { + int i; + if(this.conceptNarrowerURIValues.size() > 0 && this.conceptNarrowerURIValues.size() <= numberConcepts) { + for(i = 0; i < numberConcepts; i++) { + int suffix = i + 1; + String conceptNarrowerURIInputName = conceptNarrowerURIBase + suffix; + String narrowerURIs = this.conceptNarrowerURIValues.get(i); + if(narrowerURIs != null && !narrowerURIs.isEmpty()) { + String[] narrowerURISet = new String[1]; + if(narrowerURIs.indexOf(",") != -1) { + narrowerURISet = narrowerURIs.split(","); + } else { + narrowerURISet[0] = narrowerURIs; + } + //Add value for uri to form + submission.addUriToForm(editConfiguration, conceptNarrowerURIInputName, narrowerURISet); + } + } + } + } + + //Fields + + private void addFields(int numberConcepts) { + //Clear out all fields in edit configuration first + editConfiguration.setFields(new HashMap()); + int index; + HashSet conceptSemanticTypeUris = new HashSet(); + // First one already included in generator so add additional ones here + for (index = 1; index <= numberConcepts; index++) { + int suffix = index; + String conceptNode = conceptNodeBase + suffix; + String label = labelBase + suffix; + String source = sourceBase + suffix; + String conceptSemanticTypeLabel = conceptSemanticTypeLabelBase + suffix; + String conceptSemanticTypeURI = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); + String conceptBroaderURI = conceptBroaderURIBase + suffix; + String conceptNarrowerURI = conceptNarrowerURIBase + suffix; + addConceptNodeField(conceptNode); + addLabelField(label); + addSourceField(source); + //Also add fields for concept semantic type label + addConceptSemanticTypeLabelField(conceptSemanticTypeLabel); + //and concept semantic type URI + if(!conceptSemanticTypeUris.contains(conceptSemanticTypeURI)) { + conceptSemanticTypeUris.add(conceptSemanticTypeURI); + addConceptSemanticTypeURIField(conceptSemanticTypeURI); + } + + //add fields for concept broader and narrower uris + addConceptBroaderURIField(conceptBroaderURI); + addConceptNarrowerURIField(conceptNarrowerURI); + } + } + + + + private void addConceptNodeField(String conceptNode) { + List validators = new ArrayList(); + validators.add("nonempty"); + editConfiguration.addField(new FieldVTwo(). + setName(conceptNode). + setValidators(validators)); + } + + private void addLabelField(String label) { + editConfiguration.addField(new FieldVTwo(). + setName(label). + setRangeDatatypeUri(XSD.xstring.toString()) + ); + + } + + private void addSourceField(String source) { + editConfiguration.addField(new FieldVTwo(). + setName(source)); + + } + + //TODO: Do we need to check if label is empty string? + private void addConceptSemanticTypeLabelField(String label) { + if(label != null) { + editConfiguration.addField(new FieldVTwo(). + setName(label). + setRangeDatatypeUri(XSD.xstring.toString()) + ); + } + + } + + private void addConceptSemanticTypeURIField(String conceptSemanticTypeURI) { + if(conceptSemanticTypeURI != null) { + editConfiguration.addField(new FieldVTwo(). + setName(conceptSemanticTypeURI)); + } + } + + private void addConceptNarrowerURIField(String conceptNarrowerURI) { + editConfiguration.addField(new FieldVTwo(). + setName(conceptNarrowerURI)); + + } + + private void addConceptBroaderURIField(String conceptBroaderURI) { + editConfiguration.addField(new FieldVTwo(). + setName(conceptBroaderURI)); + + } + + //original literals on form: label, uris on form: conceptNode and conceptSource + //This will overwrite the original values in the edit configuration + private void addLiteralsAndUrisOnForm(int numberTerms) { + List urisOnForm = new ArrayList(); + List literalsOnForm = new ArrayList(); + + int index; + HashSet conceptSemanticTypeURIs = new HashSet(); + // First one already included so add new ones here + for (index = 1; index <= numberTerms; index++) { + int suffix = index; + String conceptNode = conceptNodeBase + suffix; + String label = labelBase + suffix; + String source = sourceBase + suffix; + String conceptSemanticTypeLabel = conceptSemanticTypeLabelBase + suffix; + //String conceptSemanticTypeURI = conceptSemanticTypeURIBase + suffix; + String conceptSemanticTypeURI = this.getConceptSemanticTypeURIFieldName(conceptSemanticTypeLabel, suffix); + String conceptBroaderURI = conceptBroaderURIBase + suffix; + String conceptNarrowerURI = conceptNarrowerURIBase + suffix; + urisOnForm.add(conceptNode); + urisOnForm.add(source); + if(!conceptSemanticTypeURIs.contains(conceptSemanticTypeURI)) { + conceptSemanticTypeURIs.add(conceptSemanticTypeURI); + urisOnForm.add(conceptSemanticTypeURI); + } + urisOnForm.add(conceptBroaderURI); + urisOnForm.add(conceptNarrowerURI); + literalsOnForm.add(label); + literalsOnForm.add(conceptSemanticTypeLabel); + } + editConfiguration.setUrisOnform(urisOnForm); + editConfiguration.setLiteralsOnForm(literalsOnForm); + } + + // N3 being reproduced + /* + * ?subject ?predicate ?conceptNode . + */ + //This will overwrite the original with the set of new n3 required + private void addN3Required(int numberConcepts) { + // List n3Required = editConfig.getN3Required(); + List n3Required = new ArrayList(); + int index; + String nodeBase = "?" + conceptNodeBase; + + String prefixStr = "@prefix core: ."; + // First one already included so add new ones here + for (index = 1; index <= numberConcepts; index++) { + int suffix = index; + String node = nodeBase + suffix; + String n3String = prefixStr; + n3String += "?subject ?predicate " + node + " . \n" + + node + " <" + RDF.type.getURI() + "> <" + this.SKOSConceptType + "> ."; + n3Required.add(n3String); + } + editConfiguration.setN3Required(n3Required); + } + //Add n3 optional + //TODO: Rewrite optional N3 + private void addN3Optional(int numberConcepts) { + List n3Optional = new ArrayList(); + int index; + String nodeBase = "?" + conceptNodeBase; + String labelVar = "?" + labelBase; + String sourceVar = "?" + sourceBase; + String conceptSemanticTypeLabelVar = "?" + conceptSemanticTypeLabelBase; + String conceptBroaderURIVar = "?" + conceptBroaderURIBase; + String conceptNarrowerURIVar = "?" + conceptNarrowerURIBase; + String prefixStr = "@prefix core: ."; + // First one already included so add new ones here + //We already have a label var to uri var setup + for (index = 1; index <= numberConcepts; index++) { + //Set up the variables based on which concept node + int suffix = index; + String node = nodeBase + suffix; + String label = labelVar + suffix; + String source = sourceVar + suffix; + String conceptSemanticTypeLabel = conceptSemanticTypeLabelVar + suffix; + //get the URI appropriate for the concept semantic type label var + String conceptSemanticTypeURI = getConceptSemanticTypeURIVar(conceptSemanticTypeLabelBase + suffix, suffix); + String conceptBroaderURI = conceptBroaderURIVar + suffix; + String conceptNarrowerURI = conceptNarrowerURIVar + suffix; + //Set up the n3 strings + String n3String = prefixStr; + n3String += node + " <" + RDFS.label.getURI() + "> " + label + " .\n" + + node + " <" + RDFS.isDefinedBy.getURI() + "> " + source + " ."; + String n3ConceptTypeString = prefixStr; + n3ConceptTypeString += node + " <" + RDF.type.getURI() + "> " + conceptSemanticTypeURI + " ." + + conceptSemanticTypeURI + " <" + RDFS.label.getURI() + "> " + conceptSemanticTypeLabel + " .\n" + + conceptSemanticTypeURI + " <" + RDFS.subClassOf.getURI() + "> .\n" ; + //String representing the broader and narrower uri(s) for each of the concepts - these may or may not exist + String n3ConceptBroaderURI = prefixStr + node + " <" + this.SKOSNarrowerURI + "> " + conceptNarrowerURI + " ." + + conceptNarrowerURI + " <" + this.SKOSBroaderURI + "> " + node + " ."; + String n3ConceptNarrowerURI = prefixStr + node + " <" + this.SKOSBroaderURI + "> " + conceptBroaderURI + " ." + + conceptBroaderURI + " <" + this.SKOSNarrowerURI + "> " + node + " ."; + + n3Optional.add(n3String); + //adding separately so their resolution does not depend on each other + n3Optional.add(n3ConceptTypeString); + n3Optional.add(n3ConceptBroaderURI); + n3Optional.add(n3ConceptNarrowerURI); + + } + //Already have n3 required so need to add to that + + editConfiguration.setN3Optional(n3Optional); + } + + //get the URI variable that is associated with this concept type URI, which might not be + //the same suffix because the same label value might be repeated and we need to use the same URI + //representing that concept semantic type + private String getConceptSemanticTypeURIVar(String labelVar, int suffix) { + // TODO Auto-generated method stub + return "?" + this.getConceptSemanticTypeURIFieldName(labelVar, suffix); + } + + private String getConceptSemanticTypeURIFieldName(String labelVar, int suffix) { + // TODO Auto-generated method stub + if(this.labelVarToUriVarHash.containsKey(labelVar)) { + return this.labelVarToUriVarHash.get(labelVar); + } + return this.conceptSemanticTypeURIBase + suffix; + } + + private String[] convertDelimitedStringToArray(String inputString) { + String[] inputArray = new String[1]; + if (inputString.indexOf(",") != -1) { + inputArray = inputString.split(","); + } else { + inputArray[0] = inputString; + } + return inputArray; + + } + + + //Get values from submission + private String getConceptNodeValues() { + Map> urisFromForm = submission.getUrisFromForm(); + List conceptNodes = urisFromForm.get("conceptNode"); + return (String) getFirstElement(conceptNodes); + } + + private String getConceptSourceValues() { + Map> urisFromForm = submission.getUrisFromForm(); + return (String) getFirstElement(urisFromForm.get("conceptSource")); + } + + private String getConceptLabelValues() { + Map> literalsFromForm = submission.getLiteralsFromForm(); + Map> transformed = EditConfigurationUtils.transformLiteralMap(literalsFromForm); + return (String) getFirstElement(transformed.get("conceptLabel")); + + } + + private String getConceptSemanticTypeLabelValues() { + Map> literalsFromForm = submission.getLiteralsFromForm(); + Map> transformed = EditConfigurationUtils.transformLiteralMap(literalsFromForm); + String label = (String) getFirstElement(transformed.get("conceptSemanticTypeLabel")); + if(label == null) { + label = ""; + } + + return label; + } + + //This will either generate or retrieve URIs for the concept semantic type labels if they exist + //We will then update the submission to include this + private String getConceptSemanticTypeURIValues() { + StringBuilder pseudoInputString = new StringBuilder(); + if(conceptSemanticTypeLabelValues != null && !conceptSemanticTypeLabelValues.isEmpty()) { + String[] conceptSemanticTypeLabels = convertDelimitedStringToArray(conceptSemanticTypeLabelValues); + //keep track of what label values already exist and to which label variables they map + HashMap> labelValueToVarSuffix = new HashMap>(); + int numberLabels = conceptSemanticTypeLabels.length; + + //The rest of this code is really only relevant for multiple values, so we could break out the old code above + //as we don't need to set up hashes etc. if there is only one concept node being added + if(numberLabels == 1) { + String label = conceptSemanticTypeLabels[0]; + String uri = getURIForSemanticTypeLabel(label); + if(!StringUtils.isEmpty(uri)) { + String[] urisToAdd = new String[1]; + urisToAdd[0] = uri; + pseudoInputString = new StringBuilder(uri); + log.debug("uris to add" + uri); + submission.addUriToForm(this.editConfiguration, "conceptSemanticTypeURI", urisToAdd); + } + + } + //if there is more than one concept node, we may have duplicate semantic types + //which will need to be referred to by the same semantic type uri + else if (numberLabels > 1){ + + for(int i = 0; i < numberLabels; i++) { + int suffix = i + 1; + String label = conceptSemanticTypeLabels[i]; + String labelVar = this.conceptSemanticTypeLabelBase + suffix; + //if label has not already been encountered, create entry for label value + //and list with the label variables that would refer to it + //for unique values, the uri variable will be the same as label + Integer thisSuffix = new Integer(suffix); + if(!labelValueToVarSuffix.containsKey(label)) { + labelValueToVarSuffix.put(label, new ArrayList()); + //Add suffix to list if not already there + labelValueToVarSuffix.get(label).add(thisSuffix); + } else { + //in this case, the label already exists, get the very first element in the list + //and use that as the uri variable + List suffixList = labelValueToVarSuffix.get(label); + if(suffixList != null && suffixList.size() > 0) { + thisSuffix = suffixList.get(0); + } + + } + + //Now add the uri var to the hash mapping label variable to uri variable + String uriVar = this.conceptSemanticTypeURIBase + thisSuffix.intValue(); + this.labelVarToUriVarHash.put(labelVar, uriVar); + + + //Make or retrieve URI for this label + //TODO: Do we create this string with empty inputs ? + String uri = getURIForSemanticTypeLabel(label); + if(!StringUtils.isEmpty(uri)) { + //uri var shouldn't be repeated? + if(!this.conceptSemanticTypeURIVarToValueMap.containsKey(uriVar)) { + this.conceptSemanticTypeURIVarToValueMap.put(uriVar, new ArrayList()); + this.conceptSemanticTypeURIVarToValueMap.get(uriVar).add(uri); + } + } + if(i != 0) { + pseudoInputString.append(","); + } + pseudoInputString.append(uri); + + } + + //Add this string to the uris for the form + String[] urisToAdd = new String[1]; + urisToAdd[0] = pseudoInputString.toString(); + log.debug("uris to add" + pseudoInputString); + submission.addUriToForm(this.editConfiguration, "conceptSemanticTypeURI", urisToAdd); + + } + } + return pseudoInputString.toString(); + } + + private String getURIForSemanticTypeLabel(String label) { + String existingURI = this.getExistingSemanticTypeURI(label); + if(existingURI != null) { + return existingURI; + } + //if we leave this as null, we should be able to generate a new resource + //empty string because there may be more than one value returned for labels + else return ""; + + } + + private String getExistingSemanticTypeURI(String label) { + String queryStr = "SELECT ?semanticType WHERE { ?semanticType <" + RDF.type.getURI() + "> <" + OWL.Class.getURI() + "> . " + + "?semanticType <" + RDFS.label.getURI() + "> \"" + label + "\"^^ . }"; + QueryExecution qe = null; + try{ + Query query = QueryFactory.create(queryStr); + qe = QueryExecutionFactory.create(query, this.ontModel); + ResultSet results = null; + results = qe.execSelect(); + + while( results.hasNext()){ + QuerySolution qs = results.nextSolution(); + if(qs.get("semanticType") != null) { + Resource semanticTypeURI = qs.getResource("semanticType"); + log.debug("Semantic Type URI returned " + semanticTypeURI.getURI()); + return semanticTypeURI.getURI(); + } + } + }catch(Exception ex){ + throw new Error("Error in executing query string: \n" + queryStr + '\n' + ex.getMessage()); + }finally{ + if( qe != null) + qe.close(); + } + return null; + } + + private Object getFirstElement(List inputList) { + if(inputList == null || inputList.size() == 0) + return null; + return inputList.get(0); + } + + + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ConceptSemanticTypesPreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ConceptSemanticTypesPreprocessor.java index cbd7dcb4..300a21de 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ConceptSemanticTypesPreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ConceptSemanticTypesPreprocessor.java @@ -28,39 +28,39 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; public class ConceptSemanticTypesPreprocessor implements ModelChangePreprocessor { private static String VIVOCore = "http://vivoweb.org/ontology/core#"; - private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; + private static String SKOSConceptType = "http://www.w3.org/2004/02/skos/core#Concept"; private Log log = LogFactory.getLog(ConceptSemanticTypesPreprocessor.class); - + //Custom constructor public ConceptSemanticTypesPreprocessor() { } - + @Override public void preprocess(Model retractionsModel, Model additionsModel, HttpServletRequest request) { VitroRequest vreq = new VitroRequest(request); //Run a construct query against the additions model - String prefixes = "PREFIX rdfs:<" + RDFS.getURI() + "> " + - "PREFIX owl: " + - "PREFIX rdf:<" + RDF.getURI() + ">" + - "PREFIX skos:"; - String constructQuery = prefixes + " CONSTRUCT { " + - "?semanticType rdf:type owl:Class. " + - "?semanticType rdfs:subClassOf skos:Concept . " + - "?semanticType rdfs:label ?label. " + - "} WHERE { " + - "?concept rdf:type ?semanticType. " + - "?semanticType rdfs:label ?label . " + - "?semanticType rdfs:subClassOf skos:Concept . " + + String prefixes = "PREFIX rdfs:<" + RDFS.getURI() + "> " + + "PREFIX owl: " + + "PREFIX rdf:<" + RDF.getURI() + ">" + + "PREFIX skos:"; + String constructQuery = prefixes + " CONSTRUCT { " + + "?semanticType rdf:type owl:Class. " + + "?semanticType rdfs:subClassOf skos:Concept . " + + "?semanticType rdfs:label ?label. " + + "} WHERE { " + + "?concept rdf:type ?semanticType. " + + "?semanticType rdfs:label ?label . " + + "?semanticType rdfs:subClassOf skos:Concept . " + "}"; - - //Execute construct query + + //Execute construct query Model constructedModel = ModelFactory.createDefaultModel(); - - + + log.debug("CONSTRUCT query string " + constructQuery); - + Query query = null; try { query = QueryFactory.create(constructQuery, Syntax.syntaxARQ); @@ -69,13 +69,13 @@ public class ConceptSemanticTypesPreprocessor implements ModelChangePreprocessor "string. " + th.getMessage()); log.error(constructQuery); return; - } - - - + } + + + additionsModel.getLock().enterCriticalSection(Lock.READ); QueryExecution qe = null; - try { + try { qe = QueryExecutionFactory.create( query, additionsModel); qe.execConstruct(constructedModel); @@ -87,7 +87,7 @@ public class ConceptSemanticTypesPreprocessor implements ModelChangePreprocessor } additionsModel.getLock().leaveCriticalSection(); } - + //Add constructed model to the designated update model OntModel toUpdateModel = ModelAccess.on(vreq).getOntModelSelector().getTBoxModel(); toUpdateModel.enterCriticalSection(Lock.WRITE); @@ -98,7 +98,7 @@ public class ConceptSemanticTypesPreprocessor implements ModelChangePreprocessor } finally { toUpdateModel.leaveCriticalSection(); } - + //Take this constructed model and remove from the additions model additionsModel.enterCriticalSection(Lock.WRITE); try { @@ -108,9 +108,9 @@ public class ConceptSemanticTypesPreprocessor implements ModelChangePreprocessor } finally { additionsModel.leaveCriticalSection(); } - + } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ManageLabelsForPersonPreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ManageLabelsForPersonPreprocessor.java index b9321cac..ab37d978 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ManageLabelsForPersonPreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/ManageLabelsForPersonPreprocessor.java @@ -18,14 +18,14 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmis public class ManageLabelsForPersonPreprocessor extends ManageLabelsForIndividualPreprocessor { - - + + public ManageLabelsForPersonPreprocessor(EditConfigurationVTwo editConfig) { super(editConfig); - + } - + @Override public void preprocess(MultiValueEditSubmission inputSubmission, VitroRequest vreq) { //Use the ManageLabelsForIndividualPreprocessor in addition to this code specific for person @@ -42,27 +42,27 @@ public class ManageLabelsForPersonPreprocessor extends ManageLabelsForIndividual if(inputSubmission.hasLiteralValue("middleName")) { middleNames = literalsFromForm.get("middleName"); } - - + + //Expecting only one language if(firstNames.size() > 0 && lastNames.size() > 0 && newLabelLanguages.size() > 0) { Literal newLabelLanguage = newLabelLanguages.get(0); Literal firstNameLiteral = firstNames.get(0); Literal lastNameLiteral = lastNames.get(0); - + //Get the string String lang = this.getLanguage(newLabelLanguage.getString()); String firstNameValue = firstNameLiteral.getString(); String lastNameValue = lastNameLiteral.getString(); - + //Now add the language category to the literal - Literal firstNameWithLanguage = inputSubmission.createLiteral(firstNameValue, - null, + Literal firstNameWithLanguage = inputSubmission.createLiteral(firstNameValue, + null, lang); - Literal lastNameWithLanguage = inputSubmission.createLiteral(lastNameValue, - null, + Literal lastNameWithLanguage = inputSubmission.createLiteral(lastNameValue, + null, lang); - + firstNames = new ArrayList(); lastNames = new ArrayList(); firstNames.add(firstNameWithLanguage); @@ -70,25 +70,25 @@ public class ManageLabelsForPersonPreprocessor extends ManageLabelsForIndividual //replace the label with one with language, again assuming only one label being returned literalsFromForm.put("firstName", firstNames); literalsFromForm.put("lastName", lastNames); - + //Middle name handling if(middleNames.size() > 0) { Literal middleNameLiteral = middleNames.get(0); String middleNameValue = middleNameLiteral.getString(); - Literal middleNameWithLanguage = inputSubmission.createLiteral(middleNameValue, - null, + Literal middleNameWithLanguage = inputSubmission.createLiteral(middleNameValue, + null, lang); middleNames = new ArrayList(); middleNames.add(middleNameWithLanguage); literalsFromForm.put("middleName", middleNames); } - + //Set literals inputSubmission.setLiteralsFromForm(literalsFromForm); } } - + } - + } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToActivityPredicatePreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToActivityPredicatePreprocessor.java index db5e7f7f..7a4c9d71 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToActivityPredicatePreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToActivityPredicatePreprocessor.java @@ -1,34 +1,34 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; - -import java.util.Map; -import java.util.List; - -import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; - -public class RoleToActivityPredicatePreprocessor extends RoleToPredicatePreprocessor { - public RoleToActivityPredicatePreprocessor(EditConfigurationVTwo editConfig, WebappDaoFactory wadf) { - super(editConfig, wadf); - } - - protected void setupVariableNames() { - this.itemType = "roleActivityType"; - this.roleToItemPredicate = "roleToActivityPredicate"; - this.itemToRolePredicate = "activityToRolePredicate"; - } - - protected String getItemType(MultiValueEditSubmission submission) { - String type = null; - Map> urisFromForm = submission.getUrisFromForm(); - //Get the type of the activity selected - List itemTypes = urisFromForm.get(itemType); - //Really should just be one here - if(itemTypes != null && itemTypes.size() > 0) { - type = itemTypes.get(0); - } - return type; - } -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; + +import java.util.Map; +import java.util.List; + +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; + +public class RoleToActivityPredicatePreprocessor extends RoleToPredicatePreprocessor { + public RoleToActivityPredicatePreprocessor(EditConfigurationVTwo editConfig, WebappDaoFactory wadf) { + super(editConfig, wadf); + } + + protected void setupVariableNames() { + this.itemType = "roleActivityType"; + this.roleToItemPredicate = "roleToActivityPredicate"; + this.itemToRolePredicate = "activityToRolePredicate"; + } + + protected String getItemType(MultiValueEditSubmission submission) { + String type = null; + Map> urisFromForm = submission.getUrisFromForm(); + //Get the type of the activity selected + List itemTypes = urisFromForm.get(itemType); + //Really should just be one here + if(itemTypes != null && itemTypes.size() > 0) { + type = itemTypes.get(0); + } + return type; + } +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToPredicatePreprocessor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToPredicatePreprocessor.java index d7ded275..de47eaf6 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToPredicatePreprocessor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/RoleToPredicatePreprocessor.java @@ -1,83 +1,83 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; - -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.BaseEditSubmissionPreprocessorVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; - -import org.vivoweb.webapp.util.ModelUtils; - -public abstract class RoleToPredicatePreprocessor extends BaseEditSubmissionPreprocessorVTwo { - - protected static final Log log = LogFactory.getLog(RoleToPredicatePreprocessor.class.getName()); - protected WebappDaoFactory wadf = null; - protected static String itemType; - protected static String roleToItemPredicate; - protected static String itemToRolePredicate; - //Need the webapp dao factory to try to figure out what the predicate should be - public RoleToPredicatePreprocessor(EditConfigurationVTwo editConfig, WebappDaoFactory wadf) { - super(editConfig); - this.wadf = wadf; - setupVariableNames(); - } - - //Instantiate itemType etc. based on which version of preprocessor required - abstract protected void setupVariableNames(); - - public void preprocess(MultiValueEditSubmission submission, VitroRequest vreq) { - //Query for all statements using the original roleIn predicate replace - //with the appropriate roleRealizedIn or roleContributesTo - //In addition, need to ensure the inverse predicate is also set correctly - - try { - //Get the uris from form - String type = getItemType(submission); - Map> urisFromForm = submission.getUrisFromForm(); - if(type != null) { - ObjectProperty roleToItemProperty = getCorrectProperty(type, wadf); - String roleToItemPredicateURI = roleToItemProperty.getURI(); - String itemToRolePredicateURI = roleToItemProperty.getURIInverse(); - List predicates = new ArrayList(); - predicates.add(roleToItemPredicateURI); - - List inversePredicates = new ArrayList(); - inversePredicates.add(itemToRolePredicateURI); - //Populate the two fields in edit submission - if(urisFromForm.containsKey(roleToItemPredicate)) { - urisFromForm.remove(roleToItemPredicate); - } - - urisFromForm.put(roleToItemPredicate, predicates); - - if(urisFromForm.containsKey(itemToRolePredicate)) { - urisFromForm.remove(itemToRolePredicate); - } - urisFromForm.put(itemToRolePredicate, inversePredicates); - - } - - } catch (Exception e) { - log.error("Error retrieving name values from edit submission."); - } - - } - - abstract protected String getItemType(MultiValueEditSubmission submission); - - private ObjectProperty getCorrectProperty(String uri, WebappDaoFactory wadf) { - ObjectProperty correctProperty = ModelUtils.getPropertyForRoleInClass(uri, wadf); - return correctProperty; - } - -} +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors; + +import java.util.Map; +import java.util.List; +import java.util.ArrayList; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.BaseEditSubmissionPreprocessorVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission; + +import org.vivoweb.webapp.util.ModelUtils; + +public abstract class RoleToPredicatePreprocessor extends BaseEditSubmissionPreprocessorVTwo { + + protected static final Log log = LogFactory.getLog(RoleToPredicatePreprocessor.class.getName()); + protected WebappDaoFactory wadf = null; + protected static String itemType; + protected static String roleToItemPredicate; + protected static String itemToRolePredicate; + //Need the webapp dao factory to try to figure out what the predicate should be + public RoleToPredicatePreprocessor(EditConfigurationVTwo editConfig, WebappDaoFactory wadf) { + super(editConfig); + this.wadf = wadf; + setupVariableNames(); + } + + //Instantiate itemType etc. based on which version of preprocessor required + abstract protected void setupVariableNames(); + + public void preprocess(MultiValueEditSubmission submission, VitroRequest vreq) { + //Query for all statements using the original roleIn predicate replace + //with the appropriate roleRealizedIn or roleContributesTo + //In addition, need to ensure the inverse predicate is also set correctly + + try { + //Get the uris from form + String type = getItemType(submission); + Map> urisFromForm = submission.getUrisFromForm(); + if(type != null) { + ObjectProperty roleToItemProperty = getCorrectProperty(type, wadf); + String roleToItemPredicateURI = roleToItemProperty.getURI(); + String itemToRolePredicateURI = roleToItemProperty.getURIInverse(); + List predicates = new ArrayList(); + predicates.add(roleToItemPredicateURI); + + List inversePredicates = new ArrayList(); + inversePredicates.add(itemToRolePredicateURI); + //Populate the two fields in edit submission + if(urisFromForm.containsKey(roleToItemPredicate)) { + urisFromForm.remove(roleToItemPredicate); + } + + urisFromForm.put(roleToItemPredicate, predicates); + + if(urisFromForm.containsKey(itemToRolePredicate)) { + urisFromForm.remove(itemToRolePredicate); + } + urisFromForm.put(itemToRolePredicate, inversePredicates); + + } + + } catch (Exception e) { + log.error("Error retrieving name values from edit submission."); + } + + } + + abstract protected String getItemType(MultiValueEditSubmission submission); + + private ObjectProperty getCorrectProperty(String uri, WebappDaoFactory wadf) { + ObjectProperty correctProperty = ModelUtils.getPropertyForRoleInClass(uri, wadf); + return correctProperty; + } + +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java index 97dfc6dc..a89e0527 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java @@ -1,225 +1,225 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ - -package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.servlet.ServletContext; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.jena.ontology.OntModel; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.ResourceFactory; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; - -//Returns the appropriate n3 for selection of classes from within class group -public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClassesDataGetterN3 { - private static String classType = "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.InternalClassesDataGetter"; - - private static String internalClassVarNameBase = "isInternal"; - private Log log = LogFactory.getLog(ProcessInternalClassDataGetterN3.class); - - public ProcessInternalClassDataGetterN3(){ - super(); - - } - //Pass in variable that represents the counter - //Saving both type and class group here - //That can be included here if need be, but for now just adding the type alone - public List retrieveN3Required(int counter) { - return super.retrieveN3Required(counter); - } - - - //returns n3 defining internal class - private List addInternalClassN3(int counter) { - List internalClassN3 = new ArrayList(); - String dataGetterVar = getDataGetterVar(counter); - internalClassN3.add(dataGetterVar + " <" + DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> " + - this.getN3VarName(internalClassVarNameBase, counter) + " ."); - return internalClassN3; - - } - - public List retrieveN3Optional(int counter) { - List optionalN3 = new ArrayList(); - //If internal add that as well - optionalN3.addAll(this.addInternalClassN3(counter)); - return optionalN3; - } - - //These methods will return the literals and uris expected within the n3 - //and the counter is used to ensure they are numbered correctly - - public List retrieveLiteralsOnForm(int counter) { - //no literals, just the class group URI - List literalsOnForm = new ArrayList(); - literalsOnForm.add(getVarName(internalClassVarNameBase, counter)); - return literalsOnForm; - - } - - //URIs on form are same as individuals for class group so no need to reimplement - //i.e. class groups and individuals selected within class group - - public List retrieveFields(int counter) { - List fields = super.retrieveFields(counter); - fields.add(new FieldVTwo().setName(getVarName(internalClassVarNameBase, counter))); - - return fields; - } - - //These var names match the names of the elements within the json object returned with the info required for the data getter - - public List getLiteralVarNamesBase() { - return Arrays.asList(internalClassVarNameBase); - } - - //get URI Var Names base is same as ProcessIndividualsForClassGroup: classGroup and individualClassVarNameBase - - @Override - public String getClassType() { - return classType; - } - - public void populateExistingValues(String dataGetterURI, int counter, OntModel queryModel) { - //First, put dataGetterURI within scope as well - //((ProcessDataGetterAbstract)this).populateExistingDataGetterURI(dataGetterURI, counter); - this.populateExistingDataGetterURI(dataGetterURI, counter); - //Put in type - this.populateExistingClassType(this.getClassType(), counter); - //Sparql queries for values to be executed - //And then placed in the correct place/literal or uri - String querystr = getExistingValuesInternalClass(dataGetterURI); - QueryExecution qe = null; - Literal internalClassLiteral = null; - try{ - Query query = QueryFactory.create(querystr); - qe = QueryExecutionFactory.create(query, queryModel); - ResultSet results = qe.execSelect(); - String classGroupURI = null; - List individualsForClasses = new ArrayList(); - while( results.hasNext()){ - QuerySolution qs = results.nextSolution(); - //Class group - Resource classGroupResource = qs.getResource("classGroup"); - String classGroupVarName = this.getVarName(classGroupVarBase, counter); - if(classGroupURI == null) { - //Put both literals in existing literals - existingUriValues.put(this.getVarName(classGroupVarBase, counter), - new ArrayList(Arrays.asList(classGroupResource.getURI()))); - } - //Individuals For classes - Resource individualForClassResource = qs.getResource("individualForClass"); - individualsForClasses.add(individualForClassResource.getURI()); - //If internal class value is present and we have not already saved it in a previous result iteration - if(qs.get("internalClass") != null && internalClassLiteral == null) { - - internalClassLiteral= qs.getLiteral("internalClass"); - existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), - new ArrayList(Arrays.asList(internalClassLiteral))); - } - } - //Put array of individuals for classes within - existingUriValues.put(this.getVarName(individualClassVarNameBase, counter), - new ArrayList(individualsForClasses)); - //Final check, in case no internal class flag was returned, set to false - if(internalClassLiteral == null) { - existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), - new ArrayList( - Arrays.asList(ResourceFactory.createPlainLiteral("false")) - )); - } - } catch(Exception ex) { - log.error("Exception occurred in retrieving existing values with query " + querystr, ex); - } - - - } - - - //?dataGetter a FixedHTMLDataGetter ; display:saveToVar ?saveToVar; display:htmlValue ?htmlValue . - protected String getExistingValuesInternalClass(String dataGetterURI) { - String query = this.getSparqlPrefix() + " SELECT ?classGroup ?individualForClass ?internalClass WHERE {" + - "<" + dataGetterURI + "> <" + DisplayVocabulary.FOR_CLASSGROUP + "> ?classGroup . \n" + - "OPTIONAL {<" + dataGetterURI + "> <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> ?individualForClass . }\n" + - "OPTIONAL {<" + dataGetterURI + "> <" + DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> ?internalClass .} \n" + - "}"; - return query; - } - - - public ObjectNode getExistingValuesJSON(String dataGetterURI, OntModel queryModel, ServletContext context) { - ObjectNode jObject = new ObjectMapper().createObjectNode(); - jObject.put("dataGetterClass", classType); - //Update to include class type as variable - jObject.put(classTypeVarBase, classType); - //Get selected class group, if internal class, and classes selected from class group - getExistingClassGroupAndInternalClass(dataGetterURI, jObject, queryModel); - //Get all classes in the class group - ((ProcessClassGroupDataGetterN3) this).getExistingClassesInClassGroup(context, dataGetterURI, jObject); - return jObject; - } - - private void getExistingClassGroupAndInternalClass(String dataGetterURI, ObjectNode jObject, OntModel queryModel) { - String querystr = getExistingValuesInternalClass(dataGetterURI); - QueryExecution qe = null; - Literal internalClassLiteral = null; - try{ - Query query = QueryFactory.create(querystr); - qe = QueryExecutionFactory.create(query, queryModel); - ResultSet results = qe.execSelect(); - ArrayNode individualsForClasses = new ObjectMapper().createArrayNode(); - String classGroupURI = null; - while( results.hasNext()){ - QuerySolution qs = results.nextSolution(); - if(classGroupURI == null) { - Resource classGroupResource = qs.getResource("classGroup"); - classGroupURI = classGroupResource.getURI(); - } - //individuals for classes - this may also be optional in case entire class group selected and internal class - if(qs.get("individualForClass") != null ) { - Resource individualForClassResource = qs.getResource("individualForClass"); - individualsForClasses.add(individualForClassResource.getURI()); - } - //Put both literals in existing literals - //If internal class value is present and we have not already saved it in a previous result iteration - if(qs.get("internalClass") != null && internalClassLiteral == null) { - internalClassLiteral= qs.getLiteral("internalClass"); - } - } - - - jObject.put("classGroup", classGroupURI); - //this is a json array - jObject.set(individualClassVarNameBase, individualsForClasses); - //Internal class - if null then add false otherwise use the value - if(internalClassLiteral != null) { - jObject.put(internalClassVarNameBase, internalClassLiteral.getString()); - } else { - jObject.put(internalClassVarNameBase, "false"); - } - } catch(Exception ex) { - log.error("Exception occurred in retrieving existing values with query " + querystr, ex); - } - } - -} - - +/* $This file is distributed under the terms of the license in LICENSE$ */ + +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.servlet.ServletContext; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.query.Query; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QueryFactory; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.ResourceFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; + +//Returns the appropriate n3 for selection of classes from within class group +public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClassesDataGetterN3 { + private static String classType = "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.InternalClassesDataGetter"; + + private static String internalClassVarNameBase = "isInternal"; + private Log log = LogFactory.getLog(ProcessInternalClassDataGetterN3.class); + + public ProcessInternalClassDataGetterN3(){ + super(); + + } + //Pass in variable that represents the counter + //Saving both type and class group here + //That can be included here if need be, but for now just adding the type alone + public List retrieveN3Required(int counter) { + return super.retrieveN3Required(counter); + } + + + //returns n3 defining internal class + private List addInternalClassN3(int counter) { + List internalClassN3 = new ArrayList(); + String dataGetterVar = getDataGetterVar(counter); + internalClassN3.add(dataGetterVar + " <" + DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> " + + this.getN3VarName(internalClassVarNameBase, counter) + " ."); + return internalClassN3; + + } + + public List retrieveN3Optional(int counter) { + List optionalN3 = new ArrayList(); + //If internal add that as well + optionalN3.addAll(this.addInternalClassN3(counter)); + return optionalN3; + } + + //These methods will return the literals and uris expected within the n3 + //and the counter is used to ensure they are numbered correctly + + public List retrieveLiteralsOnForm(int counter) { + //no literals, just the class group URI + List literalsOnForm = new ArrayList(); + literalsOnForm.add(getVarName(internalClassVarNameBase, counter)); + return literalsOnForm; + + } + + //URIs on form are same as individuals for class group so no need to reimplement + //i.e. class groups and individuals selected within class group + + public List retrieveFields(int counter) { + List fields = super.retrieveFields(counter); + fields.add(new FieldVTwo().setName(getVarName(internalClassVarNameBase, counter))); + + return fields; + } + + //These var names match the names of the elements within the json object returned with the info required for the data getter + + public List getLiteralVarNamesBase() { + return Arrays.asList(internalClassVarNameBase); + } + + //get URI Var Names base is same as ProcessIndividualsForClassGroup: classGroup and individualClassVarNameBase + + @Override + public String getClassType() { + return classType; + } + + public void populateExistingValues(String dataGetterURI, int counter, OntModel queryModel) { + //First, put dataGetterURI within scope as well + //((ProcessDataGetterAbstract)this).populateExistingDataGetterURI(dataGetterURI, counter); + this.populateExistingDataGetterURI(dataGetterURI, counter); + //Put in type + this.populateExistingClassType(this.getClassType(), counter); + //Sparql queries for values to be executed + //And then placed in the correct place/literal or uri + String querystr = getExistingValuesInternalClass(dataGetterURI); + QueryExecution qe = null; + Literal internalClassLiteral = null; + try{ + Query query = QueryFactory.create(querystr); + qe = QueryExecutionFactory.create(query, queryModel); + ResultSet results = qe.execSelect(); + String classGroupURI = null; + List individualsForClasses = new ArrayList(); + while( results.hasNext()){ + QuerySolution qs = results.nextSolution(); + //Class group + Resource classGroupResource = qs.getResource("classGroup"); + String classGroupVarName = this.getVarName(classGroupVarBase, counter); + if(classGroupURI == null) { + //Put both literals in existing literals + existingUriValues.put(this.getVarName(classGroupVarBase, counter), + new ArrayList(Arrays.asList(classGroupResource.getURI()))); + } + //Individuals For classes + Resource individualForClassResource = qs.getResource("individualForClass"); + individualsForClasses.add(individualForClassResource.getURI()); + //If internal class value is present and we have not already saved it in a previous result iteration + if(qs.get("internalClass") != null && internalClassLiteral == null) { + + internalClassLiteral= qs.getLiteral("internalClass"); + existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), + new ArrayList(Arrays.asList(internalClassLiteral))); + } + } + //Put array of individuals for classes within + existingUriValues.put(this.getVarName(individualClassVarNameBase, counter), + new ArrayList(individualsForClasses)); + //Final check, in case no internal class flag was returned, set to false + if(internalClassLiteral == null) { + existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), + new ArrayList( + Arrays.asList(ResourceFactory.createPlainLiteral("false")) + )); + } + } catch(Exception ex) { + log.error("Exception occurred in retrieving existing values with query " + querystr, ex); + } + + + } + + + //?dataGetter a FixedHTMLDataGetter ; display:saveToVar ?saveToVar; display:htmlValue ?htmlValue . + protected String getExistingValuesInternalClass(String dataGetterURI) { + String query = this.getSparqlPrefix() + " SELECT ?classGroup ?individualForClass ?internalClass WHERE {" + + "<" + dataGetterURI + "> <" + DisplayVocabulary.FOR_CLASSGROUP + "> ?classGroup . \n" + + "OPTIONAL {<" + dataGetterURI + "> <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> ?individualForClass . }\n" + + "OPTIONAL {<" + dataGetterURI + "> <" + DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> ?internalClass .} \n" + + "}"; + return query; + } + + + public ObjectNode getExistingValuesJSON(String dataGetterURI, OntModel queryModel, ServletContext context) { + ObjectNode jObject = new ObjectMapper().createObjectNode(); + jObject.put("dataGetterClass", classType); + //Update to include class type as variable + jObject.put(classTypeVarBase, classType); + //Get selected class group, if internal class, and classes selected from class group + getExistingClassGroupAndInternalClass(dataGetterURI, jObject, queryModel); + //Get all classes in the class group + ((ProcessClassGroupDataGetterN3) this).getExistingClassesInClassGroup(context, dataGetterURI, jObject); + return jObject; + } + + private void getExistingClassGroupAndInternalClass(String dataGetterURI, ObjectNode jObject, OntModel queryModel) { + String querystr = getExistingValuesInternalClass(dataGetterURI); + QueryExecution qe = null; + Literal internalClassLiteral = null; + try{ + Query query = QueryFactory.create(querystr); + qe = QueryExecutionFactory.create(query, queryModel); + ResultSet results = qe.execSelect(); + ArrayNode individualsForClasses = new ObjectMapper().createArrayNode(); + String classGroupURI = null; + while( results.hasNext()){ + QuerySolution qs = results.nextSolution(); + if(classGroupURI == null) { + Resource classGroupResource = qs.getResource("classGroup"); + classGroupURI = classGroupResource.getURI(); + } + //individuals for classes - this may also be optional in case entire class group selected and internal class + if(qs.get("individualForClass") != null ) { + Resource individualForClassResource = qs.getResource("individualForClass"); + individualsForClasses.add(individualForClassResource.getURI()); + } + //Put both literals in existing literals + //If internal class value is present and we have not already saved it in a previous result iteration + if(qs.get("internalClass") != null && internalClassLiteral == null) { + internalClassLiteral= qs.getLiteral("internalClass"); + } + } + + + jObject.put("classGroup", classGroupURI); + //this is a json array + jObject.set(individualClassVarNameBase, individualsForClasses); + //Internal class - if null then add false otherwise use the value + if(internalClassLiteral != null) { + jObject.put(internalClassVarNameBase, internalClassLiteral.getString()); + } else { + jObject.put(internalClassVarNameBase, "false"); + } + } catch(Exception ex) { + log.error("Exception occurred in retrieving existing values with query " + querystr, ex); + } + } + +} + + diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/documentBuilding/CalculateParameters.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/documentBuilding/CalculateParameters.java index dd1768b5..3acc05c7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/documentBuilding/CalculateParameters.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/documentBuilding/CalculateParameters.java @@ -38,7 +38,7 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser private boolean shutdown = false; private volatile Dataset dataset; // public static int totalInd=1; - + private static final String prefix = "prefix owl: " + " prefix vitroDisplay: " + " prefix rdf: " @@ -48,20 +48,20 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser + " prefix localNav: " + " prefix obo: " + " prefix bibo: "; - + private static final String betaQuery = prefix + " SELECT count(distinct ?inLinks) " + " WHERE { " + " ?uri rdf:type owl:Thing . " + " ?inLinks ?prop ?uri . " + " } "; - + private static final String totalCountQuery = prefix + " SELECT count(distinct ?ind) " + " WHERE { " + " ?ind rdf:type owl:Thing . " + " } "; - + private static Log log = LogFactory.getLog(CalculateParameters.class); - + @Override public void setContextModels(ContextModelAccess models) { this.dataset = DatasetFactory.create(models.getOntModel()); @@ -69,13 +69,13 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser public float calculateBeta(String uri){ float beta=0; - int Conn=0; + int Conn=0; Query query; QuerySolutionMap initialBinding = new QuerySolutionMap(); QuerySolution soln = null; Resource uriResource = ResourceFactory.createResource(uri); initialBinding.add("uri", uriResource); - dataset.getLock().enterCriticalSection(Lock.READ); + dataset.getLock().enterCriticalSection(Lock.READ); QueryExecution qexec=null; try{ query = QueryFactory.create(betaQuery,Syntax.syntaxARQ); @@ -90,29 +90,29 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser if( ! shutdown ) log.error(t,t); }finally{ - if( qexec != null ) - qexec.close(); + if( qexec != null ) + qexec.close(); dataset.getLock().leaveCriticalSection(); } beta = (float)Conn; //beta *= 100; beta += 1; - + // sigmoid function to keep beta between 0 to 1; - + beta = (float) (1 / ( 1 + Math.pow(Math.E,(-beta)))); - + if(beta > 1) log.info("Beta higher than 1 : " + beta); else if(beta <= 0) log.info("Beta lower < = 0 : " + beta); - return beta; + return beta; } - - + + public String[] getAdjacentNodes(String uri){ - + List queryList = new ArrayList(); Set adjacentNodes = new HashSet(); Set coauthorNames = new HashSet(); @@ -121,8 +121,8 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser StringBuffer coauthorBuff = new StringBuffer(); adjacentNodesConcat.append(""); coauthorBuff.append(""); - - queryList.add(prefix + + + queryList.add(prefix + " SELECT ?adjobj (str(?adjobjLabel) as ?coauthor) " + " WHERE { " + " ?uri rdf:type . " + @@ -167,24 +167,24 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser " UNION " + " { ?adjobj rdf:type . } ." + "}"); - + Query query; - + QuerySolution soln; QuerySolutionMap initialBinding = new QuerySolutionMap(); Resource uriResource = ResourceFactory.createResource(uri); - + initialBinding.add("uri", uriResource); - + Iterator queryItr = queryList.iterator(); - + dataset.getLock().enterCriticalSection(Lock.READ); Resource adjacentIndividual = null; RDFNode coauthor = null; try{ while(queryItr.hasNext()){ /*if(!isPerson){ - queryItr.next(); // we don't want first query to execute if the ind is not a person. + queryItr.next(); // we don't want first query to execute if the ind is not a person. }*/ query = QueryFactory.create(queryItr.next(),Syntax.syntaxARQ); QueryExecution qexec = QueryExecutionFactory.create(query,dataset,initialBinding); @@ -196,35 +196,35 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser adjacentIndividual = (Resource)soln.get("adjobj"); if(adjacentIndividual!=null){ adjacentNodes.add(adjacentIndividual.getURI()); - } + } coauthor = soln.get("coauthor"); if(coauthor!=null){ coauthorNames.add(" co-authors " + coauthor.toString() + " co-authors "); - } + } } }catch(Exception e){ if( ! shutdown ) log.error("Error found in getAdjacentNodes method of SearchQueryHandler"); }finally{ qexec.close(); - } + } } - queryList = null; + queryList = null; Iterator itr = adjacentNodes.iterator(); while(itr.hasNext()){ adjacentNodesConcat.append(itr.next()).append(" "); } - + info[0] = adjacentNodesConcat.toString(); - + itr = coauthorNames.iterator(); while(itr.hasNext()){ coauthorBuff.append(itr.next()); } - + info[1] = coauthorBuff.toString(); - + } catch(Throwable t){ if( ! shutdown ) @@ -237,24 +237,24 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser } return info; } - + @Override public void modifyDocument(Individual individual, SearchInputDocument doc) { // TODO Auto-generated method stub - // calculate beta value. + // calculate beta value. log.debug("Parameter calculation starts.."); float beta = calculateBeta(individual.getURI()); doc.addField(VitroSearchTermNames.BETA, (Object) beta); - doc.setDocumentBoost(beta + doc.getDocumentBoost() ); + doc.setDocumentBoost(beta + doc.getDocumentBoost() ); log.debug("Parameter calculation is done"); } - - + + @Override public void shutdown(){ shutdown=true; } - + @Override public String toString() { @@ -267,11 +267,11 @@ class TotalInd implements Runnable{ private Dataset dataset; private String totalCountQuery; private static Log log = LogFactory.getLog(TotalInd.class); - + public TotalInd(Dataset dataset,String totalCountQuery){ this.dataset = dataset; this.totalCountQuery = totalCountQuery; - + } @Override public void run(){ @@ -280,13 +280,13 @@ class TotalInd implements Runnable{ QuerySolution soln = null; dataset.getLock().enterCriticalSection(Lock.READ); QueryExecution qexec = null; - + try{ query = QueryFactory.create(totalCountQuery,Syntax.syntaxARQ); qexec = QueryExecutionFactory.create(query,dataset); ResultSet results = qexec.execSelect(); List resultVars = results.getResultVars(); - + if(resultVars!=null && resultVars.size()!=0){ soln = results.next(); totalInd = Integer.parseInt(soln.getLiteral(resultVars.get(0)).getLexicalForm()); @@ -296,10 +296,10 @@ class TotalInd implements Runnable{ }catch(Throwable t){ log.error(t,t); }finally{ - if( qexec != null ) + if( qexec != null ) qexec.close(); dataset.getLock().leaveCriticalSection(); } - + } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodes.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodes.java index 23633602..74ce7a13 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodes.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodes.java @@ -35,22 +35,22 @@ import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation; * If an individual has context nodes then the search document for that * individual should include the labels of the partners across those nodes. The * labels will be added to the ALLTEXT and ALLTEXTUNSTEMMED fields. - * + * * We must specify what property leads to a context node (incoming), and what * property leads from a context node (outgoing). We may add restrictions to say * that this only applies to individuals of certain types. We may also restrict * the type of the applicable context nodes. - * + * * An instance of this class acts as both a DocumentModifier and an * IndexingUriFinder: - * + * * As a DocumentModifier, it looks across approved context nodes to fetch the * labels of the partners. - * + * * As an IndexingUriFinder, it recognizes that this relationship can be changed * by a change to a "label" statement, or to a "relates" property, and finds all * partners as candidates for reindexing. - * + * *
  * Configuration:
  *     rdfs:label -- Optional. Appears in the timings and debug statements.
@@ -85,7 +85,7 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
 
 	/**
 	 * URIs of the types of individuals to whom this instance applies.
-	 * 
+	 *
 	 * If this is not empty and an individual does not have any of these types,
 	 * then skip that individual.
 	 */
@@ -93,7 +93,7 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
 
 	/**
 	 * URIs of the types of acceptable context nodes.
-	 * 
+	 *
 	 * If this is not empty and a context node does not have any of these types,
 	 * then skip that context node's label.
 	 */
@@ -296,7 +296,7 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
 	/**
 	 * If this is a "label" statement, check to see if the subject has any
 	 * acceptable partners across acceptable context nodes.
-	 * 
+	 *
 	 * If this is a statement that involves the specified incoming property on
 	 * an acceptable context node, check to see if there are any acceptable
 	 * partners on this node.
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/ConceptSearchServlet.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/ConceptSearchServlet.java
index 942fdf17..2bd227f1 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/ConceptSearchServlet.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/ConceptSearchServlet.java
@@ -1,91 +1,91 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.servlet; 
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import edu.cornell.mannlib.semservices.bo.Concept;
-import edu.cornell.mannlib.semservices.bo.ConceptInfo;
-import edu.cornell.mannlib.semservices.bo.SemanticServicesError;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService.ConceptSearchServiceUtils;
-
-@WebServlet(name = "ConceptSearchService", urlPatterns = {"/conceptSearchService"} )
-public class ConceptSearchServlet extends VitroHttpServlet {
-    
-    private static final long serialVersionUID = 1L;
-    private static final Log log = LogFactory.getLog(ConceptSearchServlet.class);
-    
-    @Override
-    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-        super.doGet(req, resp);
-    }
-
-    @Override
-    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-        super.doGet(req, resp);
-        VitroRequest vreq = new VitroRequest(req);
-
-        try{
-        	ServletContext ctx = vreq.getSession().getServletContext();
-        	//Captures both concept list and any errors if they exist
-        	ConceptInfo conceptInfo = new ConceptInfo();
-    		conceptInfo.setSemanticServicesError(null);
-
-        	//Json output should be written out
-        	List results =  null;
-        	try {
-        		results = ConceptSearchServiceUtils.getSearchResults(ctx, vreq);
-        	} 
-        	catch (Exception ex) {
-        		 SemanticServicesError semanticServicesError = new SemanticServicesError(
-        	               "Exception encountered ", ex.getMessage(), "fatal");
-        		 log.error("An error occurred retrieving search results", ex);
-        		 conceptInfo.setSemanticServicesError(semanticServicesError);
-        	}
-        	conceptInfo.setConceptList(results);
-        	
-        	String json = renderJson(conceptInfo);
-        	
-        	json = StringUtils.replaceChars(json, "\r\t\n", "");
-            PrintWriter writer = resp.getWriter();
-            resp.setContentType("application/json");
-            writer.write(json);
-            writer.close();
-        	
-        }catch(Exception ex){
-            log.warn(ex,ex);            
-        }        
-    }
-    
-    
-    protected String renderJson(ConceptInfo conceptInfo) {
-    	
-		ObjectMapper mapper = new ObjectMapper();
-		try {
-			return mapper.writeValueAsString(conceptInfo);
-		} catch (JsonProcessingException e) {
-			// TODO Auto-generated catch block
-			log.error("An error occurred in rendering conceptInfo as json ", e);
-			return null;
-		}
-	}
-
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import edu.cornell.mannlib.semservices.bo.Concept;
+import edu.cornell.mannlib.semservices.bo.ConceptInfo;
+import edu.cornell.mannlib.semservices.bo.SemanticServicesError;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService.ConceptSearchServiceUtils;
+
+@WebServlet(name = "ConceptSearchService", urlPatterns = {"/conceptSearchService"} )
+public class ConceptSearchServlet extends VitroHttpServlet {
+
+    private static final long serialVersionUID = 1L;
+    private static final Log log = LogFactory.getLog(ConceptSearchServlet.class);
+
+    @Override
+    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        super.doGet(req, resp);
+    }
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        super.doGet(req, resp);
+        VitroRequest vreq = new VitroRequest(req);
+
+        try{
+        	ServletContext ctx = vreq.getSession().getServletContext();
+        	//Captures both concept list and any errors if they exist
+        	ConceptInfo conceptInfo = new ConceptInfo();
+    		conceptInfo.setSemanticServicesError(null);
+
+        	//Json output should be written out
+        	List results =  null;
+        	try {
+        		results = ConceptSearchServiceUtils.getSearchResults(ctx, vreq);
+        	}
+        	catch (Exception ex) {
+        		 SemanticServicesError semanticServicesError = new SemanticServicesError(
+        	               "Exception encountered ", ex.getMessage(), "fatal");
+        		 log.error("An error occurred retrieving search results", ex);
+        		 conceptInfo.setSemanticServicesError(semanticServicesError);
+        	}
+        	conceptInfo.setConceptList(results);
+
+        	String json = renderJson(conceptInfo);
+
+        	json = StringUtils.replaceChars(json, "\r\t\n", "");
+            PrintWriter writer = resp.getWriter();
+            resp.setContentType("application/json");
+            writer.write(json);
+            writer.close();
+
+        }catch(Exception ex){
+            log.warn(ex,ex);
+        }
+    }
+
+
+    protected String renderJson(ConceptInfo conceptInfo) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			return mapper.writeValueAsString(conceptInfo);
+		} catch (JsonProcessingException e) {
+			// TODO Auto-generated catch block
+			log.error("An error occurred in rendering conceptInfo as json ", e);
+			return null;
+		}
+	}
+
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/ConceptSearchServiceUtils.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/ConceptSearchServiceUtils.java
index 23feb3f1..70268cd9 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/ConceptSearchServiceUtils.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/ConceptSearchServiceUtils.java
@@ -1,101 +1,101 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService;
-
-import java.util.HashMap;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import edu.cornell.mannlib.semservices.bo.Concept;
-import edu.cornell.mannlib.semservices.service.ExternalConceptService;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-/**
- * Utilities for search    
- */
-public class ConceptSearchServiceUtils {
-    private static final Log log = LogFactory.getLog(ConceptSearchServiceUtils.class);
-    //Get the appropriate search service class
-    //TODO: Change this so retrieved from the system instead using a query
-    private static final String UMLSVocabSource = "http://link.informatics.stonybrook.edu/umls";
-    private static final String AgrovocVocabSource = "http://aims.fao.org/aos/agrovoc/agrovocScheme";
-    private static final String GemetVocabSource = "http://www.eionet.europa.eu/gemet/gemetThesaurus";
-    private static final String LCSHVocabSource = "http://id.loc.gov/authorities/subjects";
-
-    //Get the class that corresponds to the appropriate search
-	public static String getConceptSearchServiceClassName(String searchServiceName) {
-		HashMap map = getMapping();
-		if(map.containsKey(searchServiceName)) {
-			return map.get(searchServiceName);
-		}
-		return null;
-	}
-	
-	//Get the URLS for the different services
-	//URL to label
-	public static HashMap getVocabSources() {
-		HashMap map = new HashMap();
-    	map.put(UMLSVocabSource, new VocabSourceDescription("UMLS", UMLSVocabSource, "http://www.nlm.nih.gov/research/umls/", "Unified Medical Language System"));
-    	//Commenting out agrovoc for now until implementation is updated
-    	map.put(AgrovocVocabSource, new VocabSourceDescription("AGROVOC", AgrovocVocabSource, "http://www.fao.org/agrovoc/", "Agricultural Vocabulary"));
-    	map.put(GemetVocabSource, new VocabSourceDescription("GEMET", GemetVocabSource, "http://www.eionet.europa.eu/gemet", "GEneral Multilingual Environmental Thesaurus"));
-    	map.put(LCSHVocabSource, new VocabSourceDescription("LCSH", LCSHVocabSource, "http://id.loc.gov/authorities/subjects/", "Library of Congress Subject Headings"));
-
-    	return map;
-	}
-	
-	//Get additional vocab source info
-	
-    
-    //Get the hashmap mapping service name to Service class
-    private static HashMap getMapping() {
-    	HashMap map = new HashMap();
-    	map.put(UMLSVocabSource, "edu.cornell.mannlib.semservices.service.impl.UMLSService");
-    	map.put(AgrovocVocabSource, "edu.cornell.mannlib.semservices.service.impl.AgrovocService");
-    	map.put(GemetVocabSource, "edu.cornell.mannlib.semservices.service.impl.GemetService");
-    	map.put(LCSHVocabSource, "edu.cornell.mannlib.semservices.service.impl.LCSHService");
-
-    	return map;
-    }
-    
-    public static List getSearchResults(ServletContext context, VitroRequest vreq) throws Exception {
-    	String searchServiceName = getSearchServiceUri(vreq);
-    	String searchServiceClassName = getConceptSearchServiceClassName(searchServiceName);
-    
-    	ExternalConceptService conceptServiceClass = null;
-	
-	    Object object = null;
-	    try {
-	        Class classDefinition = Class.forName(searchServiceClassName);
-	        object = classDefinition.newInstance();
-	        conceptServiceClass = (ExternalConceptService) object;
-	    } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
-	        System.out.println(e);
-	    }
-
-        if(conceptServiceClass == null){
-	    	log.error("could not find Concept Search Class for " + searchServiceName);
-	    	return null;
-	    } 
-	    
-	    //Get search
-	    String searchTerm = getSearchTerm(vreq);
-	    List conceptResults =  conceptServiceClass.getConcepts(searchTerm);
-	    return conceptResults;
-    }
-
-
-	private static String getSearchServiceUri(VitroRequest vreq) {
-		return vreq.getParameter("source");
-	}
-
-	private static String getSearchTerm(VitroRequest vreq) {
-		return vreq.getParameter("searchTerm");
-	}
-	
-
-}
-
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService;
+
+import java.util.HashMap;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import edu.cornell.mannlib.semservices.bo.Concept;
+import edu.cornell.mannlib.semservices.service.ExternalConceptService;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+/**
+ * Utilities for search
+ */
+public class ConceptSearchServiceUtils {
+    private static final Log log = LogFactory.getLog(ConceptSearchServiceUtils.class);
+    //Get the appropriate search service class
+    //TODO: Change this so retrieved from the system instead using a query
+    private static final String UMLSVocabSource = "http://link.informatics.stonybrook.edu/umls";
+    private static final String AgrovocVocabSource = "http://aims.fao.org/aos/agrovoc/agrovocScheme";
+    private static final String GemetVocabSource = "http://www.eionet.europa.eu/gemet/gemetThesaurus";
+    private static final String LCSHVocabSource = "http://id.loc.gov/authorities/subjects";
+
+    //Get the class that corresponds to the appropriate search
+	public static String getConceptSearchServiceClassName(String searchServiceName) {
+		HashMap map = getMapping();
+		if(map.containsKey(searchServiceName)) {
+			return map.get(searchServiceName);
+		}
+		return null;
+	}
+
+	//Get the URLS for the different services
+	//URL to label
+	public static HashMap getVocabSources() {
+		HashMap map = new HashMap();
+    	map.put(UMLSVocabSource, new VocabSourceDescription("UMLS", UMLSVocabSource, "http://www.nlm.nih.gov/research/umls/", "Unified Medical Language System"));
+    	//Commenting out agrovoc for now until implementation is updated
+    	map.put(AgrovocVocabSource, new VocabSourceDescription("AGROVOC", AgrovocVocabSource, "http://www.fao.org/agrovoc/", "Agricultural Vocabulary"));
+    	map.put(GemetVocabSource, new VocabSourceDescription("GEMET", GemetVocabSource, "http://www.eionet.europa.eu/gemet", "GEneral Multilingual Environmental Thesaurus"));
+    	map.put(LCSHVocabSource, new VocabSourceDescription("LCSH", LCSHVocabSource, "http://id.loc.gov/authorities/subjects/", "Library of Congress Subject Headings"));
+
+    	return map;
+	}
+
+	//Get additional vocab source info
+
+
+    //Get the hashmap mapping service name to Service class
+    private static HashMap getMapping() {
+    	HashMap map = new HashMap();
+    	map.put(UMLSVocabSource, "edu.cornell.mannlib.semservices.service.impl.UMLSService");
+    	map.put(AgrovocVocabSource, "edu.cornell.mannlib.semservices.service.impl.AgrovocService");
+    	map.put(GemetVocabSource, "edu.cornell.mannlib.semservices.service.impl.GemetService");
+    	map.put(LCSHVocabSource, "edu.cornell.mannlib.semservices.service.impl.LCSHService");
+
+    	return map;
+    }
+
+    public static List getSearchResults(ServletContext context, VitroRequest vreq) throws Exception {
+    	String searchServiceName = getSearchServiceUri(vreq);
+    	String searchServiceClassName = getConceptSearchServiceClassName(searchServiceName);
+
+    	ExternalConceptService conceptServiceClass = null;
+
+	    Object object = null;
+	    try {
+	        Class classDefinition = Class.forName(searchServiceClassName);
+	        object = classDefinition.newInstance();
+	        conceptServiceClass = (ExternalConceptService) object;
+	    } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
+	        System.out.println(e);
+	    }
+
+        if(conceptServiceClass == null){
+	    	log.error("could not find Concept Search Class for " + searchServiceName);
+	    	return null;
+	    }
+
+	    //Get search
+	    String searchTerm = getSearchTerm(vreq);
+	    List conceptResults =  conceptServiceClass.getConcepts(searchTerm);
+	    return conceptResults;
+    }
+
+
+	private static String getSearchServiceUri(VitroRequest vreq) {
+		return vreq.getParameter("source");
+	}
+
+	private static String getSearchTerm(VitroRequest vreq) {
+		return vreq.getParameter("searchTerm");
+	}
+
+
+}
+
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/VocabSourceDescription.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/VocabSourceDescription.java
index 3119b4ea..654e862d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/VocabSourceDescription.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/ConceptSearchService/VocabSourceDescription.java
@@ -1,33 +1,33 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService;
-
-public class VocabSourceDescription {
-	private String url;
-	private String label;
-	private String schema;
-	private String description;
-	
-	public VocabSourceDescription(String inputLabel, String inputSchema, String inputUrl, String inputDescription) {
-		url = inputUrl;
-		label = inputLabel;
-		schema = inputSchema;
-		description = inputDescription;
-	}
-	
-	public String getUrl() {
-		return url;
-	}
-	
-	public String getLabel() {
-		return label;
-	}
-	
-	public String getSchema() {
-		return schema;
-	}
-	
-	public String getDescription() {
-		return description;
-	}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.utils.ConceptSearchService;
+
+public class VocabSourceDescription {
+	private String url;
+	private String label;
+	private String schema;
+	private String description;
+
+	public VocabSourceDescription(String inputLabel, String inputSchema, String inputUrl, String inputDescription) {
+		url = inputUrl;
+		label = inputLabel;
+		schema = inputSchema;
+		description = inputDescription;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public String getSchema() {
+		return schema;
+	}
+
+	public String getDescription() {
+		return description;
+	}
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/InternalClassesDataGetter.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/InternalClassesDataGetter.java
index 38f7b953..bc03e54f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/InternalClassesDataGetter.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/InternalClassesDataGetter.java
@@ -1,135 +1,135 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.utils.dataGetter;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jena.query.Query;
-import org.apache.jena.query.QueryExecution;
-import org.apache.jena.query.QueryExecutionFactory;
-import org.apache.jena.query.QueryFactory;
-import org.apache.jena.query.QuerySolution;
-import org.apache.jena.query.QuerySolutionMap;
-import org.apache.jena.query.ResultSet;
-import org.apache.jena.rdf.model.Model;
-import org.apache.jena.rdf.model.RDFNode;
-import org.apache.jena.rdf.model.ResourceFactory;
-import org.apache.jena.rdf.model.Statement;
-import org.apache.jena.rdf.model.StmtIterator;
-
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
-import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
-import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
-import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames;
-
-/**
- * This will pass these variables to the template:
- * classGroupUri: uri of the classgroup associated with this page.
- * vClassGroup: a data structure that is the classgroup associated with this page.     
- */
-public class InternalClassesDataGetter extends IndividualsForClassesDataGetter{
-    private static final Log log = LogFactory.getLog(InternalClassesDataGetter.class);
-    
-    /**
-     * Constructor with display model and data getter URI that will be called by reflection.
-     */
-    public InternalClassesDataGetter(VitroRequest vreq, Model displayModel, String dataGetterURI){
-        super(vreq, displayModel, dataGetterURI);
-    }   
-    
-    
-    //Use different template name for internal class template
-    @Override
-    protected void setTemplateName() {
-    	super.restrictClassesTemplateName = "internalClass";
-    }
-    
-    //Retrieve classes and check whether or not page to be filtered by internal class only 
-    @Override
-    protected Map getClassIntersectionsMap(Model displayModel) {
-
-    	Map classesAndRestrictions = new HashMap();
-    	QuerySolutionMap initialBindings = new QuerySolutionMap();
-        initialBindings.add("dataGetterUri", ResourceFactory.createResource(this.dataGetterURI));
-        List classes = new ArrayList();
-       
-        displayModel.enterCriticalSection(false);
-        try{
-        	Query individualsForClassesInternalQuery = QueryFactory.create(individualsForClassesInternalQueryString);
-            QueryExecution qexec = QueryExecutionFactory.create( individualsForClassesInternalQuery, displayModel , initialBindings);
-            try{
-                ResultSet resultSet = qexec.execSelect();        
-                while(resultSet.hasNext()){
-                    QuerySolution soln = resultSet.next();
-                    String dg = DataGetterUtils.nodeToString(soln.get("dg"));
-                    classes.add(DataGetterUtils.nodeToString(soln.get("class")));
-                    //node to string will convert null to empty string
-                    String isInternal = DataGetterUtils.nodeToString(soln.get("isInternal"));
-                    if(!isInternal.isEmpty()) {
-                    	log.debug("Internal value is "+ isInternal);
-                    	//Retrieve and add internal class
-                    	classesAndRestrictions.put("isInternal", isInternal);
-                    }
-                }
-                
-                if( classes.size() == 0 ){
-                    log.debug("No classes  defined in display model for "+ this.dataGetterURI);
-                    return null;
-                }
-                classesAndRestrictions.put("classes", classes);  
-                return classesAndRestrictions;
-            }finally{
-                qexec.close();
-            }
-        }finally{
-            displayModel.leaveCriticalSection();
-        }
-	}
-
-
-    //Retrieve current internal class uri to restrict by
-	@Override
-	protected List retrieveRestrictClasses(
-			ServletContext context, Map classIntersectionsMap) {
-		List restrictClasses = new ArrayList();
-		String internalClass = (String) classIntersectionsMap.get("isInternal");
-		//if internal class restriction specified and is true
-		if(internalClass != null && internalClass.equals("true")) {
-			//Get internal class
-			Model mainModel = ModelAccess.on(context).getOntModel(ModelNames.TBOX_ASSERTIONS); 
-			StmtIterator internalIt = mainModel.listStatements(null, ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), (RDFNode) null);
-			//Checks for just one statement 
-			if(internalIt.hasNext()){
-				Statement s = internalIt.nextStatement();
-				//The class IS an internal class so the subject is what we're looking for
-				String internalClassUri = s.getSubject().getURI();
-				log.debug("Found internal class uri " + internalClassUri);
-				restrictClasses.add(internalClassUri);
-			}
-		}
-			
-		return restrictClasses;
-	}        
-	
-	@Override
-    public String getType(){
-        return DataGetterUtils.generateDataGetterTypeURI(InternalClassesDataGetter.class.getName());
-    } 
-	
-    static final protected String individualsForClassesInternalQueryString = 
-    	DataGetterUtils.prefixes + "\n" + 
-    	 "SELECT?class ?isInternal WHERE {\n" +
-         " ?dataGetterUri <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> ?class . \n" +
-         " OPTIONAL {  ?dataGetterUri <"+ DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> ?isInternal } .\n" +    
-         "} \n" ;
-    
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.utils.dataGetter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.jena.query.Query;
+import org.apache.jena.query.QueryExecution;
+import org.apache.jena.query.QueryExecutionFactory;
+import org.apache.jena.query.QueryFactory;
+import org.apache.jena.query.QuerySolution;
+import org.apache.jena.query.QuerySolutionMap;
+import org.apache.jena.query.ResultSet;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.RDFNode;
+import org.apache.jena.rdf.model.ResourceFactory;
+import org.apache.jena.rdf.model.Statement;
+import org.apache.jena.rdf.model.StmtIterator;
+
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
+import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames;
+
+/**
+ * This will pass these variables to the template:
+ * classGroupUri: uri of the classgroup associated with this page.
+ * vClassGroup: a data structure that is the classgroup associated with this page.
+ */
+public class InternalClassesDataGetter extends IndividualsForClassesDataGetter{
+    private static final Log log = LogFactory.getLog(InternalClassesDataGetter.class);
+
+    /**
+     * Constructor with display model and data getter URI that will be called by reflection.
+     */
+    public InternalClassesDataGetter(VitroRequest vreq, Model displayModel, String dataGetterURI){
+        super(vreq, displayModel, dataGetterURI);
+    }
+
+
+    //Use different template name for internal class template
+    @Override
+    protected void setTemplateName() {
+    	super.restrictClassesTemplateName = "internalClass";
+    }
+
+    //Retrieve classes and check whether or not page to be filtered by internal class only
+    @Override
+    protected Map getClassIntersectionsMap(Model displayModel) {
+
+    	Map classesAndRestrictions = new HashMap();
+    	QuerySolutionMap initialBindings = new QuerySolutionMap();
+        initialBindings.add("dataGetterUri", ResourceFactory.createResource(this.dataGetterURI));
+        List classes = new ArrayList();
+
+        displayModel.enterCriticalSection(false);
+        try{
+        	Query individualsForClassesInternalQuery = QueryFactory.create(individualsForClassesInternalQueryString);
+            QueryExecution qexec = QueryExecutionFactory.create( individualsForClassesInternalQuery, displayModel , initialBindings);
+            try{
+                ResultSet resultSet = qexec.execSelect();
+                while(resultSet.hasNext()){
+                    QuerySolution soln = resultSet.next();
+                    String dg = DataGetterUtils.nodeToString(soln.get("dg"));
+                    classes.add(DataGetterUtils.nodeToString(soln.get("class")));
+                    //node to string will convert null to empty string
+                    String isInternal = DataGetterUtils.nodeToString(soln.get("isInternal"));
+                    if(!isInternal.isEmpty()) {
+                    	log.debug("Internal value is "+ isInternal);
+                    	//Retrieve and add internal class
+                    	classesAndRestrictions.put("isInternal", isInternal);
+                    }
+                }
+
+                if( classes.size() == 0 ){
+                    log.debug("No classes  defined in display model for "+ this.dataGetterURI);
+                    return null;
+                }
+                classesAndRestrictions.put("classes", classes);
+                return classesAndRestrictions;
+            }finally{
+                qexec.close();
+            }
+        }finally{
+            displayModel.leaveCriticalSection();
+        }
+	}
+
+
+    //Retrieve current internal class uri to restrict by
+	@Override
+	protected List retrieveRestrictClasses(
+			ServletContext context, Map classIntersectionsMap) {
+		List restrictClasses = new ArrayList();
+		String internalClass = (String) classIntersectionsMap.get("isInternal");
+		//if internal class restriction specified and is true
+		if(internalClass != null && internalClass.equals("true")) {
+			//Get internal class
+			Model mainModel = ModelAccess.on(context).getOntModel(ModelNames.TBOX_ASSERTIONS);
+			StmtIterator internalIt = mainModel.listStatements(null, ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), (RDFNode) null);
+			//Checks for just one statement
+			if(internalIt.hasNext()){
+				Statement s = internalIt.nextStatement();
+				//The class IS an internal class so the subject is what we're looking for
+				String internalClassUri = s.getSubject().getURI();
+				log.debug("Found internal class uri " + internalClassUri);
+				restrictClasses.add(internalClassUri);
+			}
+		}
+
+		return restrictClasses;
+	}
+
+	@Override
+    public String getType(){
+        return DataGetterUtils.generateDataGetterTypeURI(InternalClassesDataGetter.class.getName());
+    }
+
+    static final protected String individualsForClassesInternalQueryString =
+    	DataGetterUtils.prefixes + "\n" +
+    	 "SELECT?class ?isInternal WHERE {\n" +
+         " ?dataGetterUri <" + DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS + "> ?class . \n" +
+         " OPTIONAL {  ?dataGetterUri <"+ DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL + "> ?isInternal } .\n" +
+         "} \n" ;
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/ProcessInternalClasses.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/ProcessInternalClasses.java
index e596e03f..79eb6b84 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/ProcessInternalClasses.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/ProcessInternalClasses.java
@@ -1,82 +1,82 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.utils.menuManagement;
-
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jena.rdf.model.Model;
-import org.apache.jena.rdf.model.ModelFactory;
-import org.apache.jena.rdf.model.Resource;
-import org.apache.jena.rdf.model.ResourceFactory;
-import org.apache.jena.vocabulary.RDF;
-
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
-import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterUtils;
-import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.InternalClassesDataGetter;
-
-/*
- * Handle processing of data retrieved from IndividualsForClasses data getter to return to form template
- * and handle processing of form submission to create the appropriate individuals for classes data getter
- */
-public class ProcessInternalClasses extends ProcessIndividualsForClasses {
-    private static final Log log = LogFactory.getLog(ProcessInternalClasses.class);
-
-   /**Retrieve and populate**/
-    
-  //Based on institutional internal page and not general individualsForClasses
-    @Override
-    protected void populateRestrictedClasses(Map pageData, Map templateData) {
-    	//for internal page, restrict results by internal is true or false, otherwise get
-		//actual restriction classes?
-		//Get internal class
-		String internalClassUris = (String) pageData.get("internalClass");
-		if(internalClassUris != null && !internalClassUris.isEmpty()) {
-			templateData.put("isInternal", "true");
-		}
-    }
-    
-	/**Process submission**/
-	//Check and see if we should use this process
-	//Use this if either internal class is selected or all classes have been selected
-	public boolean useProcessor(VitroRequest vreq) {
-		return(internalClassSelected(vreq) || !allClassesSelected(vreq));
-	}
-	public  Model processSubmission(VitroRequest vreq, Resource dataGetterResource) {
-		String dataGetterTypeUri = DataGetterUtils.generateDataGetterTypeURI(InternalClassesDataGetter.class.getName());
-		String[] selectedClasses = vreq.getParameterValues("classInClassGroup");
-		Model dgModel = ModelFactory.createDefaultModel();
-		dgModel.add(dgModel.createStatement(dataGetterResource, 
-				RDF.type, 
-				ResourceFactory.createResource(dataGetterTypeUri)));
-		for(String classUri: selectedClasses) {
-			dgModel.add(dgModel.createStatement(
-					dataGetterResource, 
-					ResourceFactory.createProperty(DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS),
-					ResourceFactory.createResource(classUri)));
-		}
-		
-		//Also check if internal class checked
-		if(internalClassSelected(vreq)) {
-			dgModel.add(dgModel.createStatement(
-					dataGetterResource, 
-					ResourceFactory.createProperty(DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL),
-					dgModel.createLiteral("true")));
-		}
-		return dgModel;
-	}
-	
-	private  boolean allClassesSelected(VitroRequest vreq) {
-			String allClasses = vreq.getParameter("allSelected");
-			return (allClasses != null && !allClasses.isEmpty());
-	}
-		
-	private  boolean internalClassSelected(VitroRequest vreq) {
-	    String internalClass = vreq.getParameter("display-internalClass");
-	    return (internalClass != null && !internalClass.isEmpty());
-	}		
-		
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.utils.menuManagement;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.rdf.model.ResourceFactory;
+import org.apache.jena.vocabulary.RDF;
+
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
+import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterUtils;
+import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.InternalClassesDataGetter;
+
+/*
+ * Handle processing of data retrieved from IndividualsForClasses data getter to return to form template
+ * and handle processing of form submission to create the appropriate individuals for classes data getter
+ */
+public class ProcessInternalClasses extends ProcessIndividualsForClasses {
+    private static final Log log = LogFactory.getLog(ProcessInternalClasses.class);
+
+   /**Retrieve and populate**/
+
+  //Based on institutional internal page and not general individualsForClasses
+    @Override
+    protected void populateRestrictedClasses(Map pageData, Map templateData) {
+    	//for internal page, restrict results by internal is true or false, otherwise get
+		//actual restriction classes?
+		//Get internal class
+		String internalClassUris = (String) pageData.get("internalClass");
+		if(internalClassUris != null && !internalClassUris.isEmpty()) {
+			templateData.put("isInternal", "true");
+		}
+    }
+
+	/**Process submission**/
+	//Check and see if we should use this process
+	//Use this if either internal class is selected or all classes have been selected
+	public boolean useProcessor(VitroRequest vreq) {
+		return(internalClassSelected(vreq) || !allClassesSelected(vreq));
+	}
+	public  Model processSubmission(VitroRequest vreq, Resource dataGetterResource) {
+		String dataGetterTypeUri = DataGetterUtils.generateDataGetterTypeURI(InternalClassesDataGetter.class.getName());
+		String[] selectedClasses = vreq.getParameterValues("classInClassGroup");
+		Model dgModel = ModelFactory.createDefaultModel();
+		dgModel.add(dgModel.createStatement(dataGetterResource,
+				RDF.type,
+				ResourceFactory.createResource(dataGetterTypeUri)));
+		for(String classUri: selectedClasses) {
+			dgModel.add(dgModel.createStatement(
+					dataGetterResource,
+					ResourceFactory.createProperty(DisplayVocabulary.GETINDIVIDUALS_FOR_CLASS),
+					ResourceFactory.createResource(classUri)));
+		}
+
+		//Also check if internal class checked
+		if(internalClassSelected(vreq)) {
+			dgModel.add(dgModel.createStatement(
+					dataGetterResource,
+					ResourceFactory.createProperty(DisplayVocabulary.RESTRICT_RESULTS_BY_INTERNAL),
+					dgModel.createLiteral("true")));
+		}
+		return dgModel;
+	}
+
+	private  boolean allClassesSelected(VitroRequest vreq) {
+			String allClasses = vreq.getParameter("allSelected");
+			return (allClasses != null && !allClasses.isEmpty());
+	}
+
+	private  boolean internalClassSelected(VitroRequest vreq) {
+	    String internalClass = vreq.getParameter("display-internalClass");
+	    return (internalClass != null && !internalClass.isEmpty());
+	}
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/VIVOMenuManagementDataUtils.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/VIVOMenuManagementDataUtils.java
index 67d60a20..5e9a543c 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/VIVOMenuManagementDataUtils.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/menuManagement/VIVOMenuManagementDataUtils.java
@@ -1,60 +1,60 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.utils.menuManagement;
-
-import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSERTIONS;
-
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jena.ontology.OntModel;
-import org.apache.jena.rdf.model.RDFNode;
-import org.apache.jena.rdf.model.ResourceFactory;
-import org.apache.jena.rdf.model.StmtIterator;
-
-import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
-import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
-
-/*
- * This class includes methods that help in selecting a data getter based on 
- * parameters, and VIVO will have its own version or extend this
- */
-public class VIVOMenuManagementDataUtils implements MenuManagementDataUtils.IMenuManagementDataUtils {
-    private static final Log log = LogFactory.getLog(VIVOMenuManagementDataUtils.class);
-
-    //Data that is to be returned to template that does not involve data getters
-    //e.g. what are the current class groups, etc.
-    public void includeRequiredSystemData(ServletContext context, Map templateData) {
-    	checkInstitutionalInternalClass(context, templateData);
-    }
-    
-	//Check whether any classes exist with internal class restrictions
-	private void checkInstitutionalInternalClass(ServletContext context, Map templateData) {
-		//TODO: replace with more generic ModelContext retrieval method
-		String internalClass = retrieveInternalClass(context);
-		if(internalClass != null) {			
-			templateData.put("internalClass", internalClass);
-			templateData.put("internalClassUri", internalClass);
-		} else {
-			//need to initialize to empty string anyway
-			templateData.put("internalClassUri", "");
-		}
-		
-	}
-	
-	private String retrieveInternalClass(ServletContext context) {
-		OntModel mainModel = ModelAccess.on(context).getOntModel(TBOX_ASSERTIONS);
- 		StmtIterator internalIt = mainModel.listStatements(null, ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), (RDFNode) null);
-		if(internalIt.hasNext()) {			
-			String internalClass = internalIt.nextStatement().getSubject().getURI();
-			return internalClass;
-		}
-		return null;
-	}
-
-    
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.utils.menuManagement;
+
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSERTIONS;
+
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.jena.ontology.OntModel;
+import org.apache.jena.rdf.model.RDFNode;
+import org.apache.jena.rdf.model.ResourceFactory;
+import org.apache.jena.rdf.model.StmtIterator;
+
+import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
+
+/*
+ * This class includes methods that help in selecting a data getter based on
+ * parameters, and VIVO will have its own version or extend this
+ */
+public class VIVOMenuManagementDataUtils implements MenuManagementDataUtils.IMenuManagementDataUtils {
+    private static final Log log = LogFactory.getLog(VIVOMenuManagementDataUtils.class);
+
+    //Data that is to be returned to template that does not involve data getters
+    //e.g. what are the current class groups, etc.
+    public void includeRequiredSystemData(ServletContext context, Map templateData) {
+    	checkInstitutionalInternalClass(context, templateData);
+    }
+
+	//Check whether any classes exist with internal class restrictions
+	private void checkInstitutionalInternalClass(ServletContext context, Map templateData) {
+		//TODO: replace with more generic ModelContext retrieval method
+		String internalClass = retrieveInternalClass(context);
+		if(internalClass != null) {
+			templateData.put("internalClass", internalClass);
+			templateData.put("internalClassUri", internalClass);
+		} else {
+			//need to initialize to empty string anyway
+			templateData.put("internalClassUri", "");
+		}
+
+	}
+
+	private String retrieveInternalClass(ServletContext context) {
+		OntModel mainModel = ModelAccess.on(context).getOntModel(TBOX_ASSERTIONS);
+ 		StmtIterator internalIt = mainModel.listStatements(null, ResourceFactory.createProperty(VitroVocabulary.IS_INTERNAL_CLASSANNOT), (RDFNode) null);
+		if(internalIt.hasNext()) {
+			String internalClass = internalIt.nextStatement().getSubject().getURI();
+			return internalClass;
+		}
+		return null;
+	}
+
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipGraphMLWriter.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipGraphMLWriter.java
index 556a22ed..85bc06c4 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipGraphMLWriter.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipGraphMLWriter.java
@@ -1,332 +1,332 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
-
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationComparator;
-import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationData;
-import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaboratorComparator;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-public class CoAuthorshipGraphMLWriter {
-	
-	private StringBuilder coAuthorshipGraphMLContent;
-
-	private final String GRAPHML_NS = "http://graphml.graphdrawing.org/xmlns";
-	
-	public CoAuthorshipGraphMLWriter(CollaborationData visVOContainer) {
-		coAuthorshipGraphMLContent = createCoAuthorshipGraphMLContent(visVOContainer);
-	}
-
-	private StringBuilder createCoAuthorshipGraphMLContent(CollaborationData coAuthorshipData) {
-
-		StringBuilder graphMLContent = new StringBuilder();
-
-		try {
-			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
-			docFactory.setNamespaceAware(true);
-			DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
-
-			// root elements
-			Document doc = docBuilder.newDocument();
-			doc.setXmlVersion("1.0");
-			Element rootElement = doc.createElementNS(GRAPHML_NS, "graphml");
-			doc.appendChild(rootElement);
-
-			/*
-			 * We are side-effecting "graphMLContent" object in this method since creating
-			 * another String object to hold key definition data will be redundant & will
-			 * not serve the purpose.
-			 * */
-			generateKeyDefinitionContent(coAuthorshipData, rootElement);
-
-			/*
-			 * Used to generate graph content. It will contain both the nodes & edge information.
-			 * We are side-effecting "graphMLContent".
-			 * */
-			generateGraphContent(coAuthorshipData, rootElement);
-
-			DOMSource source = new DOMSource(doc);
-			TransformerFactory transFactory = TransformerFactory.newInstance();
-			Transformer transformer = transFactory.newTransformer();
-			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
-			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-
-			StringWriter writer = new StringWriter();
-			StreamResult result = new StreamResult(writer);
-			transformer.transform(source, result);
-
-			graphMLContent.append(writer.toString());
-		} catch (ParserConfigurationException | TransformerException e) {
-			throw new IllegalStateException("XML error generating GraphML", e);
-		}
-
-        return graphMLContent;
-	}
-	
-	public StringBuilder getCoAuthorshipGraphMLContent() {
-		return coAuthorshipGraphMLContent;
-	}
-
-	private void generateGraphContent(CollaborationData coAuthorshipData, Element rootElement) {
-		Document doc = rootElement.getOwnerDocument();
-
-		Element graph = doc.createElementNS(GRAPHML_NS, "graph");
-		graph.setAttribute("edgedefault", "undirected");
-		rootElement.appendChild(graph);
-
-		if (coAuthorshipData.getCollaborators() != null && coAuthorshipData.getCollaborators().size() > 0) {
-			generateNodeSectionContent(coAuthorshipData, graph);
-		}
-		
-		if (coAuthorshipData.getCollaborations() != null && coAuthorshipData.getCollaborations().size() > 0) {
-			generateEdgeSectionContent(coAuthorshipData, graph);
-		}
-	}
-
-	private void generateEdgeSectionContent(CollaborationData coAuthorshipData, Element graphElement) {
-		Document doc = graphElement.getOwnerDocument();
-
-		graphElement.appendChild(doc.createComment("edges"));
-
-		Set  edges = coAuthorshipData.getCollaborations();
-		List orderedEdges = new ArrayList(edges);
-		orderedEdges.sort(new CollaborationComparator());
-
-		for (Collaboration currentEdge : orderedEdges) {
-			/*
-			 * This method actually creates the XML code for a single Collaboration. 
-			 * "graphMLContent" is being side-effected. 
-			 * */
-			getEdgeContent(graphElement, currentEdge);
-		}
-	}
-
-	private void getEdgeContent(Element graphElement, Collaboration currentEdge) {
-		Document doc = graphElement.getOwnerDocument();
-
-		Element edge = doc.createElementNS(GRAPHML_NS, "edge");
-		edge.setAttribute("id", String.valueOf(currentEdge.getCollaborationID()));
-		edge.setAttribute("source", String.valueOf(currentEdge.getSourceCollaborator().getCollaboratorID()));
-		edge.setAttribute("target", String.valueOf(currentEdge.getTargetCollaborator().getCollaboratorID()));
-		graphElement.appendChild(edge);
-
-		Element collaborator1 = doc.createElementNS(GRAPHML_NS, "data");
-		collaborator1.setAttribute("key", "collaborator1");
-		collaborator1.setTextContent(currentEdge.getSourceCollaborator().getCollaboratorName());
-		edge.appendChild(collaborator1);
-
-		Element collaborator2 = doc.createElementNS(GRAPHML_NS, "data");
-		collaborator2.setAttribute("key", "collaborator2");
-		collaborator2.setTextContent(currentEdge.getTargetCollaborator().getCollaboratorName());
-		edge.appendChild(collaborator2);
-
-		Element works = doc.createElementNS(GRAPHML_NS, "data");
-		works.setAttribute("key", "number_of_coauthored_works");
-		works.setTextContent(String.valueOf(currentEdge.getNumOfCollaborations()));
-		edge.appendChild(works);
-
-		if (currentEdge.getEarliestCollaborationYearCount() != null) {
-			/*
-			 * There is no clean way of getting the map contents in java even though
-			 * we are sure to have only one entry on the map. So using the for loop.
-			 * */
-			for (Map.Entry publicationInfo : currentEdge.getEarliestCollaborationYearCount().entrySet()) {
-
-				Element earliest = doc.createElementNS(GRAPHML_NS, "data");
-				earliest.setAttribute("key", "earliest_collaboration");
-				earliest.setTextContent(publicationInfo.getKey());
-				edge.appendChild(earliest);
-
-				Element earliestCount = doc.createElementNS(GRAPHML_NS, "data");
-				earliestCount.setAttribute("key", "num_earliest_collaboration");
-				earliestCount.setTextContent(publicationInfo.getValue().toString());
-				edge.appendChild(earliestCount);
-			}
-		}
-		
-		if (currentEdge.getLatestCollaborationYearCount() != null) {
-			for (Map.Entry publicationInfo : currentEdge.getLatestCollaborationYearCount().entrySet()) {
-				Element latest = doc.createElementNS(GRAPHML_NS, "data");
-				latest.setAttribute("key", "latest_collaboration");
-				latest.setTextContent(publicationInfo.getKey());
-				edge.appendChild(latest);
-
-				Element latestCount = doc.createElementNS(GRAPHML_NS, "data");
-				latestCount.setAttribute("key", "num_latest_collaboration");
-				latestCount.setTextContent(publicationInfo.getValue().toString());
-				edge.appendChild(latestCount);
-			}
-		}
-		
-		if (currentEdge.getUnknownCollaborationYearCount() != null) {
-			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
-			unknown.setAttribute("key", "num_unknown_collaboration");
-			unknown.setTextContent(String.valueOf(currentEdge.getUnknownCollaborationYearCount()));
-			edge.appendChild(unknown);
-		}
-	}
-
-	private void generateNodeSectionContent(CollaborationData coAuthorshipData, Element graphElement) {
-		Document doc = graphElement.getOwnerDocument();
-
-		graphElement.appendChild(doc.createComment("nodes"));
-
-		Collaborator egoNode = coAuthorshipData.getEgoCollaborator();
-		Set authorNodes = coAuthorshipData.getCollaborators();
-		
-		/*
-		 * This method actually creates the XML code for a single Collaborator. "graphMLContent"
-		 * is being side-effected. The egoNode is added first because this is the "requirement"
-		 * of the co-author vis. Ego should always come first.
-		 * 
-		 * */
-		getNodeContent(graphElement, egoNode);
-		
-		List orderedAuthorNodes = new ArrayList(authorNodes);
-		orderedAuthorNodes.remove(egoNode);
-		
-		orderedAuthorNodes.sort(new CollaboratorComparator());
-		
-		for (Collaborator currNode : orderedAuthorNodes) {
-			/*
-			 * We have already printed the Ego Collaborator info.
-			 * */
-			if (currNode != egoNode) {
-				getNodeContent(graphElement, currNode);
-			}
-		}
-		
-	}
-
-	private void getNodeContent(Element graphElement, Collaborator collaborator) {
-		Document doc = graphElement.getOwnerDocument();
-
-		ParamMap individualProfileURLParams = 
-					new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, collaborator.getCollaboratorURI());
-
-		String profileURL = UrlBuilder.getUrl(VisualizationFrameworkConstants.INDIVIDUAL_URL_PREFIX, individualProfileURLParams);
-
-		Element node = doc.createElementNS(GRAPHML_NS, "node");
-		node.setAttribute("id", String.valueOf(collaborator.getCollaboratorID()));
-		graphElement.appendChild(node);
-
-		Element url = doc.createElementNS(GRAPHML_NS, "data");
-		url.setAttribute("key", "url");
-		url.setTextContent(collaborator.getCollaboratorURI());
-		node.appendChild(url);
-
-		Element label = doc.createElementNS(GRAPHML_NS, "data");
-		label.setAttribute("key", "label");
-		label.setTextContent(collaborator.getCollaboratorName());
-		node.appendChild(label);
-
-		if (profileURL != null) {
-			Element profile = doc.createElementNS(GRAPHML_NS, "data");
-			profile.setAttribute("key", "profile_url");
-			profile.setTextContent(profileURL);
-			node.appendChild(profile);
-		}
-		
-		Element works = doc.createElementNS(GRAPHML_NS, "data");
-		works.setAttribute("key", "number_of_authored_works");
-		works.setTextContent(String.valueOf(collaborator.getNumOfActivities()));
-		node.appendChild(works);
-
-		if (collaborator.getEarliestActivityYearCount() != null) {
-			/*
-			 * There is no clean way of getting the map contents in java even though
-			 * we are sure to have only one entry on the map. So using the for loop.
-			 * I am feeling dirty just about now. 
-			 * */
-			for (Map.Entry publicationInfo : collaborator.getEarliestActivityYearCount().entrySet()) {
-				Element earliest = doc.createElementNS(GRAPHML_NS, "data");
-				earliest.setAttribute("key", "earliest_publication");
-				earliest.setTextContent(publicationInfo.getKey());
-				node.appendChild(earliest);
-
-				Element earliestCount = doc.createElementNS(GRAPHML_NS, "data");
-				earliestCount.setAttribute("key", "num_earliest_publication");
-				earliestCount.setTextContent(publicationInfo.getValue().toString());
-				node.appendChild(earliestCount);
-			}
-		}
-		
-		if (collaborator.getLatestActivityYearCount() != null) {
-			for (Map.Entry publicationInfo : collaborator.getLatestActivityYearCount().entrySet()) {
-				Element latest = doc.createElementNS(GRAPHML_NS, "data");
-				latest.setAttribute("key", "latest_publication");
-				latest.setTextContent(publicationInfo.getKey());
-				node.appendChild(latest);
-
-				Element latestCount = doc.createElementNS(GRAPHML_NS, "data");
-				latestCount.setAttribute("key", "num_latest_publication");
-				latestCount.setTextContent(publicationInfo.getValue().toString());
-				node.appendChild(latestCount);
-			}
-		}
-		
-		if (collaborator.getUnknownActivityYearCount() != null) {
-			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
-			unknown.setAttribute("key", "num_unknown_publication");
-			unknown.setTextContent(String.valueOf(collaborator.getUnknownActivityYearCount()));
-			node.appendChild(unknown);
-		}
-	}
-
-	private void generateKeyDefinitionContent(CollaborationData visVOContainer, Element rootElement) {
-		/*
-		 * Generate the key definition content for node. 
-		 * */
-		getKeyDefinitionFromSchema(visVOContainer.getNodeSchema(), rootElement);
-		
-		/*
-		 * Generate the key definition content for edge. 
-		 * */
-		getKeyDefinitionFromSchema(visVOContainer.getEdgeSchema(), rootElement);
-		
-		
-	}
-
-	private void getKeyDefinitionFromSchema(Set> schema, Element rootElement) {
-		Document doc = rootElement.getOwnerDocument();
-
-		for (Map currentNodeSchemaAttribute : schema) {
-			Element key = doc.createElementNS(GRAPHML_NS, "key");
-
-			for (Map.Entry currentAttributeKey : currentNodeSchemaAttribute.entrySet()) {
-				key.setAttribute(currentAttributeKey.getKey(), currentAttributeKey.getValue());
-			}
-			
-			if (currentNodeSchemaAttribute.containsKey("default")) {
-				Element def = doc.createElementNS(GRAPHML_NS, "default");
-				def.setTextContent(currentNodeSchemaAttribute.get("default"));
-				key.appendChild(def);
-			}
-
-			rootElement.appendChild(key);
-		}
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationComparator;
+import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationData;
+import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaboratorComparator;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+public class CoAuthorshipGraphMLWriter {
+
+	private StringBuilder coAuthorshipGraphMLContent;
+
+	private final String GRAPHML_NS = "http://graphml.graphdrawing.org/xmlns";
+
+	public CoAuthorshipGraphMLWriter(CollaborationData visVOContainer) {
+		coAuthorshipGraphMLContent = createCoAuthorshipGraphMLContent(visVOContainer);
+	}
+
+	private StringBuilder createCoAuthorshipGraphMLContent(CollaborationData coAuthorshipData) {
+
+		StringBuilder graphMLContent = new StringBuilder();
+
+		try {
+			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+			docFactory.setNamespaceAware(true);
+			DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+
+			// root elements
+			Document doc = docBuilder.newDocument();
+			doc.setXmlVersion("1.0");
+			Element rootElement = doc.createElementNS(GRAPHML_NS, "graphml");
+			doc.appendChild(rootElement);
+
+			/*
+			 * We are side-effecting "graphMLContent" object in this method since creating
+			 * another String object to hold key definition data will be redundant & will
+			 * not serve the purpose.
+			 * */
+			generateKeyDefinitionContent(coAuthorshipData, rootElement);
+
+			/*
+			 * Used to generate graph content. It will contain both the nodes & edge information.
+			 * We are side-effecting "graphMLContent".
+			 * */
+			generateGraphContent(coAuthorshipData, rootElement);
+
+			DOMSource source = new DOMSource(doc);
+			TransformerFactory transFactory = TransformerFactory.newInstance();
+			Transformer transformer = transFactory.newTransformer();
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+
+			StringWriter writer = new StringWriter();
+			StreamResult result = new StreamResult(writer);
+			transformer.transform(source, result);
+
+			graphMLContent.append(writer.toString());
+		} catch (ParserConfigurationException | TransformerException e) {
+			throw new IllegalStateException("XML error generating GraphML", e);
+		}
+
+        return graphMLContent;
+	}
+
+	public StringBuilder getCoAuthorshipGraphMLContent() {
+		return coAuthorshipGraphMLContent;
+	}
+
+	private void generateGraphContent(CollaborationData coAuthorshipData, Element rootElement) {
+		Document doc = rootElement.getOwnerDocument();
+
+		Element graph = doc.createElementNS(GRAPHML_NS, "graph");
+		graph.setAttribute("edgedefault", "undirected");
+		rootElement.appendChild(graph);
+
+		if (coAuthorshipData.getCollaborators() != null && coAuthorshipData.getCollaborators().size() > 0) {
+			generateNodeSectionContent(coAuthorshipData, graph);
+		}
+
+		if (coAuthorshipData.getCollaborations() != null && coAuthorshipData.getCollaborations().size() > 0) {
+			generateEdgeSectionContent(coAuthorshipData, graph);
+		}
+	}
+
+	private void generateEdgeSectionContent(CollaborationData coAuthorshipData, Element graphElement) {
+		Document doc = graphElement.getOwnerDocument();
+
+		graphElement.appendChild(doc.createComment("edges"));
+
+		Set  edges = coAuthorshipData.getCollaborations();
+		List orderedEdges = new ArrayList(edges);
+		orderedEdges.sort(new CollaborationComparator());
+
+		for (Collaboration currentEdge : orderedEdges) {
+			/*
+			 * This method actually creates the XML code for a single Collaboration.
+			 * "graphMLContent" is being side-effected.
+			 * */
+			getEdgeContent(graphElement, currentEdge);
+		}
+	}
+
+	private void getEdgeContent(Element graphElement, Collaboration currentEdge) {
+		Document doc = graphElement.getOwnerDocument();
+
+		Element edge = doc.createElementNS(GRAPHML_NS, "edge");
+		edge.setAttribute("id", String.valueOf(currentEdge.getCollaborationID()));
+		edge.setAttribute("source", String.valueOf(currentEdge.getSourceCollaborator().getCollaboratorID()));
+		edge.setAttribute("target", String.valueOf(currentEdge.getTargetCollaborator().getCollaboratorID()));
+		graphElement.appendChild(edge);
+
+		Element collaborator1 = doc.createElementNS(GRAPHML_NS, "data");
+		collaborator1.setAttribute("key", "collaborator1");
+		collaborator1.setTextContent(currentEdge.getSourceCollaborator().getCollaboratorName());
+		edge.appendChild(collaborator1);
+
+		Element collaborator2 = doc.createElementNS(GRAPHML_NS, "data");
+		collaborator2.setAttribute("key", "collaborator2");
+		collaborator2.setTextContent(currentEdge.getTargetCollaborator().getCollaboratorName());
+		edge.appendChild(collaborator2);
+
+		Element works = doc.createElementNS(GRAPHML_NS, "data");
+		works.setAttribute("key", "number_of_coauthored_works");
+		works.setTextContent(String.valueOf(currentEdge.getNumOfCollaborations()));
+		edge.appendChild(works);
+
+		if (currentEdge.getEarliestCollaborationYearCount() != null) {
+			/*
+			 * There is no clean way of getting the map contents in java even though
+			 * we are sure to have only one entry on the map. So using the for loop.
+			 * */
+			for (Map.Entry publicationInfo : currentEdge.getEarliestCollaborationYearCount().entrySet()) {
+
+				Element earliest = doc.createElementNS(GRAPHML_NS, "data");
+				earliest.setAttribute("key", "earliest_collaboration");
+				earliest.setTextContent(publicationInfo.getKey());
+				edge.appendChild(earliest);
+
+				Element earliestCount = doc.createElementNS(GRAPHML_NS, "data");
+				earliestCount.setAttribute("key", "num_earliest_collaboration");
+				earliestCount.setTextContent(publicationInfo.getValue().toString());
+				edge.appendChild(earliestCount);
+			}
+		}
+
+		if (currentEdge.getLatestCollaborationYearCount() != null) {
+			for (Map.Entry publicationInfo : currentEdge.getLatestCollaborationYearCount().entrySet()) {
+				Element latest = doc.createElementNS(GRAPHML_NS, "data");
+				latest.setAttribute("key", "latest_collaboration");
+				latest.setTextContent(publicationInfo.getKey());
+				edge.appendChild(latest);
+
+				Element latestCount = doc.createElementNS(GRAPHML_NS, "data");
+				latestCount.setAttribute("key", "num_latest_collaboration");
+				latestCount.setTextContent(publicationInfo.getValue().toString());
+				edge.appendChild(latestCount);
+			}
+		}
+
+		if (currentEdge.getUnknownCollaborationYearCount() != null) {
+			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
+			unknown.setAttribute("key", "num_unknown_collaboration");
+			unknown.setTextContent(String.valueOf(currentEdge.getUnknownCollaborationYearCount()));
+			edge.appendChild(unknown);
+		}
+	}
+
+	private void generateNodeSectionContent(CollaborationData coAuthorshipData, Element graphElement) {
+		Document doc = graphElement.getOwnerDocument();
+
+		graphElement.appendChild(doc.createComment("nodes"));
+
+		Collaborator egoNode = coAuthorshipData.getEgoCollaborator();
+		Set authorNodes = coAuthorshipData.getCollaborators();
+
+		/*
+		 * This method actually creates the XML code for a single Collaborator. "graphMLContent"
+		 * is being side-effected. The egoNode is added first because this is the "requirement"
+		 * of the co-author vis. Ego should always come first.
+		 *
+		 * */
+		getNodeContent(graphElement, egoNode);
+
+		List orderedAuthorNodes = new ArrayList(authorNodes);
+		orderedAuthorNodes.remove(egoNode);
+
+		orderedAuthorNodes.sort(new CollaboratorComparator());
+
+		for (Collaborator currNode : orderedAuthorNodes) {
+			/*
+			 * We have already printed the Ego Collaborator info.
+			 * */
+			if (currNode != egoNode) {
+				getNodeContent(graphElement, currNode);
+			}
+		}
+
+	}
+
+	private void getNodeContent(Element graphElement, Collaborator collaborator) {
+		Document doc = graphElement.getOwnerDocument();
+
+		ParamMap individualProfileURLParams =
+					new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, collaborator.getCollaboratorURI());
+
+		String profileURL = UrlBuilder.getUrl(VisualizationFrameworkConstants.INDIVIDUAL_URL_PREFIX, individualProfileURLParams);
+
+		Element node = doc.createElementNS(GRAPHML_NS, "node");
+		node.setAttribute("id", String.valueOf(collaborator.getCollaboratorID()));
+		graphElement.appendChild(node);
+
+		Element url = doc.createElementNS(GRAPHML_NS, "data");
+		url.setAttribute("key", "url");
+		url.setTextContent(collaborator.getCollaboratorURI());
+		node.appendChild(url);
+
+		Element label = doc.createElementNS(GRAPHML_NS, "data");
+		label.setAttribute("key", "label");
+		label.setTextContent(collaborator.getCollaboratorName());
+		node.appendChild(label);
+
+		if (profileURL != null) {
+			Element profile = doc.createElementNS(GRAPHML_NS, "data");
+			profile.setAttribute("key", "profile_url");
+			profile.setTextContent(profileURL);
+			node.appendChild(profile);
+		}
+
+		Element works = doc.createElementNS(GRAPHML_NS, "data");
+		works.setAttribute("key", "number_of_authored_works");
+		works.setTextContent(String.valueOf(collaborator.getNumOfActivities()));
+		node.appendChild(works);
+
+		if (collaborator.getEarliestActivityYearCount() != null) {
+			/*
+			 * There is no clean way of getting the map contents in java even though
+			 * we are sure to have only one entry on the map. So using the for loop.
+			 * I am feeling dirty just about now.
+			 * */
+			for (Map.Entry publicationInfo : collaborator.getEarliestActivityYearCount().entrySet()) {
+				Element earliest = doc.createElementNS(GRAPHML_NS, "data");
+				earliest.setAttribute("key", "earliest_publication");
+				earliest.setTextContent(publicationInfo.getKey());
+				node.appendChild(earliest);
+
+				Element earliestCount = doc.createElementNS(GRAPHML_NS, "data");
+				earliestCount.setAttribute("key", "num_earliest_publication");
+				earliestCount.setTextContent(publicationInfo.getValue().toString());
+				node.appendChild(earliestCount);
+			}
+		}
+
+		if (collaborator.getLatestActivityYearCount() != null) {
+			for (Map.Entry publicationInfo : collaborator.getLatestActivityYearCount().entrySet()) {
+				Element latest = doc.createElementNS(GRAPHML_NS, "data");
+				latest.setAttribute("key", "latest_publication");
+				latest.setTextContent(publicationInfo.getKey());
+				node.appendChild(latest);
+
+				Element latestCount = doc.createElementNS(GRAPHML_NS, "data");
+				latestCount.setAttribute("key", "num_latest_publication");
+				latestCount.setTextContent(publicationInfo.getValue().toString());
+				node.appendChild(latestCount);
+			}
+		}
+
+		if (collaborator.getUnknownActivityYearCount() != null) {
+			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
+			unknown.setAttribute("key", "num_unknown_publication");
+			unknown.setTextContent(String.valueOf(collaborator.getUnknownActivityYearCount()));
+			node.appendChild(unknown);
+		}
+	}
+
+	private void generateKeyDefinitionContent(CollaborationData visVOContainer, Element rootElement) {
+		/*
+		 * Generate the key definition content for node.
+		 * */
+		getKeyDefinitionFromSchema(visVOContainer.getNodeSchema(), rootElement);
+
+		/*
+		 * Generate the key definition content for edge.
+		 * */
+		getKeyDefinitionFromSchema(visVOContainer.getEdgeSchema(), rootElement);
+
+
+	}
+
+	private void getKeyDefinitionFromSchema(Set> schema, Element rootElement) {
+		Document doc = rootElement.getOwnerDocument();
+
+		for (Map currentNodeSchemaAttribute : schema) {
+			Element key = doc.createElementNS(GRAPHML_NS, "key");
+
+			for (Map.Entry currentAttributeKey : currentNodeSchemaAttribute.entrySet()) {
+				key.setAttribute(currentAttributeKey.getKey(), currentAttributeKey.getValue());
+			}
+
+			if (currentNodeSchemaAttribute.containsKey("default")) {
+				Element def = doc.createElementNS(GRAPHML_NS, "default");
+				def.setTextContent(currentNodeSchemaAttribute.get("default"));
+				key.appendChild(def);
+			}
+
+			rootElement.appendChild(key);
+		}
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
index 649e0862..bfb64a98 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipQueryRunner.java
@@ -46,8 +46,8 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator
 /**
  * This query runner is used to execute a sparql query to get all the publications
  * for a particular individual. It will also fetch all the authors that worked
- * on that particular publication. 
- * 
+ * on that particular publication.
+ *
  * @author cdtank
  */
 public class CoAuthorshipQueryRunner implements QueryRunner {
@@ -63,7 +63,7 @@ public class CoAuthorshipQueryRunner implements QueryRunner {
 	private RDFService rdfService;
 
 	private VitroRequest vitroRequest;
-	
+
 	private Log log;
 
 	public CoAuthorshipQueryRunner(String egoURI, VitroRequest vreq, Log log) {
@@ -77,12 +77,12 @@ public class CoAuthorshipQueryRunner implements QueryRunner {
 
 	private static class QueryResultConsumer extends ResultSetConsumer {
 		Set nodes = new HashSet();
-		
+
 		Map biboDocumentURLToVO = new HashMap();
 		Map> biboDocumentURLToCoAuthors = new HashMap>();
 		Map nodeURLToVO = new HashMap();
 		Map edgeUniqueIdentifierToVO = new HashMap();
-		
+
 		Collaborator egoNode = null;
 
 		Set edges = new HashSet();
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java
index 0acfcfc1..b4e8a4d4 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java
@@ -28,10 +28,10 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
 /**
  * This request handler is used when information related to co-authorship network
  * for an individual is requested. It currently provides 2 outputs,
- * 		1. Graphml content representing the individual's co-authorship network 
- * 		1. CSV file containing the list(& count) of unique co-authors with which 
+ * 		1. Graphml content representing the individual's co-authorship network
+ * 		1. CSV file containing the list(& count) of unique co-authors with which
  * the individual has worked over the years. This data powers the related sparkline.
- *  
+ *
  * @author cdtank
  */
 public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
@@ -54,7 +54,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
 			VitroRequest vitroRequest, Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
 
-	
+
 		String egoURI = vitroRequest.getParameter(
 				VisualizationFrameworkConstants
 						.INDIVIDUAL_URI_KEY);
@@ -65,88 +65,88 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
 
 		CoAuthorshipQueryRunner queryManager =
 		new CoAuthorshipQueryRunner(egoURI, vitroRequest, log);
-		
-		CollaborationData authorNodesAndEdges = 
+
+		CollaborationData authorNodesAndEdges =
 		queryManager.getQueryResult();
-	
-    	/* 
+
+    	/*
     	 * We will be using the same visualization package for both sparkline & coauthorship
-    	 * flash vis. We will use "VIS_MODE_KEY" as a modifier to differentiate 
+    	 * flash vis. We will use "VIS_MODE_KEY" as a modifier to differentiate
     	 * between these two. The default will be to render the coauthorship network vis.
-    	 * */ 
+    	 * */
 		if (VisualizationFrameworkConstants.COAUTHORS_COUNT_PER_YEAR_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareCoauthorsCountPerYearDataResponse(authorNodesAndEdges);
-				
+
 		} else if (VisualizationFrameworkConstants.COAUTHORS_LIST_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareCoauthorsListDataResponse(authorNodesAndEdges);
-				
+
 		} else if (VisualizationFrameworkConstants.COAUTHOR_NETWORK_DOWNLOAD_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareNetworkDownloadDataResponse(authorNodesAndEdges);
-				
+
 		} else {
     			/*
-    			 * When the graphML file is required - based on which coauthorship network 
+    			 * When the graphML file is required - based on which coauthorship network
     			 * visualization will be rendered.
     			 * */
     			return prepareNetworkStreamDataResponse(authorNodesAndEdges);
 		}
-	
+
 	}
 
 	public ResponseValues generateStandardVisualization(VitroRequest vitroRequest,
-											  	Log log, 
-											    Dataset dataset) 
+											  	Log log,
+											    Dataset dataset)
 		throws MalformedQueryParametersException {
 
-		throw new UnsupportedOperationException("CoAuthorship Visualization " 
+		throw new UnsupportedOperationException("CoAuthorship Visualization "
 						+ "does not provide Standalone response.");
 	}
-	
+
 	private String getCoauthorsListCSVContent(CollaborationData coAuthorshipData) {
-		
+
 		StringBuilder csvFileContent = new StringBuilder();
-		
+
 		csvFileContent.append("Co-author, Count\n");
-		
-		for (Collaborator currNode : coAuthorshipData.getCollaborators()) {			
+
+		for (Collaborator currNode : coAuthorshipData.getCollaborators()) {
 			/*
 			 * We have already printed the Ego Node info.
 			 * */
 			if (currNode != coAuthorshipData.getEgoCollaborator()) {
-				
-			
+
+
 			csvFileContent.append(StringEscapeUtils.escapeCsv(currNode.getCollaboratorName()));
 			csvFileContent.append(",");
 			csvFileContent.append(currNode.getNumOfActivities());
 			csvFileContent.append("\n");
-			
+
 			}
 		}
-		
+
 		return csvFileContent.toString();
 	}
 
 	private String getCoauthorsPerYearCSVContent(Map> yearToCoauthors) {
-		
+
 		StringBuilder csvFileContent = new StringBuilder();
-		
+
 		csvFileContent.append("Year, Count, Co-author(s)\n");
-		
+
 		for (Entry> currentEntry : yearToCoauthors.entrySet()) {
 			csvFileContent.append(StringEscapeUtils.escapeCsv(currentEntry.getKey()));
 			csvFileContent.append(",");
@@ -156,136 +156,136 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
 										getCoauthorNamesAsString(currentEntry.getValue())));
 			csvFileContent.append("\n");
 		}
-		
+
 		return csvFileContent.toString();
-			
+
 	}
-	
+
 	private String getCoauthorNamesAsString(Set coAuthors) {
-		
+
 		StringBuilder coAuthorsMerged = new StringBuilder();
-		
+
 		String coAuthorSeparator = "; ";
 		for (Collaborator currCoAuthor : coAuthors) {
 			coAuthorsMerged.append(currCoAuthor.getCollaboratorName()).append(coAuthorSeparator);
 		}
-		
+
 		return StringUtils.removeEnd(coAuthorsMerged.toString(), coAuthorSeparator);
 	}
 
 	/**
-	 * Provides response when a csv file containing number & names of unique co-authors per 
-	 * year is requested. 
+	 * Provides response when a csv file containing number & names of unique co-authors per
+	 * year is requested.
 	 * @param authorNodesAndEdges Author nodes and edges
 	 */
 	private Map prepareCoauthorsCountPerYearDataResponse(
 					CollaborationData authorNodesAndEdges) {
-		
+
 		String outputFileName;
 		Map> yearToCoauthors = new TreeMap>();
-		
-		if (authorNodesAndEdges.getCollaborators() != null 
+
+		if (authorNodesAndEdges.getCollaborators() != null
 					&& authorNodesAndEdges.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(authorNodesAndEdges
 									.getEgoCollaborator().getCollaboratorName())
 			+ "_co-authors-per-year" + ".csv";
-			
+
 			yearToCoauthors = UtilityFunctions.getActivityYearToCollaborators(authorNodesAndEdges);
-			
+
 		} else {
-			
-			outputFileName = "no_co-authors-per-year" + ".csv";			
+
+			outputFileName = "no_co-authors-per-year" + ".csv";
 		}
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
 					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 getCoauthorsPerYearCSVContent(yearToCoauthors));
 
 		return fileData;
 	}
 
 	/**
-	 * Provides response when a csv file containing number & names of unique co-authors per 
-	 * year is requested. 
+	 * Provides response when a csv file containing number & names of unique co-authors per
+	 * year is requested.
 	 * @param coAuthorshipData   Co authorship data
 	 */
 	private Map prepareCoauthorsListDataResponse(
 					CollaborationData coAuthorshipData) {
-		
+
 		String outputFileName = "";
 
-		if (coAuthorshipData.getCollaborators() != null 
+		if (coAuthorshipData.getCollaborators() != null
 					&& coAuthorshipData.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(coAuthorshipData.getEgoCollaborator()
-															.getCollaboratorName()) 
+															.getCollaboratorName())
 									+ "_co-authors" + ".csv";
 		} else {
 			outputFileName = "no_co-authors" + ".csv";
 		}
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
 					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 getCoauthorsListCSVContent(coAuthorshipData));
 
 		return fileData;
 	}
-	
+
 	/**
-	 * Provides a response when graphml formatted co-authorship network is requested, typically by 
+	 * Provides a response when graphml formatted co-authorship network is requested, typically by
 	 * the flash vis.
 	 * @param authorNodesAndEdges Author nodes and edges
 	 */
 	private Map prepareNetworkStreamDataResponse(
 									CollaborationData authorNodesAndEdges) {
-	
-		CoAuthorshipGraphMLWriter coAuthorshipGraphMLWriter = 
+
+		CoAuthorshipGraphMLWriter coAuthorshipGraphMLWriter =
 				new CoAuthorshipGraphMLWriter(authorNodesAndEdges);
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "text/xml");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 coAuthorshipGraphMLWriter.getCoAuthorshipGraphMLContent().toString());
 
 		return fileData;
-	
+
 	}
-	
+
 	private Map prepareNetworkDownloadDataResponse(
 									CollaborationData authorNodesAndEdges) {
-		
+
 		String outputFileName = "";
-		
-		if (authorNodesAndEdges.getCollaborators() != null 
+
+		if (authorNodesAndEdges.getCollaborators() != null
 					&& authorNodesAndEdges.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(authorNodesAndEdges
-									.getEgoCollaborator().getCollaboratorName()) 
+									.getEgoCollaborator().getCollaboratorName())
 									+ "_co-author-network.graphml" + ".xml";
-			
+
 		} else {
-			outputFileName = "no_co-author-network.graphml" + ".xml";			
+			outputFileName = "no_co-author-network.graphml" + ".xml";
 		}
-		
-		CoAuthorshipGraphMLWriter coAuthorshipGraphMLWriter = 
+
+		CoAuthorshipGraphMLWriter coAuthorshipGraphMLWriter =
 				new CoAuthorshipGraphMLWriter(authorNodesAndEdges);
-		
+
         Map fileData = new HashMap();
-        fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+        fileData.put(DataVisualizationController.FILE_NAME_KEY,
 				 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "text/xml");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 coAuthorshipGraphMLWriter.getCoAuthorshipGraphMLContent().toString());
 
 		return fileData;
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java
index bcbfdf1f..e0766860 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java
@@ -1,254 +1,254 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.YearToEntityCountDataElement;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-
-
-public class CoAuthorshipVisCodeGenerator {
-
-	/*
-	 * There are 2 modes of sparkline that are available via this visualization.
-	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
-	 * 			which in this case are the coauthors over the years, from the last 10 years.
-	 * 
-	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks) 
-	 * 			spanning the career of the person & last 10 years at the minimum, in case if
-	 * 			the person started his career in the last 10 yeras.
-	 * */
-	private static final String DEFAULT_VISCONTAINER_DIV_ID = "unique_coauthors_vis_container";
-	
-	private Map> yearToUniqueCoauthors;
-
-	private Log log;
-
-	private SparklineData sparklineParameterVO;
-
-	private String individualURI;
-
-	public CoAuthorshipVisCodeGenerator(String individualURI, 
-									  String visMode, 
-									  String visContainer, 
-									  Map> yearToUniqueCoauthors, 
-									  Log log) {
-		
-		this.individualURI = individualURI;
-		
-		this.yearToUniqueCoauthors = yearToUniqueCoauthors;
-		
-		this.log = log;
-		
-		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
-	}
-	
-	/**
-	 * This method is used to setup parameters for the sparkline value object. These parameters
-	 * will be used in the template to construct the actual html/javascript code.
-	 * @param visMode Visualization mode
-	 * @param providedVisContainerID Container ID
-	 */
-	private SparklineData setupSparklineParameters(String visMode,
-										    String providedVisContainerID) {
-		
-		SparklineData sparklineData = new SparklineData();
-
-		int numOfYearsToBeRendered = 0;
-		
-		/*
-		 * It was decided that to prevent downward curve that happens if there are no publications 
-		 * in the current year seems a bit harsh, so we consider only publications from the last 10
-		 * complete years. 
-		 * */
-		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
-		int shortSparkMinYear = currentYear 
-									- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE 
-									+ 1;
-		
-    	/*
-    	 * This is required because when deciding the range of years over which the vis
-    	 * was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
-    	 * */
-		Set publishedYears = new HashSet(yearToUniqueCoauthors.keySet());
-    	publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
-		
-		/*
-		 * We are setting the default value of minPublishedYear to be 10 years before 
-		 * the current year (which is suitably represented by the shortSparkMinYear),
-		 * this in case we run into invalid set of published years.
-		 * */
-		int minPublishedYear = shortSparkMinYear;
-		
-		String visContainerID = null;
-		
-		if (yearToUniqueCoauthors.size() > 0) {
-			try {
-				minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
-			} catch (NoSuchElementException | NumberFormatException e1) {
-				log.debug("vis: " + e1.getMessage() + " error occurred for " 
-							+ yearToUniqueCoauthors.toString());
-			}
-        }
-		
-		int minPubYearConsidered = 0;
-		
-		/*
-		 * There might be a case that the author has made his first publication within the 
-		 * last 10 years but we want to make sure that the sparkline is representative of 
-		 * at least the last 10 years, so we will set the minPubYearConsidered to 
-		 * "currentYear - 10" which is also given by "shortSparkMinYear".
-		 * */
-		if (minPublishedYear > shortSparkMinYear) {
-			minPubYearConsidered = shortSparkMinYear;
-		} else {
-			minPubYearConsidered = minPublishedYear;
-		}
-		
-		numOfYearsToBeRendered = currentYear - minPubYearConsidered + 1;
-		
-		sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
-		
-		int uniqueCoAuthorCounter = 0;
-		Set allCoAuthorsWithKnownAuthorshipYears = new HashSet();
-		List yearToUniqueCoauthorsCountDataTable = 
-					new ArrayList();
-		
-		for (int publicationYear = minPubYearConsidered; 
-					publicationYear <= currentYear; 
-					publicationYear++) {
-
-				String publicationYearAsString = String.valueOf(publicationYear);
-				Set currentCoAuthors = yearToUniqueCoauthors
-															.get(publicationYearAsString);
-				
-				Integer currentUniqueCoAuthors = null;
-				
-				if (currentCoAuthors != null) {
-					currentUniqueCoAuthors = currentCoAuthors.size();
-					allCoAuthorsWithKnownAuthorshipYears.addAll(currentCoAuthors); 
-				} else {
-					currentUniqueCoAuthors = 0;
-				}
-				
-				yearToUniqueCoauthorsCountDataTable.add(
-						new YearToEntityCountDataElement(uniqueCoAuthorCounter, 
-														 publicationYearAsString, 
-														 currentUniqueCoAuthors));
-				uniqueCoAuthorCounter++;
-		}
-
-		/*
-		 * For the purpose of this visualization I have come up with a term "Sparks" which 
-		 * essentially means data points. 
-		 * Sparks that will be rendered in full mode will always be the one's which have any year
-		 * associated with it. Hence.
-		 * */
-		sparklineData.setRenderedSparks(allCoAuthorsWithKnownAuthorshipYears.size());
-		
-		sparklineData.setYearToEntityCountDataTable(yearToUniqueCoauthorsCountDataTable);
-		
-		/*
-		 * This is required only for the sparklines which convey collaborationships like 
-		 * coinvestigatorships and coauthorship. There are edge cases where a collaborator can be 
-		 * present for in a collaboration with known & unknown year. We do not want to repeat the 
-		 * count for this collaborator when we present it in the front-end. 
-		 * */
-		Set totalUniqueCoInvestigators = 
-							new HashSet(allCoAuthorsWithKnownAuthorshipYears);
-
-		/*
-		 * Total publications will also consider publications that have no year associated with
-		 * them. Hence.
-		 * */
-		Integer unknownYearCoauthors = 0;
-		if (yearToUniqueCoauthors.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
-			unknownYearCoauthors = yearToUniqueCoauthors
-											.get(VOConstants.DEFAULT_PUBLICATION_YEAR).size();
-			
-			totalUniqueCoInvestigators.addAll(
-					yearToUniqueCoauthors.get(VOConstants.DEFAULT_GRANT_YEAR));
-		}
-		
-		sparklineData.setUnknownYearPublications(unknownYearCoauthors);
-		
-		sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
-		
-		if (providedVisContainerID != null) {
-			visContainerID = providedVisContainerID;
-		} else {
-			visContainerID = DEFAULT_VISCONTAINER_DIV_ID;
-		}
-
-		sparklineData.setVisContainerDivID(visContainerID);
-		
-		/*
-		 * By default these represents the range of the rendered sparks. Only in case of
-		 * "short" sparkline mode we will set the Earliest RenderedPublication year to
-		 * "currentYear - 10". 
-		 * */
-		sparklineData.setEarliestYearConsidered(minPubYearConsidered);
-		sparklineData.setEarliestRenderedPublicationYear(minPublishedYear);
-		sparklineData.setLatestRenderedPublicationYear(currentYear);
-		
-		/*
-		 * The Full Sparkline will be rendered by default. Only if the url has specific mention of
-		 * SHORT_SPARKLINE_MODE_KEY then we render the short sparkline and not otherwise.
-		 * */
-		if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) {
-			
-			sparklineData.setEarliestRenderedPublicationYear(shortSparkMinYear);
-			sparklineData.setShortVisMode(true);
-
-		} else {
-			sparklineData.setShortVisMode(false);
-		}
-		
-		if (yearToUniqueCoauthors.size() > 0) {
-			
-			sparklineData.setFullTimelineNetworkLink(
-					UtilityFunctions.getCollaboratorshipNetworkLink(
-							individualURI,
-							VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
-							VisualizationFrameworkConstants.COAUTHOR_VIS_MODE));
-			
-			sparklineData.setDownloadDataLink(
-					UtilityFunctions.getCSVDownloadURL(
-							individualURI,
-							VisualizationFrameworkConstants.COAUTHORSHIP_VIS,
-							VisualizationFrameworkConstants.COAUTHORS_COUNT_PER_YEAR_VIS_MODE));
-			
-			Map yearToUniqueCoauthorsCount = new HashMap();
-			
-			for (Map.Entry> currentYearToCoAuthors 
-							: yearToUniqueCoauthors.entrySet()) {
-				yearToUniqueCoauthorsCount.put(currentYearToCoAuthors.getKey(), 
-											   currentYearToCoAuthors.getValue().size());
-			}
-			
-			sparklineData.setYearToActivityCount(yearToUniqueCoauthorsCount);
-		}
-		
-		return sparklineData;
-	}
-	
-	public SparklineData getValueObjectContainer() {
-		return this.sparklineParameterVO;
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.YearToEntityCountDataElement;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+
+
+public class CoAuthorshipVisCodeGenerator {
+
+	/*
+	 * There are 2 modes of sparkline that are available via this visualization.
+	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
+	 * 			which in this case are the coauthors over the years, from the last 10 years.
+	 *
+	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks)
+	 * 			spanning the career of the person & last 10 years at the minimum, in case if
+	 * 			the person started his career in the last 10 yeras.
+	 * */
+	private static final String DEFAULT_VISCONTAINER_DIV_ID = "unique_coauthors_vis_container";
+
+	private Map> yearToUniqueCoauthors;
+
+	private Log log;
+
+	private SparklineData sparklineParameterVO;
+
+	private String individualURI;
+
+	public CoAuthorshipVisCodeGenerator(String individualURI,
+									  String visMode,
+									  String visContainer,
+									  Map> yearToUniqueCoauthors,
+									  Log log) {
+
+		this.individualURI = individualURI;
+
+		this.yearToUniqueCoauthors = yearToUniqueCoauthors;
+
+		this.log = log;
+
+		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
+	}
+
+	/**
+	 * This method is used to setup parameters for the sparkline value object. These parameters
+	 * will be used in the template to construct the actual html/javascript code.
+	 * @param visMode Visualization mode
+	 * @param providedVisContainerID Container ID
+	 */
+	private SparklineData setupSparklineParameters(String visMode,
+										    String providedVisContainerID) {
+
+		SparklineData sparklineData = new SparklineData();
+
+		int numOfYearsToBeRendered = 0;
+
+		/*
+		 * It was decided that to prevent downward curve that happens if there are no publications
+		 * in the current year seems a bit harsh, so we consider only publications from the last 10
+		 * complete years.
+		 * */
+		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
+		int shortSparkMinYear = currentYear
+									- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE
+									+ 1;
+
+    	/*
+    	 * This is required because when deciding the range of years over which the vis
+    	 * was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
+    	 * */
+		Set publishedYears = new HashSet(yearToUniqueCoauthors.keySet());
+    	publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
+
+		/*
+		 * We are setting the default value of minPublishedYear to be 10 years before
+		 * the current year (which is suitably represented by the shortSparkMinYear),
+		 * this in case we run into invalid set of published years.
+		 * */
+		int minPublishedYear = shortSparkMinYear;
+
+		String visContainerID = null;
+
+		if (yearToUniqueCoauthors.size() > 0) {
+			try {
+				minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
+			} catch (NoSuchElementException | NumberFormatException e1) {
+				log.debug("vis: " + e1.getMessage() + " error occurred for "
+							+ yearToUniqueCoauthors.toString());
+			}
+        }
+
+		int minPubYearConsidered = 0;
+
+		/*
+		 * There might be a case that the author has made his first publication within the
+		 * last 10 years but we want to make sure that the sparkline is representative of
+		 * at least the last 10 years, so we will set the minPubYearConsidered to
+		 * "currentYear - 10" which is also given by "shortSparkMinYear".
+		 * */
+		if (minPublishedYear > shortSparkMinYear) {
+			minPubYearConsidered = shortSparkMinYear;
+		} else {
+			minPubYearConsidered = minPublishedYear;
+		}
+
+		numOfYearsToBeRendered = currentYear - minPubYearConsidered + 1;
+
+		sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
+
+		int uniqueCoAuthorCounter = 0;
+		Set allCoAuthorsWithKnownAuthorshipYears = new HashSet();
+		List yearToUniqueCoauthorsCountDataTable =
+					new ArrayList();
+
+		for (int publicationYear = minPubYearConsidered;
+					publicationYear <= currentYear;
+					publicationYear++) {
+
+				String publicationYearAsString = String.valueOf(publicationYear);
+				Set currentCoAuthors = yearToUniqueCoauthors
+															.get(publicationYearAsString);
+
+				Integer currentUniqueCoAuthors = null;
+
+				if (currentCoAuthors != null) {
+					currentUniqueCoAuthors = currentCoAuthors.size();
+					allCoAuthorsWithKnownAuthorshipYears.addAll(currentCoAuthors);
+				} else {
+					currentUniqueCoAuthors = 0;
+				}
+
+				yearToUniqueCoauthorsCountDataTable.add(
+						new YearToEntityCountDataElement(uniqueCoAuthorCounter,
+														 publicationYearAsString,
+														 currentUniqueCoAuthors));
+				uniqueCoAuthorCounter++;
+		}
+
+		/*
+		 * For the purpose of this visualization I have come up with a term "Sparks" which
+		 * essentially means data points.
+		 * Sparks that will be rendered in full mode will always be the one's which have any year
+		 * associated with it. Hence.
+		 * */
+		sparklineData.setRenderedSparks(allCoAuthorsWithKnownAuthorshipYears.size());
+
+		sparklineData.setYearToEntityCountDataTable(yearToUniqueCoauthorsCountDataTable);
+
+		/*
+		 * This is required only for the sparklines which convey collaborationships like
+		 * coinvestigatorships and coauthorship. There are edge cases where a collaborator can be
+		 * present for in a collaboration with known & unknown year. We do not want to repeat the
+		 * count for this collaborator when we present it in the front-end.
+		 * */
+		Set totalUniqueCoInvestigators =
+							new HashSet(allCoAuthorsWithKnownAuthorshipYears);
+
+		/*
+		 * Total publications will also consider publications that have no year associated with
+		 * them. Hence.
+		 * */
+		Integer unknownYearCoauthors = 0;
+		if (yearToUniqueCoauthors.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
+			unknownYearCoauthors = yearToUniqueCoauthors
+											.get(VOConstants.DEFAULT_PUBLICATION_YEAR).size();
+
+			totalUniqueCoInvestigators.addAll(
+					yearToUniqueCoauthors.get(VOConstants.DEFAULT_GRANT_YEAR));
+		}
+
+		sparklineData.setUnknownYearPublications(unknownYearCoauthors);
+
+		sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
+
+		if (providedVisContainerID != null) {
+			visContainerID = providedVisContainerID;
+		} else {
+			visContainerID = DEFAULT_VISCONTAINER_DIV_ID;
+		}
+
+		sparklineData.setVisContainerDivID(visContainerID);
+
+		/*
+		 * By default these represents the range of the rendered sparks. Only in case of
+		 * "short" sparkline mode we will set the Earliest RenderedPublication year to
+		 * "currentYear - 10".
+		 * */
+		sparklineData.setEarliestYearConsidered(minPubYearConsidered);
+		sparklineData.setEarliestRenderedPublicationYear(minPublishedYear);
+		sparklineData.setLatestRenderedPublicationYear(currentYear);
+
+		/*
+		 * The Full Sparkline will be rendered by default. Only if the url has specific mention of
+		 * SHORT_SPARKLINE_MODE_KEY then we render the short sparkline and not otherwise.
+		 * */
+		if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) {
+
+			sparklineData.setEarliestRenderedPublicationYear(shortSparkMinYear);
+			sparklineData.setShortVisMode(true);
+
+		} else {
+			sparklineData.setShortVisMode(false);
+		}
+
+		if (yearToUniqueCoauthors.size() > 0) {
+
+			sparklineData.setFullTimelineNetworkLink(
+					UtilityFunctions.getCollaboratorshipNetworkLink(
+							individualURI,
+							VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
+							VisualizationFrameworkConstants.COAUTHOR_VIS_MODE));
+
+			sparklineData.setDownloadDataLink(
+					UtilityFunctions.getCSVDownloadURL(
+							individualURI,
+							VisualizationFrameworkConstants.COAUTHORSHIP_VIS,
+							VisualizationFrameworkConstants.COAUTHORS_COUNT_PER_YEAR_VIS_MODE));
+
+			Map yearToUniqueCoauthorsCount = new HashMap();
+
+			for (Map.Entry> currentYearToCoAuthors
+							: yearToUniqueCoauthors.entrySet()) {
+				yearToUniqueCoauthorsCount.put(currentYearToCoAuthors.getKey(),
+											   currentYearToCoAuthors.getValue().size());
+			}
+
+			sparklineData.setYearToActivityCount(yearToUniqueCoauthorsCount);
+		}
+
+		return sparklineData;
+	}
+
+	public SparklineData getValueObjectContainer() {
+		return this.sparklineParameterVO;
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoAuthorshipData.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoAuthorshipData.java
index 4ad11a8d..08415e37 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoAuthorshipData.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoAuthorshipData.java
@@ -27,169 +27,169 @@ public class CoAuthorshipData extends CollaborationData {
 	public Set> initializeEdgeSchema() {
 
 		Set> edgeSchema = new HashSet>();
-		
+
 			Map schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "collaborator1");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "collaborator1");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "collaborator2");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "collaborator2");
 			schemaAttributes.put("attr.type", "string");
-		
-		edgeSchema.add(schemaAttributes);		
-		
+
+		edgeSchema.add(schemaAttributes);
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "number_of_coauthored_works");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "number_of_coauthored_works");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "earliest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "earliest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_earliest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_earliest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "latest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "latest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_latest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_latest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_unknown_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_unknown_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 		return edgeSchema;
 	}
-	
+
 
 	public Set> initializeNodeSchema() {
-		
+
 		Set> nodeSchema = new HashSet>();
 
-			Map schemaAttributes = new LinkedHashMap();   
-			
+			Map schemaAttributes = new LinkedHashMap();
+
 			schemaAttributes.put("id", "url");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "url");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-	
+
 			schemaAttributes = new LinkedHashMap();
-		
+
 			schemaAttributes.put("id", "label");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "label");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-		
+
 			schemaAttributes.put("id", "profile_url");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "profile_url");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-	
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "number_of_authored_works");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "number_of_authored_works");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "earliest_publication");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "earliest_publication");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_earliest_publication");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_earliest_publication");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "latest_publication");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "latest_publication");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_latest_publication");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_latest_publication");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_unknown_publication");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_unknown_publication");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
-		
+
+
 		return nodeSchema;
 	}
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoInvestigationData.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoInvestigationData.java
index da5db8a8..49ba3830 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoInvestigationData.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CoInvestigationData.java
@@ -27,169 +27,169 @@ public class CoInvestigationData extends CollaborationData {
 	public Set> initializeEdgeSchema() {
 
 		Set> edgeSchema = new HashSet>();
-		
+
 		Map schemaAttributes = new LinkedHashMap();
-		
+
 			schemaAttributes.put("id", "collaborator1");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "collaborator1");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "collaborator2");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "collaborator2");
 			schemaAttributes.put("attr.type", "string");
-		
-		edgeSchema.add(schemaAttributes);		
-		
+
+		edgeSchema.add(schemaAttributes);
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "number_of_coinvestigated_grants");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "number_of_coinvestigated_grants");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "earliest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "earliest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_earliest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_earliest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "latest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "latest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_latest_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_latest_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_unknown_collaboration");
 			schemaAttributes.put("for", "edge");
 			schemaAttributes.put("attr.name", "num_unknown_collaboration");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		edgeSchema.add(schemaAttributes);
-		
+
 		return edgeSchema;
 	}
-	
+
 
 	public Set> initializeNodeSchema() {
-		
+
 		Set> nodeSchema = new HashSet>();
 
-		Map schemaAttributes = new LinkedHashMap();   
-		
+		Map schemaAttributes = new LinkedHashMap();
+
 			schemaAttributes.put("id", "url");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "url");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-	
+
 			schemaAttributes = new LinkedHashMap();
-		
+
 			schemaAttributes.put("id", "label");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "label");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-		
+
 			schemaAttributes.put("id", "profile_url");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "profile_url");
 			schemaAttributes.put("attr.type", "string");
-		
+
 		nodeSchema.add(schemaAttributes);
-	
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "number_of_investigated_grants");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "number_of_investigated_grants");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "earliest_grant");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "earliest_grant");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_earliest_grant");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_earliest_grant");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "latest_grant");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "latest_grant");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_latest_grant");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_latest_grant");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
+
 			schemaAttributes = new LinkedHashMap();
-			
+
 			schemaAttributes.put("id", "num_unknown_grant");
 			schemaAttributes.put("for", "node");
 			schemaAttributes.put("attr.name", "num_unknown_grant");
 			schemaAttributes.put("attr.type", "int");
-		
+
 		nodeSchema.add(schemaAttributes);
-		
-		
+
+
 		return nodeSchema;
 	}
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationComparator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationComparator.java
index e0da2dac..8b97fb3f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationComparator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationComparator.java
@@ -1,22 +1,22 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
-
-import java.util.Comparator;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
-
-
-/**
- * This Comparator is used to sort the edges based on their IDs in ascending order.
- * @author cdtank
- *
- */
-public class CollaborationComparator implements Comparator {
-
-	@Override
-	public int compare(Collaboration arg0, Collaboration arg1) {
-		return arg0.getCollaborationID() - arg1.getCollaborationID();
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
+
+import java.util.Comparator;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
+
+
+/**
+ * This Comparator is used to sort the edges based on their IDs in ascending order.
+ * @author cdtank
+ *
+ */
+public class CollaborationComparator implements Comparator {
+
+	@Override
+	public int compare(Collaboration arg0, Collaboration arg1) {
+		return arg0.getCollaborationID() - arg1.getCollaborationID();
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationData.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationData.java
index 4e94c24b..d577c4d0 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationData.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaborationData.java
@@ -1,73 +1,73 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
-
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
-
-public abstract class CollaborationData {
-	
-	private Set collaborators;
-	private Set collaborations;
-	private Collaborator egoCollaborator;
-	private Set> NODE_SCHEMA;
-	private Set> EDGE_SCHEMA;
-
-	private Date builtFromCacheTime = null;
-		
-	public CollaborationData(Collaborator egoCollaborator, 
-							Set collaborators, 
-							Set collaborations) {
-		this.egoCollaborator = egoCollaborator;
-		this.collaborators = collaborators;
-		this.collaborations = collaborations;
-	}
-
-	public Date getBuiltFromCacheTime() { return builtFromCacheTime; }
-
-	public Set getCollaborators() {
-		return collaborators;
-	}
-
-	public Set getCollaborations() {
-		return collaborations;
-	}	
-	
-	public Collaborator getEgoCollaborator() {
-		return egoCollaborator;
-	}
-	
-	/*
-	 * Node Schema for graphML
-	 * */
-	public Set> getNodeSchema() {
-		
-		if (NODE_SCHEMA == null) {
-			NODE_SCHEMA = initializeNodeSchema();			
-		}
-		
-		return NODE_SCHEMA;
-	}
-	
-	/*
-	 * Edge Schema for graphML
-	 * */
-	public Set> getEdgeSchema() {
-		
-		if (EDGE_SCHEMA == null) {
-			EDGE_SCHEMA = initializeEdgeSchema();			
-		}
-		
-		return EDGE_SCHEMA;
-	}
-
-	public void setBuiltFromCacheTime(Date time) { this.builtFromCacheTime = time; }
-
-	abstract Set> initializeEdgeSchema();
-	
-	abstract Set> initializeNodeSchema();	
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaboration;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
+
+public abstract class CollaborationData {
+
+	private Set collaborators;
+	private Set collaborations;
+	private Collaborator egoCollaborator;
+	private Set> NODE_SCHEMA;
+	private Set> EDGE_SCHEMA;
+
+	private Date builtFromCacheTime = null;
+
+	public CollaborationData(Collaborator egoCollaborator,
+							Set collaborators,
+							Set collaborations) {
+		this.egoCollaborator = egoCollaborator;
+		this.collaborators = collaborators;
+		this.collaborations = collaborations;
+	}
+
+	public Date getBuiltFromCacheTime() { return builtFromCacheTime; }
+
+	public Set getCollaborators() {
+		return collaborators;
+	}
+
+	public Set getCollaborations() {
+		return collaborations;
+	}
+
+	public Collaborator getEgoCollaborator() {
+		return egoCollaborator;
+	}
+
+	/*
+	 * Node Schema for graphML
+	 * */
+	public Set> getNodeSchema() {
+
+		if (NODE_SCHEMA == null) {
+			NODE_SCHEMA = initializeNodeSchema();
+		}
+
+		return NODE_SCHEMA;
+	}
+
+	/*
+	 * Edge Schema for graphML
+	 * */
+	public Set> getEdgeSchema() {
+
+		if (EDGE_SCHEMA == null) {
+			EDGE_SCHEMA = initializeEdgeSchema();
+		}
+
+		return EDGE_SCHEMA;
+	}
+
+	public void setBuiltFromCacheTime(Date time) { this.builtFromCacheTime = time; }
+
+	abstract Set> initializeEdgeSchema();
+
+	abstract Set> initializeNodeSchema();
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaboratorComparator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaboratorComparator.java
index 24bfc739..c1218ef3 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaboratorComparator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/collaborationutils/CollaboratorComparator.java
@@ -1,21 +1,21 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
-
-import java.util.Comparator;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
-
-
-/**
- * This Comparator is used to sort the nodes based on their IDs in ascending order.
- * @author cdtank
- */
-public class CollaboratorComparator implements Comparator {
-
-	@Override
-	public int compare(Collaborator arg0, Collaborator arg1) {
-		return arg0.getCollaboratorID() - arg1.getCollaboratorID();
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils;
+
+import java.util.Comparator;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
+
+
+/**
+ * This Comparator is used to sort the nodes based on their IDs in ascending order.
+ * @author cdtank
+ */
+public class CollaboratorComparator implements Comparator {
+
+	@Override
+	public int compare(Collaborator arg0, Collaborator arg1) {
+		return arg0.getCollaboratorID() - arg1.getCollaboratorID();
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/MapOfScienceConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/MapOfScienceConstants.java
index 40ebe6db..f9c83a7d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/MapOfScienceConstants.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/MapOfScienceConstants.java
@@ -1,1145 +1,1145 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.constants;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This contains the constants related to map of science visualization.
- * @author cdtank
- */
-@SuppressWarnings("serial")
-public class MapOfScienceConstants {
-	
-	public static final Map DISCIPLINE_ID_TO_LABEL = new HashMap() {{
-		put(1, "Health Professionals");
-		put(2, "Chemistry");
-		put(3, "Social Sciences");
-		put(4, "Humanities");
-		put(5, "Brain Research");
-		put(6, "Medical Specialties");
-		put(7, "Infectious Diseases");
-		put(8, "Biotechnology");
-		put(9, "Biology");
-		put(10, "Earth Sciences");
-		put(11, "Chemical, Mechanical, & Civil Engineering");
-		put(12, "Math & Physics");
-		put(13, "Electrical Engineering & Computer Science");
-	}};	
-
-	
-	public static final Map SUB_DISCIPLINE_ID_TO_LABEL = new HashMap() {{
-		put(1, "Clinical Cancer Research");
-		put(2, "Circulation");
-		put(3, "Data Mining");
-		put(4, "Protein Science");
-		put(5, "Signal Processing");
-		put(6, "Neuroscience; Molecular & Cellular");
-		put(7, "Anesthetics & Analgesics");
-		put(8, "Urology");
-		put(9, "Immunology");
-		put(10, "Macromolecules & Polymers");
-		put(11, "Affective Disorders");
-		put(12, "Oncology");
-		put(13, "Surface Science");
-		put(14, "Nonlinear Analysis");
-		put(15, "Hospital Financial Management");
-		put(16, "Rheumatology");
-		put(17, "Occupational Health");
-		put(18, "Organic Chemistry");
-		put(19, "Leukemia");
-		put(20, "Virology");
-		put(21, "Plant Physiology");
-		put(22, "Allergy & Clinical Immunology");
-		put(23, "Material Science");
-		put(24, "Dermatology");
-		put(25, "Kidney");
-		put(26, "Pharmacology Science");
-		put(27, "Law");
-		put(28, "Medical Imaging");
-		put(29, "Bacteriology");
-		put(30, "Marine Biology");
-		put(31, "Developmental Biology");
-		put(32, "Digestion");
-		put(33, "Toxicology Applied Pharmacology");
-		put(34, "Transportation Research");
-		put(35, "Inorganic Chemistry");
-		put(36, "Chemical Engineering");
-		put(37, "Pharmaceutical Research");
-		put(38, "Semiconducting Materials");
-		put(39, "Diabetes Care");
-		put(40, "Clinical Neurophysiology");
-		put(41, "Opthomology");
-		put(42, "Nutrition");
-		put(43, "Finance");
-		put(44, "Neurosurgery");
-		put(45, "Fertility");
-		put(46, "Applied Optics");
-		put(47, "Nuclear Engineering");
-		put(48, "Molecular Cell Biology");
-		put(49, "Food Chemistry");
-		put(50, "Obstectrics");
-		put(51, "Chest & Respiratory");
-		put(52, "Earthquake Engineering");
-		put(53, "Zoology");
-		put(54, "Pharmaceutical Design");
-		put(55, "AntiMicrobial Agents");
-		put(56, "Systems Software");
-		put(57, "Decision Support Systems");
-		put(58, "Business Ethics");
-		put(59, "Vascular Surgery");
-		put(60, "Pulp & Paper");
-		put(61, "Seismology");
-		put(62, "Bone Joint Surgery");
-		put(63, "Neurology");
-		put(64, "Algebra");
-		put(65, "Antenna");
-		put(66, "Circuit Systems");
-		put(67, "Nursing Specialists");
-		put(68, "Retinal Surgery");
-		put(69, "Psychopharmacology");
-		put(70, "Aeronautics & Astronautics");
-		put(71, "Psychoanalysis");
-		put(72, "Oceanography");
-		put(73, "Sports Medicine");
-		put(74, "Operations Research");
-		put(75, "Chromatography; Electrophoresis");
-		put(76, "Pediatrics");
-		put(77, "Cardiovascular");
-		put(78, "Paleobiology");
-		put(79, "Economics");
-		put(80, "Hypertension");
-		put(81, "Human Molecular Genetics");
-		put(82, "Clinical Endocrinology");
-		put(83, "Dietetics");
-		put(84, "Clinical Microbiology");
-		put(85, "Hospital Pharmacy");
-		put(86, "Gas Turbines");
-		put(87, "Remote Sensing");
-		put(88, "Computational Chemistry");
-		put(89, "Surgery");
-		put(90, "Ceramics");
-		put(91, "AIDS");
-		put(92, "Military Aviation");
-		put(93, "Medical Records");
-		put(94, "Statistics");
-		put(95, "Applied Economics");
-		put(96, "Automatic Control");
-		put(97, "Atmospheric Science");
-		put(98, "Automotive Engineering");
-		put(99, "BioStatistics");
-		put(100, "Employee Health Benefit Plans");
-		put(101, "Transplantation");
-		put(102, "Alloys");
-		put(103, "Astronomy & Astrophysics");
-		put(104, "Substance-abuse Treatment");
-		put(105, "Research Policy; Technology Management");
-		put(106, "Drug Discovery");
-		put(107, "Animal Science");
-		put(108, "Chaos Fractals & Complexity");
-		put(109, "Environmental Contamination");
-		put(110, "Otolaryngology; Laryngoscope");
-		put(111, "Mechanical Design Engineering");
-		put(112, "Classics");
-		put(113, "Biological Conservation");
-		put(114, "Thoracic Surgery");
-		put(115, "Phytochemistry");
-		put(116, "Tropical Medicine");
-		put(117, "Food Protection");
-		put(118, "Broadband Communication");
-		put(119, "Energy Fuel");
-		put(120, "Soil Quality");
-		put(121, "Integrated Circuit Design");
-		put(122, "Philosophy Psychology");
-		put(123, "Construction & Project Management");
-		put(124, "Social Psychology");
-		put(125, "High Energy Physics");
-		put(126, "Strategic Management");
-		put(127, "Genomics & Nucleic Acids");
-		put(128, "Heat Transfer");
-		put(129, "Cement & Concrete");
-		put(130, "Pathology");
-		put(131, "Pest Management Science");
-		put(132, "Corrosion");
-		put(133, "Veterinary Science");
-		put(134, "Teacher Education; Evaluation");
-		put(135, "Stem Cells");
-		put(136, "Image Processing");
-		put(137, "Neural Networks");
-		put(138, "Nursing Education");
-		put(139, "Intensive Care");
-		put(140, "Alternative Complementary Medicine");
-		put(141, "Petroleum Engineering");
-		put(142, "Music & Theatre");
-		put(143, "Memory & Cognition");
-		put(144, "Vision");
-		put(145, "Communication Research");
-		put(146, "BioInformatics");
-		put(147, "Mechanics of Solids & Structures");
-		put(148, "Pharmacy");
-		put(149, "Geomorphology");
-		put(150, "Psychosis; Schizophrenia");
-		put(151, "BioEthics");
-		put(152, "Parellel Computing");
-		put(153, "Power Distribution");
-		put(154, "Gerontology");
-		put(155, "Wood");
-		put(156, "Discrete Applied Mathematics");
-		put(157, "Geology & Tectonics");
-		put(158, "GeoChemistry");
-		put(159, "Mobil Networks");
-		put(160, "Artificial Intelligence");
-		put(161, "Electro Analytical Chemistry");
-		put(162, "Dental Education");
-		put(163, "Enzyme Microbiological Techniques");
-		put(164, "Library Science; Infomation Retrieval");
-		put(165, "Biomaterials");
-		put(166, "Quaternary Research");
-		put(167, "Endoscopy");
-		put(168, "Composites");
-		put(169, "Language Learning");
-		put(170, "History; Gender Studies");
-		put(171, "Leadership & Organizational Behavior");
-		put(172, "Agricultural Engineering");
-		put(173, "Computer-Aided Process Planning");
-		put(174, "Geriatrics");
-		put(175, "Solid State Electronics");
-		put(176, "Optics & Lasers");
-		put(177, "Wool");
-		put(178, "Biomechanics");
-		put(179, "Molecular Physics");
-		put(180, "Comparative Animal Physiology");
-		put(181, "Political Science");
-		put(182, "History Philosophy");
-		put(183, "Poetry");
-		put(184, "Nuclear Medicine");
-		put(185, "Nanotechnology");
-		put(186, "Speech Recognitation");
-		put(187, "Fluid Mechanics");
-		put(188, "Computer Graphics");
-		put(189, "Filtration Membrane");
-		put(190, "Clinical Infectious Disease");
-		put(191, "Prosthetic Dentistry");
-		put(192, "Orthodontics");
-		put(193, "Robotic Systems");
-		put(194, "Dental Research");
-		put(195, "Atomic Spectrometry");
-		put(196, "Botany");
-		put(197, "Public Health Service");
-		put(198, "Political Geography");
-		put(199, "Catalysis");
-		put(200, "Radiation Protection");
-		put(201, "Machine Tools");
-		put(202, "Veterinary Medicine");
-		put(203, "Periodontology");
-		put(204, "Birth Defects");
-		put(205, "Thrombosis");
-		put(206, "Freshwater Biology");
-		put(207, "Mental Health Nursing");
-		put(208, "Artificial Evolution");
-		put(209, "English Literature");
-		put(210, "Plastic Surgery");
-		put(211, "Nursing Administration");
-		put(212, "Higher Education");
-		put(213, "Ecology");
-		put(214, "Modern Language");
-		put(215, "Neurophsyiology & Neuroscience");
-		put(216, "Mining");
-		put(217, "Aquaculture");
-		put(218, "Molecular Biological Evolution");
-		put(219, "Photonics");
-		put(220, "Urban Studies");
-		put(221, "Functional Analysis");
-		put(222, "Linguistics");
-		put(223, "Photo-Optics");
-		put(224, "Spine");
-		put(225, "Robotics");
-		put(226, "Audiology");
-		put(227, "Soil Science");
-		put(228, "Simulation");
-		put(229, "Nuclear Instrumentation");
-		put(230, "Hispanic Studies");
-		put(231, "Forest Science");
-		put(232, "Plasma Physics");
-		put(233, "Proteomics");
-		put(234, "Symbolic Interaction");
-		put(235, "Child & Adolescent Psychiatry");
-		put(236, "General Practice");
-		put(237, "Environmental Management");
-		put(238, "Diabetes Metabolism");
-		put(239, "Geotechnical Engineering");
-		put(240, "Instrumentation");
-		put(241, "Clinical Chemistry");
-		put(242, "Fluid Engineering");
-		put(243, "Arthroscopy");
-		put(244, "Eating Disorders; Sex Roles");
-		put(245, "Water Quality & Resource Management");
-		put(246, "Ethnic Migration");
-		put(247, "Geriatric Psychiatry");
-		put(248, "Sound & Vibration");
-		put(249, "Ore Processing");
-		put(250, "Ethnology");
-		put(251, "Prenatal Diagnostics");
-		put(252, "Cancer (translated)");
-		put(253, "Dialectics");
-		put(254, "Atmospheric GeoPhysics");
-		put(255, "Flavors & Fragrance");
-		put(256, "Numerical Methods in Engineering");
-		put(257, "EthnoPharmcology");
-		put(258, "Electrocardiography");
-		put(259, "International Development");
-		put(260, "Electrochemistry");
-		put(261, "Political Studies");
-		put(262, "Molecular Endocrinology");
-		put(263, "Surface Coating Technology");
-		put(264, "Molecular Biochemical Parasitology");
-		put(265, "Vocational Counseling");
-		put(266, "Oil & Natural Gas");
-		put(267, "International Conflict");
-		put(268, "Art History");
-		put(269, "Applied Catalysis");
-		put(270, "Agricultural Economics");
-		put(271, "Social Work");
-		put(272, "Medical Insurance");
-		put(273, "Fluid Phase Equilibrium");
-		put(274, "Biotechnology Trends");
-		put(275, "Air Quality");
-		put(276, "Search Engines; Web Crawling");
-		put(277, "Colloid");
-		put(278, "Applied Physiology; Muscle");
-		put(279, "Biblical Literature");
-		put(280, "Fault Tolerant Computing");
-		put(281, "Third World Political Economics");
-		put(282, "Public Hospitals");
-		put(283, "Sociology");
-		put(284, "Horticulture");
-		put(285, "Bone & Osteoporosis");
-		put(286, "Radiation Therapy");
-		put(287, "Water Treatment");
-		put(288, "Spyware; Malware");
-		put(289, "Behavioral Research Therapy");
-		put(290, "Science Education");
-		put(291, "Design & Analysis of Algorithms");
-		put(292, "Hospice Care");
-		put(293, "Climatology");
-		put(294, "Crop Science");
-		put(295, "Fuzzy Sets");
-		put(296, "Vehicle System Design");
-		put(297, "Transfusion");
-		put(298, "AIDS Treatment");
-		put(299, "Wireless Communication");
-		put(300, "Atherosclerosis");
-		put(301, "Region & Medical Ethics");
-		put(302, "Speech Language & Hearing");
-		put(303, "Thoracic & Respiratory");
-		put(304, "Veterinary Microbiology");
-		put(305, "Environmental Protection");
-		put(306, "Computer Systems Design");
-		put(307, "Environmental Polution");
-		put(308, "Electrical Networks");
-		put(309, "Endoscopy");
-		put(310, "Chemistry & Material Science");
-		put(311, "Medical Screening & Epidemiology");
-		put(312, "Child Development");
-		put(313, "Pain");
-		put(314, "Public Administration");
-		put(315, "Soil Analysis");
-		put(316, "Safety Management");
-		put(317, "Pattern Recognition");
-		put(318, "Mental Health Assessment");
-		put(319, "Clinical Medicine (translated)");
-		put(320, "Mutation; DNA Repair");
-		put(321, "Human Evolution");
-		put(322, "Space Research");
-		put(323, "Entomology");
-		put(324, "Epilepsy");
-		put(325, "Plant Ecology");
-		put(326, "Computer Aided Molecular Design");
-		put(327, "Criminology");
-		put(328, "Forensic Psychiatry");
-		put(329, "Personality");
-		put(330, "Test Equipment");
-		put(331, "Logic");
-		put(332, "Pulp Paper Science");
-		put(333, "Textiles");
-		put(334, "Contemporary Philosophy");
-		put(335, "Hydrology Soil Contamination");
-		put(336, "Child Abuse");
-		put(337, "Mathematics Research");
-		put(338, "Geology (International)");
-		put(339, "Environmental Chemistry");
-		put(340, "Parasitology");
-		put(341, "Dairy Science");
-		put(342, "Water Policy");
-		put(343, "Fish Research");
-		put(344, "Printing");
-		put(345, "Genetics");
-		put(346, "Industrial Chemistry");
-		put(347, "Obesity");
-		put(348, "Literary Criticism");
-		put(349, "Hepatology");
-		put(350, "Physical Therapy; Brain Injury");
-		put(351, "Computational & Applied Math");
-		put(352, "World Health Organization");
-		put(353, "Geophysical Science");
-		put(354, "Forensic Medicine");
-		put(355, "Psychiatric Services");
-		put(356, "Software Design and Development");
-		put(357, "Wildlife Management");
-		put(358, "Ocean Coastal Management");
-		put(359, "Database Design & Management");
-		put(360, "Financial Accounting");
-		put(361, "Microbiology Biotechnology");
-		put(362, "Water Utilities");
-		put(363, "Sedimentary Geology");
-		put(364, "Geodesy");
-		put(365, "Surfactants");
-		put(366, "Eye");
-		put(367, "Addictive Behavior");
-		put(368, "Naval Architecture");
-		put(369, "Environmental Microbiology");
-		put(370, "Electronic Imaging");
-		put(371, "Functional Programing");
-		put(372, "Applied Genetics");
-		put(373, "Plant Disease");
-		put(374, "Water Resource");
-		put(375, "Developmental Economics");
-		put(376, "Nuclear Physics");
-		put(377, "International Economics");
-		put(378, "Radiology");
-		put(379, "German Studies");
-		put(380, "Medieval History");
-		put(381, "Philosophy of Education");
-		put(382, "Oceanographic Instrumentation");
-		put(383, "Foreign Policy");
-		put(384, "Gut");
-		put(385, "Microwaves; Radio Frequencies");
-		put(386, "School Psychology");
-		put(387, "Vaccines");
-		put(388, "Environmental Law");
-		put(389, "Mass Spectrometry");
-		put(390, "Psychiatric Nursing");
-		put(391, "Asian Studies");
-		put(392, "Optimization Theory");
-		put(393, "Mathematical Science (Russia)");
-		put(394, "Gene Therapy");
-		put(395, "Security; Cryptography");
-		put(396, "Materials Processing");
-		put(397, "Rural Health Care");
-		put(398, "Power Systems");
-		put(399, "Surgical Oncology");
-		put(400, "Chip Design & Manufacturing");
-		put(401, "Sociobiology");
-		put(402, "Molecular Medicine");
-		put(403, "Human Resource Management");
-		put(404, "Ecological Modeling");
-		put(405, "Clinical Rehabilitation");
-		put(406, "Metallurgy");
-		put(407, "Ethics");
-		put(408, "Marital & Family Therapy");
-		put(409, "Aerospace");
-		put(410, "Critical Studies");
-		put(411, "Econometrics");
-		put(412, "Neuroscience Methods");
-		put(413, "Mineralogy");
-		put(414, "Trauma");
-		put(415, "Thermal Analysis");
-		put(416, "Solar & Wind Power");
-		put(417, "Ocean Engineering");
-		put(418, "Educational Psychology");
-		put(419, "Mycology");
-		put(420, "Semiotics");
-		put(421, "Dyes & Pigments");
-		put(422, "Drug Safety");
-		put(423, "Molecular Ecology");
-		put(424, "Cytogentics & Genome Mapping");
-		put(425, "Clinical Psychiatry");
-		put(426, "Paleogeography");
-		put(427, "Water Waste");
-		put(428, "Computer Networks");
-		put(429, "Weed Management");
-		put(430, "User Interface Design");
-		put(431, "Public Policy");
-		put(432, "Liquid Crystals");
-		put(433, "Control Systems");
-		put(434, "Environmental Policy");
-		put(435, "Topology");
-		put(436, "Construction");
-		put(437, "Dams & Tunnels");
-		put(438, "Regional Studies");
-		put(439, "Electrochemical Development");
-		put(440, "Digital Printing");
-		put(441, "Peptides");
-		put(442, "Applied Geophysics");
-		put(443, "Sexually Transmitted Diseases");
-		put(444, "Engineering Education");
-		put(445, "NeuroImmunology");
-		put(446, "Machine Learning");
-		put(447, "Geriatric Nursing");
-		put(448, "Sensors & Actuators");
-		put(449, "Systematics & Evolutionary Microbiology");
-		put(450, "Image Processing");
-		put(451, "Medical Education");
-		put(452, "Magnetic Resonance Imagery");
-		put(453, "Hospital Management");
-		put(454, "Insect Physiology");
-		put(455, "Power Transmission");
-		put(456, "Food Engineering");
-		put(457, "Oral Surgery");
-		put(458, "Computer Systems Theory");
-		put(459, "Combustion");
-		put(460, "Dermatological Surgery");
-		put(461, "Wildlife Research");
-		put(462, "Midwifery");
-		put(463, "Physics; Current Developments");
-		put(464, "Psychiatric & Behavioral Genetics");
-		put(465, "Fractures & Fatigue");
-		put(466, "Emergency Medicine");
-		put(467, "Cross Disciplinary Studies");
-		put(468, "Archeological Science");
-		put(469, "Preventive Medicine");
-		put(470, "Carbon");
-		put(471, "Gynecology Oncology");
-		put(472, "Psychosomatic Medicine");
-		put(473, "Pharmaco Economics");
-		put(474, "Computer Modeling and Animation");
-		put(475, "Medical Practice");
-		put(476, "Cancer Statistics");
-		put(477, "Consciousness");
-		put(478, "Otolaryngology; Head Neck");
-		put(479, "Heart Failure; Catheters");
-		put(480, "Wood & Wood Components");
-		put(481, "Circuits");
-		put(482, "Friction Lubrication & Wear");
-		put(483, "Superconductor Science");
-		put(484, "Antennae; Mobile Radio");
-		put(485, "Headache");
-		put(486, "Operations Management");
-		put(487, "Fish Biology");
-		put(488, "Economic & Human Biology");
-		put(489, "Consumer Electronics");
-		put(490, "Menopause");
-		put(491, "Chemistry (Russia)");
-		put(492, "GeoPolitics");
-		put(493, "Glaciology");
-		put(494, "Medical Libraries");
-		put(495, "Opera");
-		put(496, "Education");
-		put(497, "Acoustics");
-		put(498, "Pragmatics & Discourse");
-		put(499, "Reproduction Veterinary");
-		put(500, "Crystallography");
-		put(501, "Applied Math & Computation");
-		put(502, "Socio-Cultural Anthropology");
-		put(503, "Poultry Science");
-		put(504, "Artifical Organs");
-		put(505, "Physical Therapy; Orthopedic");
-		put(506, "Pulmonary");
-		put(507, "Waste Management");
-		put(508, "Marine Pollution");
-		put(509, "Toxins");
-		put(510, "Hearing Research");
-		put(511, "Human Rights");
-		put(512, "Lung Cancer");
-		put(513, "Social Economics");
-		put(514, "Carbohydrate Research");
-		put(515, "Biotechnology Bioengineering");
-		put(516, "Rural Studies");
-		put(517, "Electronics");
-		put(518, "Defects & Diffusion in Materials");
-		put(519, "Forensic Science");
-		put(520, "Rangeland Ecology");
-		put(521, "Welding");
-		put(522, "Reliability Engineering");
-		put(523, "Molecular Biology Methods");
-		put(524, "Mammals");
-		put(525, "Impotence");
-		put(526, "Fuzzy Logic");
-		put(527, "Tourism");
-		put(528, "Aquatic Disease");
-		put(529, "Geographic Information Science");
-		put(530, "Hormone Research");
-		put(531, "Public Health");
-		put(532, "Sleep");
-		put(533, "Neurotoxicology");
-		put(534, "Pediatric Research");
-		put(535, "Education Psychological Measures");
-		put(536, "Marketing");
-		put(537, "Clinical Medicine (Romania)");
-		put(538, "Green Chemistry");
-		put(539, "Optometry");
-		put(540, "Textile Art");
-		put(541, "Italian Studies");
-		put(542, "Perception Motor Skills");
-		put(543, "World Trade; Law");
-		put(544, "Insects");
-		put(545, "Australian Ecology");
-		put(546, "Paints & Coatings");
-		put(547, "Nursing Theory");
-		put(548, "Crustaceans");
-		put(549, "Laser Surgery");
-		put(550, "Bulk Solid Handling");
-		put(551, "Wetlands");
-		put(552, "GIS (non English)");
-		put(553, "Power Transmission & Control");
-		put(554, "Agricultural Environmental Medicine");
-	}};		
-	
-	public static final Map SUB_DISCIPLINE_ID_TO_DISCIPLINE_ID = new HashMap() {{ 
-		put(1, 7);
-		put(2, 6);
-		put(3, 13);
-		put(4, 7);
-		put(5, 13);
-		put(6, 5);
-		put(7, 6);
-		put(8, 6);
-		put(9, 7);
-		put(10, 2);
-		put(11, 1);
-		put(12, 6);
-		put(13, 12);
-		put(14, 12);
-		put(15, 1);
-		put(16, 7);
-		put(17, 1);
-		put(18, 2);
-		put(19, 7);
-		put(20, 7);
-		put(21, 9);
-		put(22, 6);
-		put(23, 11);
-		put(24, 1);
-		put(25, 6);
-		put(26, 5);
-		put(27, 3);
-		put(28, 1);
-		put(29, 7);
-		put(30, 11);
-		put(31, 7);
-		put(32, 6);
-		put(33, 1);
-		put(34, 11);
-		put(35, 2);
-		put(36, 11);
-		put(37, 1);
-		put(38, 12);
-		put(39, 6);
-		put(40, 5);
-		put(41, 1);
-		put(42, 6);
-		put(43, 3);
-		put(44, 1);
-		put(45, 6);
-		put(46, 13);
-		put(47, 11);
-		put(48, 7);
-		put(49, 8);
-		put(50, 6);
-		put(51, 6);
-		put(52, 11);
-		put(53, 9);
-		put(54, 2);
-		put(55, 6);
-		put(56, 13);
-		put(57, 3);
-		put(58, 3);
-		put(59, 6);
-		put(60, 11);
-		put(61, 10);
-		put(62, 1);
-		put(63, 5);
-		put(64, 12);
-		put(65, 13);
-		put(66, 13);
-		put(67, 1);
-		put(68, 1);
-		put(69, 5);
-		put(70, 11);
-		put(71, 1);
-		put(72, 11);
-		put(73, 1);
-		put(74, 3);
-		put(75, 2);
-		put(76, 6);
-		put(77, 6);
-		put(78, 10);
-		put(79, 3);
-		put(80, 6);
-		put(81, 7);
-		put(82, 6);
-		put(83, 6);
-		put(84, 6);
-		put(85, 6);
-		put(86, 11);
-		put(87, 11);
-		put(88, 2);
-		put(89, 6);
-		put(90, 11);
-		put(91, 6);
-		put(92, 12);
-		put(93, 1);
-		put(94, 3);
-		put(95, 3);
-		put(96, 13);
-		put(97, 11);
-		put(98, 11);
-		put(99, 3);
-		put(100, 1);
-		put(101, 6);
-		put(102, 11);
-		put(103, 12);
-		put(104, 1);
-		put(105, 3);
-		put(106, 6);
-		put(107, 6);
-		put(108, 12);
-		put(109, 11);
-		put(110, 1);
-		put(111, 11);
-		put(112, 4);
-		put(113, 9);
-		put(114, 6);
-		put(115, 2);
-		put(116, 9);
-		put(117, 8);
-		put(118, 13);
-		put(119, 11);
-		put(120, 11);
-		put(121, 13);
-		put(122, 4);
-		put(123, 3);
-		put(124, 3);
-		put(125, 12);
-		put(126, 3);
-		put(127, 8);
-		put(128, 11);
-		put(129, 11);
-		put(130, 7);
-		put(131, 9);
-		put(132, 11);
-		put(133, 6);
-		put(134, 3);
-		put(135, 6);
-		put(136, 13);
-		put(137, 13);
-		put(138, 1);
-		put(139, 6);
-		put(140, 6);
-		put(141, 11);
-		put(142, 4);
-		put(143, 5);
-		put(144, 5);
-		put(145, 3);
-		put(146, 8);
-		put(147, 11);
-		put(148, 6);
-		put(149, 10);
-		put(150, 1);
-		put(151, 1);
-		put(152, 13);
-		put(153, 13);
-		put(154, 1);
-		put(155, 11);
-		put(156, 12);
-		put(157, 10);
-		put(158, 10);
-		put(159, 13);
-		put(160, 13);
-		put(161, 2);
-		put(162, 1);
-		put(163, 8);
-		put(164, 13);
-		put(165, 1);
-		put(166, 10);
-		put(167, 6);
-		put(168, 11);
-		put(169, 3);
-		put(170, 4);
-		put(171, 3);
-		put(172, 11);
-		put(173, 3);
-		put(174, 1);
-		put(175, 12);
-		put(176, 12);
-		put(177, 11);
-		put(178, 1);
-		put(179, 2);
-		put(180, 9);
-		put(181, 3);
-		put(182, 4);
-		put(183, 4);
-		put(184, 1);
-		put(185, 12);
-		put(186, 13);
-		put(187, 11);
-		put(188, 13);
-		put(189, 11);
-		put(190, 6);
-		put(191, 1);
-		put(192, 1);
-		put(193, 13);
-		put(194, 1);
-		put(195, 2);
-		put(196, 9);
-		put(197, 1);
-		put(198, 3);
-		put(199, 2);
-		put(200, 6);
-		put(201, 11);
-		put(202, 6);
-		put(203, 1);
-		put(204, 7);
-		put(205, 6);
-		put(206, 9);
-		put(207, 1);
-		put(208, 13);
-		put(209, 4);
-		put(210, 1);
-		put(211, 1);
-		put(212, 3);
-		put(213, 9);
-		put(214, 4);
-		put(215, 5);
-		put(216, 11);
-		put(217, 9);
-		put(218, 9);
-		put(219, 13);
-		put(220, 3);
-		put(221, 12);
-		put(222, 4);
-		put(223, 11);
-		put(224, 1);
-		put(225, 13);
-		put(226, 1);
-		put(227, 11);
-		put(228, 12);
-		put(229, 12);
-		put(230, 4);
-		put(231, 9);
-		put(232, 12);
-		put(233, 8);
-		put(234, 3);
-		put(235, 3);
-		put(236, 1);
-		put(237, 3);
-		put(238, 6);
-		put(239, 11);
-		put(240, 13);
-		put(241, 6);
-		put(242, 11);
-		put(243, 1);
-		put(244, 3);
-		put(245, 11);
-		put(246, 3);
-		put(247, 1);
-		put(248, 11);
-		put(249, 11);
-		put(250, 3);
-		put(251, 6);
-		put(252, 6);
-		put(253, 13);
-		put(254, 11);
-		put(255, 2);
-		put(256, 11);
-		put(257, 2);
-		put(258, 6);
-		put(259, 3);
-		put(260, 11);
-		put(261, 3);
-		put(262, 6);
-		put(263, 12);
-		put(264, 9);
-		put(265, 3);
-		put(266, 11);
-		put(267, 3);
-		put(268, 4);
-		put(269, 2);
-		put(270, 3);
-		put(271, 3);
-		put(272, 1);
-		put(273, 11);
-		put(274, 8);
-		put(275, 11);
-		put(276, 13);
-		put(277, 2);
-		put(278, 1);
-		put(279, 4);
-		put(280, 13);
-		put(281, 3);
-		put(282, 1);
-		put(283, 3);
-		put(284, 9);
-		put(285, 6);
-		put(286, 6);
-		put(287, 11);
-		put(288, 13);
-		put(289, 1);
-		put(290, 3);
-		put(291, 12);
-		put(292, 6);
-		put(293, 11);
-		put(294, 9);
-		put(295, 13);
-		put(296, 11);
-		put(297, 7);
-		put(298, 1);
-		put(299, 13);
-		put(300, 6);
-		put(301, 1);
-		put(302, 5);
-		put(303, 6);
-		put(304, 6);
-		put(305, 11);
-		put(306, 13);
-		put(307, 11);
-		put(308, 13);
-		put(309, 6);
-		put(310, 2);
-		put(311, 6);
-		put(312, 3);
-		put(313, 6);
-		put(314, 3);
-		put(315, 11);
-		put(316, 11);
-		put(317, 13);
-		put(318, 1);
-		put(319, 6);
-		put(320, 7);
-		put(321, 9);
-		put(322, 12);
-		put(323, 9);
-		put(324, 5);
-		put(325, 9);
-		put(326, 2);
-		put(327, 3);
-		put(328, 3);
-		put(329, 3);
-		put(330, 13);
-		put(331, 13);
-		put(332, 11);
-		put(333, 11);
-		put(334, 4);
-		put(335, 11);
-		put(336, 3);
-		put(337, 12);
-		put(338, 10);
-		put(339, 2);
-		put(340, 9);
-		put(341, 6);
-		put(342, 11);
-		put(343, 11);
-		put(344, 11);
-		put(345, 9);
-		put(346, 11);
-		put(347, 6);
-		put(348, 4);
-		put(349, 6);
-		put(350, 5);
-		put(351, 12);
-		put(352, 9);
-		put(353, 12);
-		put(354, 1);
-		put(355, 1);
-		put(356, 13);
-		put(357, 9);
-		put(358, 11);
-		put(359, 13);
-		put(360, 3);
-		put(361, 8);
-		put(362, 11);
-		put(363, 10);
-		put(364, 11);
-		put(365, 2);
-		put(366, 1);
-		put(367, 1);
-		put(368, 12);
-		put(369, 11);
-		put(370, 13);
-		put(371, 13);
-		put(372, 9);
-		put(373, 9);
-		put(374, 11);
-		put(375, 3);
-		put(376, 12);
-		put(377, 3);
-		put(378, 6);
-		put(379, 4);
-		put(380, 4);
-		put(381, 4);
-		put(382, 11);
-		put(383, 3);
-		put(384, 6);
-		put(385, 13);
-		put(386, 3);
-		put(387, 7);
-		put(388, 3);
-		put(389, 8);
-		put(390, 1);
-		put(391, 4);
-		put(392, 12);
-		put(393, 12);
-		put(394, 7);
-		put(395, 13);
-		put(396, 11);
-		put(397, 1);
-		put(398, 13);
-		put(399, 6);
-		put(400, 13);
-		put(401, 9);
-		put(402, 1);
-		put(403, 3);
-		put(404, 9);
-		put(405, 6);
-		put(406, 11);
-		put(407, 4);
-		put(408, 3);
-		put(409, 12);
-		put(410, 4);
-		put(411, 3);
-		put(412, 5);
-		put(413, 10);
-		put(414, 1);
-		put(415, 2);
-		put(416, 11);
-		put(417, 11);
-		put(418, 3);
-		put(419, 9);
-		put(420, 4);
-		put(421, 11);
-		put(422, 6);
-		put(423, 9);
-		put(424, 7);
-		put(425, 1);
-		put(426, 10);
-		put(427, 11);
-		put(428, 13);
-		put(429, 11);
-		put(430, 13);
-		put(431, 3);
-		put(432, 2);
-		put(433, 13);
-		put(434, 3);
-		put(435, 12);
-		put(436, 11);
-		put(437, 11);
-		put(438, 3);
-		put(439, 11);
-		put(440, 11);
-		put(441, 7);
-		put(442, 11);
-		put(443, 6);
-		put(444, 3);
-		put(445, 5);
-		put(446, 13);
-		put(447, 1);
-		put(448, 11);
-		put(449, 8);
-		put(450, 13);
-		put(451, 1);
-		put(452, 1);
-		put(453, 1);
-		put(454, 9);
-		put(455, 13);
-		put(456, 8);
-		put(457, 1);
-		put(458, 13);
-		put(459, 11);
-		put(460, 1);
-		put(461, 9);
-		put(462, 1);
-		put(463, 12);
-		put(464, 3);
-		put(465, 11);
-		put(466, 6);
-		put(467, 4);
-		put(468, 10);
-		put(469, 1);
-		put(470, 2);
-		put(471, 6);
-		put(472, 3);
-		put(473, 1);
-		put(474, 13);
-		put(475, 1);
-		put(476, 12);
-		put(477, 5);
-		put(478, 1);
-		put(479, 6);
-		put(480, 11);
-		put(481, 13);
-		put(482, 11);
-		put(483, 12);
-		put(484, 13);
-		put(485, 5);
-		put(486, 3);
-		put(487, 9);
-		put(488, 4);
-		put(489, 13);
-		put(490, 6);
-		put(491, 2);
-		put(492, 3);
-		put(493, 11);
-		put(494, 1);
-		put(495, 4);
-		put(496, 3);
-		put(497, 11);
-		put(498, 3);
-		put(499, 6);
-		put(500, 2);
-		put(501, 12);
-		put(502, 4);
-		put(503, 6);
-		put(504, 6);
-		put(505, 1);
-		put(506, 6);
-		put(507, 11);
-		put(508, 11);
-		put(509, 2);
-		put(510, 1);
-		put(511, 3);
-		put(512, 6);
-		put(513, 3);
-		put(514, 8);
-		put(515, 8);
-		put(516, 3);
-		put(517, 13);
-		put(518, 11);
-		put(519, 1);
-		put(520, 9);
-		put(521, 11);
-		put(522, 3);
-		put(523, 7);
-		put(524, 9);
-		put(525, 6);
-		put(526, 13);
-		put(527, 3);
-		put(528, 9);
-		put(529, 11);
-		put(530, 6);
-		put(531, 6);
-		put(532, 5);
-		put(533, 5);
-		put(534, 6);
-		put(535, 3);
-		put(536, 3);
-		put(537, 6);
-		put(538, 2);
-		put(539, 1);
-		put(540, 11);
-		put(541, 4);
-		put(542, 1);
-		put(543, 3);
-		put(544, 9);
-		put(545, 9);
-		put(546, 11);
-		put(547, 1);
-		put(548, 9);
-		put(549, 1);
-		put(550, 11);
-		put(551, 9);
-		put(552, 11);
-		put(553, 13);
-		put(554, 6);
-	}};
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This contains the constants related to map of science visualization.
+ * @author cdtank
+ */
+@SuppressWarnings("serial")
+public class MapOfScienceConstants {
+
+	public static final Map DISCIPLINE_ID_TO_LABEL = new HashMap() {{
+		put(1, "Health Professionals");
+		put(2, "Chemistry");
+		put(3, "Social Sciences");
+		put(4, "Humanities");
+		put(5, "Brain Research");
+		put(6, "Medical Specialties");
+		put(7, "Infectious Diseases");
+		put(8, "Biotechnology");
+		put(9, "Biology");
+		put(10, "Earth Sciences");
+		put(11, "Chemical, Mechanical, & Civil Engineering");
+		put(12, "Math & Physics");
+		put(13, "Electrical Engineering & Computer Science");
+	}};
+
+
+	public static final Map SUB_DISCIPLINE_ID_TO_LABEL = new HashMap() {{
+		put(1, "Clinical Cancer Research");
+		put(2, "Circulation");
+		put(3, "Data Mining");
+		put(4, "Protein Science");
+		put(5, "Signal Processing");
+		put(6, "Neuroscience; Molecular & Cellular");
+		put(7, "Anesthetics & Analgesics");
+		put(8, "Urology");
+		put(9, "Immunology");
+		put(10, "Macromolecules & Polymers");
+		put(11, "Affective Disorders");
+		put(12, "Oncology");
+		put(13, "Surface Science");
+		put(14, "Nonlinear Analysis");
+		put(15, "Hospital Financial Management");
+		put(16, "Rheumatology");
+		put(17, "Occupational Health");
+		put(18, "Organic Chemistry");
+		put(19, "Leukemia");
+		put(20, "Virology");
+		put(21, "Plant Physiology");
+		put(22, "Allergy & Clinical Immunology");
+		put(23, "Material Science");
+		put(24, "Dermatology");
+		put(25, "Kidney");
+		put(26, "Pharmacology Science");
+		put(27, "Law");
+		put(28, "Medical Imaging");
+		put(29, "Bacteriology");
+		put(30, "Marine Biology");
+		put(31, "Developmental Biology");
+		put(32, "Digestion");
+		put(33, "Toxicology Applied Pharmacology");
+		put(34, "Transportation Research");
+		put(35, "Inorganic Chemistry");
+		put(36, "Chemical Engineering");
+		put(37, "Pharmaceutical Research");
+		put(38, "Semiconducting Materials");
+		put(39, "Diabetes Care");
+		put(40, "Clinical Neurophysiology");
+		put(41, "Opthomology");
+		put(42, "Nutrition");
+		put(43, "Finance");
+		put(44, "Neurosurgery");
+		put(45, "Fertility");
+		put(46, "Applied Optics");
+		put(47, "Nuclear Engineering");
+		put(48, "Molecular Cell Biology");
+		put(49, "Food Chemistry");
+		put(50, "Obstectrics");
+		put(51, "Chest & Respiratory");
+		put(52, "Earthquake Engineering");
+		put(53, "Zoology");
+		put(54, "Pharmaceutical Design");
+		put(55, "AntiMicrobial Agents");
+		put(56, "Systems Software");
+		put(57, "Decision Support Systems");
+		put(58, "Business Ethics");
+		put(59, "Vascular Surgery");
+		put(60, "Pulp & Paper");
+		put(61, "Seismology");
+		put(62, "Bone Joint Surgery");
+		put(63, "Neurology");
+		put(64, "Algebra");
+		put(65, "Antenna");
+		put(66, "Circuit Systems");
+		put(67, "Nursing Specialists");
+		put(68, "Retinal Surgery");
+		put(69, "Psychopharmacology");
+		put(70, "Aeronautics & Astronautics");
+		put(71, "Psychoanalysis");
+		put(72, "Oceanography");
+		put(73, "Sports Medicine");
+		put(74, "Operations Research");
+		put(75, "Chromatography; Electrophoresis");
+		put(76, "Pediatrics");
+		put(77, "Cardiovascular");
+		put(78, "Paleobiology");
+		put(79, "Economics");
+		put(80, "Hypertension");
+		put(81, "Human Molecular Genetics");
+		put(82, "Clinical Endocrinology");
+		put(83, "Dietetics");
+		put(84, "Clinical Microbiology");
+		put(85, "Hospital Pharmacy");
+		put(86, "Gas Turbines");
+		put(87, "Remote Sensing");
+		put(88, "Computational Chemistry");
+		put(89, "Surgery");
+		put(90, "Ceramics");
+		put(91, "AIDS");
+		put(92, "Military Aviation");
+		put(93, "Medical Records");
+		put(94, "Statistics");
+		put(95, "Applied Economics");
+		put(96, "Automatic Control");
+		put(97, "Atmospheric Science");
+		put(98, "Automotive Engineering");
+		put(99, "BioStatistics");
+		put(100, "Employee Health Benefit Plans");
+		put(101, "Transplantation");
+		put(102, "Alloys");
+		put(103, "Astronomy & Astrophysics");
+		put(104, "Substance-abuse Treatment");
+		put(105, "Research Policy; Technology Management");
+		put(106, "Drug Discovery");
+		put(107, "Animal Science");
+		put(108, "Chaos Fractals & Complexity");
+		put(109, "Environmental Contamination");
+		put(110, "Otolaryngology; Laryngoscope");
+		put(111, "Mechanical Design Engineering");
+		put(112, "Classics");
+		put(113, "Biological Conservation");
+		put(114, "Thoracic Surgery");
+		put(115, "Phytochemistry");
+		put(116, "Tropical Medicine");
+		put(117, "Food Protection");
+		put(118, "Broadband Communication");
+		put(119, "Energy Fuel");
+		put(120, "Soil Quality");
+		put(121, "Integrated Circuit Design");
+		put(122, "Philosophy Psychology");
+		put(123, "Construction & Project Management");
+		put(124, "Social Psychology");
+		put(125, "High Energy Physics");
+		put(126, "Strategic Management");
+		put(127, "Genomics & Nucleic Acids");
+		put(128, "Heat Transfer");
+		put(129, "Cement & Concrete");
+		put(130, "Pathology");
+		put(131, "Pest Management Science");
+		put(132, "Corrosion");
+		put(133, "Veterinary Science");
+		put(134, "Teacher Education; Evaluation");
+		put(135, "Stem Cells");
+		put(136, "Image Processing");
+		put(137, "Neural Networks");
+		put(138, "Nursing Education");
+		put(139, "Intensive Care");
+		put(140, "Alternative Complementary Medicine");
+		put(141, "Petroleum Engineering");
+		put(142, "Music & Theatre");
+		put(143, "Memory & Cognition");
+		put(144, "Vision");
+		put(145, "Communication Research");
+		put(146, "BioInformatics");
+		put(147, "Mechanics of Solids & Structures");
+		put(148, "Pharmacy");
+		put(149, "Geomorphology");
+		put(150, "Psychosis; Schizophrenia");
+		put(151, "BioEthics");
+		put(152, "Parellel Computing");
+		put(153, "Power Distribution");
+		put(154, "Gerontology");
+		put(155, "Wood");
+		put(156, "Discrete Applied Mathematics");
+		put(157, "Geology & Tectonics");
+		put(158, "GeoChemistry");
+		put(159, "Mobil Networks");
+		put(160, "Artificial Intelligence");
+		put(161, "Electro Analytical Chemistry");
+		put(162, "Dental Education");
+		put(163, "Enzyme Microbiological Techniques");
+		put(164, "Library Science; Infomation Retrieval");
+		put(165, "Biomaterials");
+		put(166, "Quaternary Research");
+		put(167, "Endoscopy");
+		put(168, "Composites");
+		put(169, "Language Learning");
+		put(170, "History; Gender Studies");
+		put(171, "Leadership & Organizational Behavior");
+		put(172, "Agricultural Engineering");
+		put(173, "Computer-Aided Process Planning");
+		put(174, "Geriatrics");
+		put(175, "Solid State Electronics");
+		put(176, "Optics & Lasers");
+		put(177, "Wool");
+		put(178, "Biomechanics");
+		put(179, "Molecular Physics");
+		put(180, "Comparative Animal Physiology");
+		put(181, "Political Science");
+		put(182, "History Philosophy");
+		put(183, "Poetry");
+		put(184, "Nuclear Medicine");
+		put(185, "Nanotechnology");
+		put(186, "Speech Recognitation");
+		put(187, "Fluid Mechanics");
+		put(188, "Computer Graphics");
+		put(189, "Filtration Membrane");
+		put(190, "Clinical Infectious Disease");
+		put(191, "Prosthetic Dentistry");
+		put(192, "Orthodontics");
+		put(193, "Robotic Systems");
+		put(194, "Dental Research");
+		put(195, "Atomic Spectrometry");
+		put(196, "Botany");
+		put(197, "Public Health Service");
+		put(198, "Political Geography");
+		put(199, "Catalysis");
+		put(200, "Radiation Protection");
+		put(201, "Machine Tools");
+		put(202, "Veterinary Medicine");
+		put(203, "Periodontology");
+		put(204, "Birth Defects");
+		put(205, "Thrombosis");
+		put(206, "Freshwater Biology");
+		put(207, "Mental Health Nursing");
+		put(208, "Artificial Evolution");
+		put(209, "English Literature");
+		put(210, "Plastic Surgery");
+		put(211, "Nursing Administration");
+		put(212, "Higher Education");
+		put(213, "Ecology");
+		put(214, "Modern Language");
+		put(215, "Neurophsyiology & Neuroscience");
+		put(216, "Mining");
+		put(217, "Aquaculture");
+		put(218, "Molecular Biological Evolution");
+		put(219, "Photonics");
+		put(220, "Urban Studies");
+		put(221, "Functional Analysis");
+		put(222, "Linguistics");
+		put(223, "Photo-Optics");
+		put(224, "Spine");
+		put(225, "Robotics");
+		put(226, "Audiology");
+		put(227, "Soil Science");
+		put(228, "Simulation");
+		put(229, "Nuclear Instrumentation");
+		put(230, "Hispanic Studies");
+		put(231, "Forest Science");
+		put(232, "Plasma Physics");
+		put(233, "Proteomics");
+		put(234, "Symbolic Interaction");
+		put(235, "Child & Adolescent Psychiatry");
+		put(236, "General Practice");
+		put(237, "Environmental Management");
+		put(238, "Diabetes Metabolism");
+		put(239, "Geotechnical Engineering");
+		put(240, "Instrumentation");
+		put(241, "Clinical Chemistry");
+		put(242, "Fluid Engineering");
+		put(243, "Arthroscopy");
+		put(244, "Eating Disorders; Sex Roles");
+		put(245, "Water Quality & Resource Management");
+		put(246, "Ethnic Migration");
+		put(247, "Geriatric Psychiatry");
+		put(248, "Sound & Vibration");
+		put(249, "Ore Processing");
+		put(250, "Ethnology");
+		put(251, "Prenatal Diagnostics");
+		put(252, "Cancer (translated)");
+		put(253, "Dialectics");
+		put(254, "Atmospheric GeoPhysics");
+		put(255, "Flavors & Fragrance");
+		put(256, "Numerical Methods in Engineering");
+		put(257, "EthnoPharmcology");
+		put(258, "Electrocardiography");
+		put(259, "International Development");
+		put(260, "Electrochemistry");
+		put(261, "Political Studies");
+		put(262, "Molecular Endocrinology");
+		put(263, "Surface Coating Technology");
+		put(264, "Molecular Biochemical Parasitology");
+		put(265, "Vocational Counseling");
+		put(266, "Oil & Natural Gas");
+		put(267, "International Conflict");
+		put(268, "Art History");
+		put(269, "Applied Catalysis");
+		put(270, "Agricultural Economics");
+		put(271, "Social Work");
+		put(272, "Medical Insurance");
+		put(273, "Fluid Phase Equilibrium");
+		put(274, "Biotechnology Trends");
+		put(275, "Air Quality");
+		put(276, "Search Engines; Web Crawling");
+		put(277, "Colloid");
+		put(278, "Applied Physiology; Muscle");
+		put(279, "Biblical Literature");
+		put(280, "Fault Tolerant Computing");
+		put(281, "Third World Political Economics");
+		put(282, "Public Hospitals");
+		put(283, "Sociology");
+		put(284, "Horticulture");
+		put(285, "Bone & Osteoporosis");
+		put(286, "Radiation Therapy");
+		put(287, "Water Treatment");
+		put(288, "Spyware; Malware");
+		put(289, "Behavioral Research Therapy");
+		put(290, "Science Education");
+		put(291, "Design & Analysis of Algorithms");
+		put(292, "Hospice Care");
+		put(293, "Climatology");
+		put(294, "Crop Science");
+		put(295, "Fuzzy Sets");
+		put(296, "Vehicle System Design");
+		put(297, "Transfusion");
+		put(298, "AIDS Treatment");
+		put(299, "Wireless Communication");
+		put(300, "Atherosclerosis");
+		put(301, "Region & Medical Ethics");
+		put(302, "Speech Language & Hearing");
+		put(303, "Thoracic & Respiratory");
+		put(304, "Veterinary Microbiology");
+		put(305, "Environmental Protection");
+		put(306, "Computer Systems Design");
+		put(307, "Environmental Polution");
+		put(308, "Electrical Networks");
+		put(309, "Endoscopy");
+		put(310, "Chemistry & Material Science");
+		put(311, "Medical Screening & Epidemiology");
+		put(312, "Child Development");
+		put(313, "Pain");
+		put(314, "Public Administration");
+		put(315, "Soil Analysis");
+		put(316, "Safety Management");
+		put(317, "Pattern Recognition");
+		put(318, "Mental Health Assessment");
+		put(319, "Clinical Medicine (translated)");
+		put(320, "Mutation; DNA Repair");
+		put(321, "Human Evolution");
+		put(322, "Space Research");
+		put(323, "Entomology");
+		put(324, "Epilepsy");
+		put(325, "Plant Ecology");
+		put(326, "Computer Aided Molecular Design");
+		put(327, "Criminology");
+		put(328, "Forensic Psychiatry");
+		put(329, "Personality");
+		put(330, "Test Equipment");
+		put(331, "Logic");
+		put(332, "Pulp Paper Science");
+		put(333, "Textiles");
+		put(334, "Contemporary Philosophy");
+		put(335, "Hydrology Soil Contamination");
+		put(336, "Child Abuse");
+		put(337, "Mathematics Research");
+		put(338, "Geology (International)");
+		put(339, "Environmental Chemistry");
+		put(340, "Parasitology");
+		put(341, "Dairy Science");
+		put(342, "Water Policy");
+		put(343, "Fish Research");
+		put(344, "Printing");
+		put(345, "Genetics");
+		put(346, "Industrial Chemistry");
+		put(347, "Obesity");
+		put(348, "Literary Criticism");
+		put(349, "Hepatology");
+		put(350, "Physical Therapy; Brain Injury");
+		put(351, "Computational & Applied Math");
+		put(352, "World Health Organization");
+		put(353, "Geophysical Science");
+		put(354, "Forensic Medicine");
+		put(355, "Psychiatric Services");
+		put(356, "Software Design and Development");
+		put(357, "Wildlife Management");
+		put(358, "Ocean Coastal Management");
+		put(359, "Database Design & Management");
+		put(360, "Financial Accounting");
+		put(361, "Microbiology Biotechnology");
+		put(362, "Water Utilities");
+		put(363, "Sedimentary Geology");
+		put(364, "Geodesy");
+		put(365, "Surfactants");
+		put(366, "Eye");
+		put(367, "Addictive Behavior");
+		put(368, "Naval Architecture");
+		put(369, "Environmental Microbiology");
+		put(370, "Electronic Imaging");
+		put(371, "Functional Programing");
+		put(372, "Applied Genetics");
+		put(373, "Plant Disease");
+		put(374, "Water Resource");
+		put(375, "Developmental Economics");
+		put(376, "Nuclear Physics");
+		put(377, "International Economics");
+		put(378, "Radiology");
+		put(379, "German Studies");
+		put(380, "Medieval History");
+		put(381, "Philosophy of Education");
+		put(382, "Oceanographic Instrumentation");
+		put(383, "Foreign Policy");
+		put(384, "Gut");
+		put(385, "Microwaves; Radio Frequencies");
+		put(386, "School Psychology");
+		put(387, "Vaccines");
+		put(388, "Environmental Law");
+		put(389, "Mass Spectrometry");
+		put(390, "Psychiatric Nursing");
+		put(391, "Asian Studies");
+		put(392, "Optimization Theory");
+		put(393, "Mathematical Science (Russia)");
+		put(394, "Gene Therapy");
+		put(395, "Security; Cryptography");
+		put(396, "Materials Processing");
+		put(397, "Rural Health Care");
+		put(398, "Power Systems");
+		put(399, "Surgical Oncology");
+		put(400, "Chip Design & Manufacturing");
+		put(401, "Sociobiology");
+		put(402, "Molecular Medicine");
+		put(403, "Human Resource Management");
+		put(404, "Ecological Modeling");
+		put(405, "Clinical Rehabilitation");
+		put(406, "Metallurgy");
+		put(407, "Ethics");
+		put(408, "Marital & Family Therapy");
+		put(409, "Aerospace");
+		put(410, "Critical Studies");
+		put(411, "Econometrics");
+		put(412, "Neuroscience Methods");
+		put(413, "Mineralogy");
+		put(414, "Trauma");
+		put(415, "Thermal Analysis");
+		put(416, "Solar & Wind Power");
+		put(417, "Ocean Engineering");
+		put(418, "Educational Psychology");
+		put(419, "Mycology");
+		put(420, "Semiotics");
+		put(421, "Dyes & Pigments");
+		put(422, "Drug Safety");
+		put(423, "Molecular Ecology");
+		put(424, "Cytogentics & Genome Mapping");
+		put(425, "Clinical Psychiatry");
+		put(426, "Paleogeography");
+		put(427, "Water Waste");
+		put(428, "Computer Networks");
+		put(429, "Weed Management");
+		put(430, "User Interface Design");
+		put(431, "Public Policy");
+		put(432, "Liquid Crystals");
+		put(433, "Control Systems");
+		put(434, "Environmental Policy");
+		put(435, "Topology");
+		put(436, "Construction");
+		put(437, "Dams & Tunnels");
+		put(438, "Regional Studies");
+		put(439, "Electrochemical Development");
+		put(440, "Digital Printing");
+		put(441, "Peptides");
+		put(442, "Applied Geophysics");
+		put(443, "Sexually Transmitted Diseases");
+		put(444, "Engineering Education");
+		put(445, "NeuroImmunology");
+		put(446, "Machine Learning");
+		put(447, "Geriatric Nursing");
+		put(448, "Sensors & Actuators");
+		put(449, "Systematics & Evolutionary Microbiology");
+		put(450, "Image Processing");
+		put(451, "Medical Education");
+		put(452, "Magnetic Resonance Imagery");
+		put(453, "Hospital Management");
+		put(454, "Insect Physiology");
+		put(455, "Power Transmission");
+		put(456, "Food Engineering");
+		put(457, "Oral Surgery");
+		put(458, "Computer Systems Theory");
+		put(459, "Combustion");
+		put(460, "Dermatological Surgery");
+		put(461, "Wildlife Research");
+		put(462, "Midwifery");
+		put(463, "Physics; Current Developments");
+		put(464, "Psychiatric & Behavioral Genetics");
+		put(465, "Fractures & Fatigue");
+		put(466, "Emergency Medicine");
+		put(467, "Cross Disciplinary Studies");
+		put(468, "Archeological Science");
+		put(469, "Preventive Medicine");
+		put(470, "Carbon");
+		put(471, "Gynecology Oncology");
+		put(472, "Psychosomatic Medicine");
+		put(473, "Pharmaco Economics");
+		put(474, "Computer Modeling and Animation");
+		put(475, "Medical Practice");
+		put(476, "Cancer Statistics");
+		put(477, "Consciousness");
+		put(478, "Otolaryngology; Head Neck");
+		put(479, "Heart Failure; Catheters");
+		put(480, "Wood & Wood Components");
+		put(481, "Circuits");
+		put(482, "Friction Lubrication & Wear");
+		put(483, "Superconductor Science");
+		put(484, "Antennae; Mobile Radio");
+		put(485, "Headache");
+		put(486, "Operations Management");
+		put(487, "Fish Biology");
+		put(488, "Economic & Human Biology");
+		put(489, "Consumer Electronics");
+		put(490, "Menopause");
+		put(491, "Chemistry (Russia)");
+		put(492, "GeoPolitics");
+		put(493, "Glaciology");
+		put(494, "Medical Libraries");
+		put(495, "Opera");
+		put(496, "Education");
+		put(497, "Acoustics");
+		put(498, "Pragmatics & Discourse");
+		put(499, "Reproduction Veterinary");
+		put(500, "Crystallography");
+		put(501, "Applied Math & Computation");
+		put(502, "Socio-Cultural Anthropology");
+		put(503, "Poultry Science");
+		put(504, "Artifical Organs");
+		put(505, "Physical Therapy; Orthopedic");
+		put(506, "Pulmonary");
+		put(507, "Waste Management");
+		put(508, "Marine Pollution");
+		put(509, "Toxins");
+		put(510, "Hearing Research");
+		put(511, "Human Rights");
+		put(512, "Lung Cancer");
+		put(513, "Social Economics");
+		put(514, "Carbohydrate Research");
+		put(515, "Biotechnology Bioengineering");
+		put(516, "Rural Studies");
+		put(517, "Electronics");
+		put(518, "Defects & Diffusion in Materials");
+		put(519, "Forensic Science");
+		put(520, "Rangeland Ecology");
+		put(521, "Welding");
+		put(522, "Reliability Engineering");
+		put(523, "Molecular Biology Methods");
+		put(524, "Mammals");
+		put(525, "Impotence");
+		put(526, "Fuzzy Logic");
+		put(527, "Tourism");
+		put(528, "Aquatic Disease");
+		put(529, "Geographic Information Science");
+		put(530, "Hormone Research");
+		put(531, "Public Health");
+		put(532, "Sleep");
+		put(533, "Neurotoxicology");
+		put(534, "Pediatric Research");
+		put(535, "Education Psychological Measures");
+		put(536, "Marketing");
+		put(537, "Clinical Medicine (Romania)");
+		put(538, "Green Chemistry");
+		put(539, "Optometry");
+		put(540, "Textile Art");
+		put(541, "Italian Studies");
+		put(542, "Perception Motor Skills");
+		put(543, "World Trade; Law");
+		put(544, "Insects");
+		put(545, "Australian Ecology");
+		put(546, "Paints & Coatings");
+		put(547, "Nursing Theory");
+		put(548, "Crustaceans");
+		put(549, "Laser Surgery");
+		put(550, "Bulk Solid Handling");
+		put(551, "Wetlands");
+		put(552, "GIS (non English)");
+		put(553, "Power Transmission & Control");
+		put(554, "Agricultural Environmental Medicine");
+	}};
+
+	public static final Map SUB_DISCIPLINE_ID_TO_DISCIPLINE_ID = new HashMap() {{
+		put(1, 7);
+		put(2, 6);
+		put(3, 13);
+		put(4, 7);
+		put(5, 13);
+		put(6, 5);
+		put(7, 6);
+		put(8, 6);
+		put(9, 7);
+		put(10, 2);
+		put(11, 1);
+		put(12, 6);
+		put(13, 12);
+		put(14, 12);
+		put(15, 1);
+		put(16, 7);
+		put(17, 1);
+		put(18, 2);
+		put(19, 7);
+		put(20, 7);
+		put(21, 9);
+		put(22, 6);
+		put(23, 11);
+		put(24, 1);
+		put(25, 6);
+		put(26, 5);
+		put(27, 3);
+		put(28, 1);
+		put(29, 7);
+		put(30, 11);
+		put(31, 7);
+		put(32, 6);
+		put(33, 1);
+		put(34, 11);
+		put(35, 2);
+		put(36, 11);
+		put(37, 1);
+		put(38, 12);
+		put(39, 6);
+		put(40, 5);
+		put(41, 1);
+		put(42, 6);
+		put(43, 3);
+		put(44, 1);
+		put(45, 6);
+		put(46, 13);
+		put(47, 11);
+		put(48, 7);
+		put(49, 8);
+		put(50, 6);
+		put(51, 6);
+		put(52, 11);
+		put(53, 9);
+		put(54, 2);
+		put(55, 6);
+		put(56, 13);
+		put(57, 3);
+		put(58, 3);
+		put(59, 6);
+		put(60, 11);
+		put(61, 10);
+		put(62, 1);
+		put(63, 5);
+		put(64, 12);
+		put(65, 13);
+		put(66, 13);
+		put(67, 1);
+		put(68, 1);
+		put(69, 5);
+		put(70, 11);
+		put(71, 1);
+		put(72, 11);
+		put(73, 1);
+		put(74, 3);
+		put(75, 2);
+		put(76, 6);
+		put(77, 6);
+		put(78, 10);
+		put(79, 3);
+		put(80, 6);
+		put(81, 7);
+		put(82, 6);
+		put(83, 6);
+		put(84, 6);
+		put(85, 6);
+		put(86, 11);
+		put(87, 11);
+		put(88, 2);
+		put(89, 6);
+		put(90, 11);
+		put(91, 6);
+		put(92, 12);
+		put(93, 1);
+		put(94, 3);
+		put(95, 3);
+		put(96, 13);
+		put(97, 11);
+		put(98, 11);
+		put(99, 3);
+		put(100, 1);
+		put(101, 6);
+		put(102, 11);
+		put(103, 12);
+		put(104, 1);
+		put(105, 3);
+		put(106, 6);
+		put(107, 6);
+		put(108, 12);
+		put(109, 11);
+		put(110, 1);
+		put(111, 11);
+		put(112, 4);
+		put(113, 9);
+		put(114, 6);
+		put(115, 2);
+		put(116, 9);
+		put(117, 8);
+		put(118, 13);
+		put(119, 11);
+		put(120, 11);
+		put(121, 13);
+		put(122, 4);
+		put(123, 3);
+		put(124, 3);
+		put(125, 12);
+		put(126, 3);
+		put(127, 8);
+		put(128, 11);
+		put(129, 11);
+		put(130, 7);
+		put(131, 9);
+		put(132, 11);
+		put(133, 6);
+		put(134, 3);
+		put(135, 6);
+		put(136, 13);
+		put(137, 13);
+		put(138, 1);
+		put(139, 6);
+		put(140, 6);
+		put(141, 11);
+		put(142, 4);
+		put(143, 5);
+		put(144, 5);
+		put(145, 3);
+		put(146, 8);
+		put(147, 11);
+		put(148, 6);
+		put(149, 10);
+		put(150, 1);
+		put(151, 1);
+		put(152, 13);
+		put(153, 13);
+		put(154, 1);
+		put(155, 11);
+		put(156, 12);
+		put(157, 10);
+		put(158, 10);
+		put(159, 13);
+		put(160, 13);
+		put(161, 2);
+		put(162, 1);
+		put(163, 8);
+		put(164, 13);
+		put(165, 1);
+		put(166, 10);
+		put(167, 6);
+		put(168, 11);
+		put(169, 3);
+		put(170, 4);
+		put(171, 3);
+		put(172, 11);
+		put(173, 3);
+		put(174, 1);
+		put(175, 12);
+		put(176, 12);
+		put(177, 11);
+		put(178, 1);
+		put(179, 2);
+		put(180, 9);
+		put(181, 3);
+		put(182, 4);
+		put(183, 4);
+		put(184, 1);
+		put(185, 12);
+		put(186, 13);
+		put(187, 11);
+		put(188, 13);
+		put(189, 11);
+		put(190, 6);
+		put(191, 1);
+		put(192, 1);
+		put(193, 13);
+		put(194, 1);
+		put(195, 2);
+		put(196, 9);
+		put(197, 1);
+		put(198, 3);
+		put(199, 2);
+		put(200, 6);
+		put(201, 11);
+		put(202, 6);
+		put(203, 1);
+		put(204, 7);
+		put(205, 6);
+		put(206, 9);
+		put(207, 1);
+		put(208, 13);
+		put(209, 4);
+		put(210, 1);
+		put(211, 1);
+		put(212, 3);
+		put(213, 9);
+		put(214, 4);
+		put(215, 5);
+		put(216, 11);
+		put(217, 9);
+		put(218, 9);
+		put(219, 13);
+		put(220, 3);
+		put(221, 12);
+		put(222, 4);
+		put(223, 11);
+		put(224, 1);
+		put(225, 13);
+		put(226, 1);
+		put(227, 11);
+		put(228, 12);
+		put(229, 12);
+		put(230, 4);
+		put(231, 9);
+		put(232, 12);
+		put(233, 8);
+		put(234, 3);
+		put(235, 3);
+		put(236, 1);
+		put(237, 3);
+		put(238, 6);
+		put(239, 11);
+		put(240, 13);
+		put(241, 6);
+		put(242, 11);
+		put(243, 1);
+		put(244, 3);
+		put(245, 11);
+		put(246, 3);
+		put(247, 1);
+		put(248, 11);
+		put(249, 11);
+		put(250, 3);
+		put(251, 6);
+		put(252, 6);
+		put(253, 13);
+		put(254, 11);
+		put(255, 2);
+		put(256, 11);
+		put(257, 2);
+		put(258, 6);
+		put(259, 3);
+		put(260, 11);
+		put(261, 3);
+		put(262, 6);
+		put(263, 12);
+		put(264, 9);
+		put(265, 3);
+		put(266, 11);
+		put(267, 3);
+		put(268, 4);
+		put(269, 2);
+		put(270, 3);
+		put(271, 3);
+		put(272, 1);
+		put(273, 11);
+		put(274, 8);
+		put(275, 11);
+		put(276, 13);
+		put(277, 2);
+		put(278, 1);
+		put(279, 4);
+		put(280, 13);
+		put(281, 3);
+		put(282, 1);
+		put(283, 3);
+		put(284, 9);
+		put(285, 6);
+		put(286, 6);
+		put(287, 11);
+		put(288, 13);
+		put(289, 1);
+		put(290, 3);
+		put(291, 12);
+		put(292, 6);
+		put(293, 11);
+		put(294, 9);
+		put(295, 13);
+		put(296, 11);
+		put(297, 7);
+		put(298, 1);
+		put(299, 13);
+		put(300, 6);
+		put(301, 1);
+		put(302, 5);
+		put(303, 6);
+		put(304, 6);
+		put(305, 11);
+		put(306, 13);
+		put(307, 11);
+		put(308, 13);
+		put(309, 6);
+		put(310, 2);
+		put(311, 6);
+		put(312, 3);
+		put(313, 6);
+		put(314, 3);
+		put(315, 11);
+		put(316, 11);
+		put(317, 13);
+		put(318, 1);
+		put(319, 6);
+		put(320, 7);
+		put(321, 9);
+		put(322, 12);
+		put(323, 9);
+		put(324, 5);
+		put(325, 9);
+		put(326, 2);
+		put(327, 3);
+		put(328, 3);
+		put(329, 3);
+		put(330, 13);
+		put(331, 13);
+		put(332, 11);
+		put(333, 11);
+		put(334, 4);
+		put(335, 11);
+		put(336, 3);
+		put(337, 12);
+		put(338, 10);
+		put(339, 2);
+		put(340, 9);
+		put(341, 6);
+		put(342, 11);
+		put(343, 11);
+		put(344, 11);
+		put(345, 9);
+		put(346, 11);
+		put(347, 6);
+		put(348, 4);
+		put(349, 6);
+		put(350, 5);
+		put(351, 12);
+		put(352, 9);
+		put(353, 12);
+		put(354, 1);
+		put(355, 1);
+		put(356, 13);
+		put(357, 9);
+		put(358, 11);
+		put(359, 13);
+		put(360, 3);
+		put(361, 8);
+		put(362, 11);
+		put(363, 10);
+		put(364, 11);
+		put(365, 2);
+		put(366, 1);
+		put(367, 1);
+		put(368, 12);
+		put(369, 11);
+		put(370, 13);
+		put(371, 13);
+		put(372, 9);
+		put(373, 9);
+		put(374, 11);
+		put(375, 3);
+		put(376, 12);
+		put(377, 3);
+		put(378, 6);
+		put(379, 4);
+		put(380, 4);
+		put(381, 4);
+		put(382, 11);
+		put(383, 3);
+		put(384, 6);
+		put(385, 13);
+		put(386, 3);
+		put(387, 7);
+		put(388, 3);
+		put(389, 8);
+		put(390, 1);
+		put(391, 4);
+		put(392, 12);
+		put(393, 12);
+		put(394, 7);
+		put(395, 13);
+		put(396, 11);
+		put(397, 1);
+		put(398, 13);
+		put(399, 6);
+		put(400, 13);
+		put(401, 9);
+		put(402, 1);
+		put(403, 3);
+		put(404, 9);
+		put(405, 6);
+		put(406, 11);
+		put(407, 4);
+		put(408, 3);
+		put(409, 12);
+		put(410, 4);
+		put(411, 3);
+		put(412, 5);
+		put(413, 10);
+		put(414, 1);
+		put(415, 2);
+		put(416, 11);
+		put(417, 11);
+		put(418, 3);
+		put(419, 9);
+		put(420, 4);
+		put(421, 11);
+		put(422, 6);
+		put(423, 9);
+		put(424, 7);
+		put(425, 1);
+		put(426, 10);
+		put(427, 11);
+		put(428, 13);
+		put(429, 11);
+		put(430, 13);
+		put(431, 3);
+		put(432, 2);
+		put(433, 13);
+		put(434, 3);
+		put(435, 12);
+		put(436, 11);
+		put(437, 11);
+		put(438, 3);
+		put(439, 11);
+		put(440, 11);
+		put(441, 7);
+		put(442, 11);
+		put(443, 6);
+		put(444, 3);
+		put(445, 5);
+		put(446, 13);
+		put(447, 1);
+		put(448, 11);
+		put(449, 8);
+		put(450, 13);
+		put(451, 1);
+		put(452, 1);
+		put(453, 1);
+		put(454, 9);
+		put(455, 13);
+		put(456, 8);
+		put(457, 1);
+		put(458, 13);
+		put(459, 11);
+		put(460, 1);
+		put(461, 9);
+		put(462, 1);
+		put(463, 12);
+		put(464, 3);
+		put(465, 11);
+		put(466, 6);
+		put(467, 4);
+		put(468, 10);
+		put(469, 1);
+		put(470, 2);
+		put(471, 6);
+		put(472, 3);
+		put(473, 1);
+		put(474, 13);
+		put(475, 1);
+		put(476, 12);
+		put(477, 5);
+		put(478, 1);
+		put(479, 6);
+		put(480, 11);
+		put(481, 13);
+		put(482, 11);
+		put(483, 12);
+		put(484, 13);
+		put(485, 5);
+		put(486, 3);
+		put(487, 9);
+		put(488, 4);
+		put(489, 13);
+		put(490, 6);
+		put(491, 2);
+		put(492, 3);
+		put(493, 11);
+		put(494, 1);
+		put(495, 4);
+		put(496, 3);
+		put(497, 11);
+		put(498, 3);
+		put(499, 6);
+		put(500, 2);
+		put(501, 12);
+		put(502, 4);
+		put(503, 6);
+		put(504, 6);
+		put(505, 1);
+		put(506, 6);
+		put(507, 11);
+		put(508, 11);
+		put(509, 2);
+		put(510, 1);
+		put(511, 3);
+		put(512, 6);
+		put(513, 3);
+		put(514, 8);
+		put(515, 8);
+		put(516, 3);
+		put(517, 13);
+		put(518, 11);
+		put(519, 1);
+		put(520, 9);
+		put(521, 11);
+		put(522, 3);
+		put(523, 7);
+		put(524, 9);
+		put(525, 6);
+		put(526, 13);
+		put(527, 3);
+		put(528, 9);
+		put(529, 11);
+		put(530, 6);
+		put(531, 6);
+		put(532, 5);
+		put(533, 5);
+		put(534, 6);
+		put(535, 3);
+		put(536, 3);
+		put(537, 6);
+		put(538, 2);
+		put(539, 1);
+		put(540, 11);
+		put(541, 4);
+		put(542, 1);
+		put(543, 3);
+		put(544, 9);
+		put(545, 9);
+		put(546, 11);
+		put(547, 1);
+		put(548, 9);
+		put(549, 1);
+		put(550, 11);
+		put(551, 9);
+		put(552, 11);
+		put(553, 13);
+		put(554, 6);
+	}};
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java
index 6ff33808..c943693d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryConstants.java
@@ -1,60 +1,60 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.constants;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@SuppressWarnings("serial")
-public class QueryConstants {
-	
-	public static final Map PREFIX_TO_NAMESPACE = new HashMap() { {
-		
-			put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
-			put("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
-			put("xsd", "http://www.w3.org/2001/XMLSchema#");
-			put("owl", "http://www.w3.org/2002/07/owl#");
-			put("swrl", "http://www.w3.org/2003/11/swrl#");
-			put("swrlb", "http://www.w3.org/2003/11/swrlb#");
-			put("vitro", "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#");
-			put("far", "http://vitro.mannlib.cornell.edu/ns/reporting#");
-			put("ai", "http://vitro.mannlib.cornell.edu/ns/hotel#");
-			put("aktp", "http://www.aktors.org/ontology/portal#");
-			put("akts", "http://www.aktors.org/ontology/support#");
-			put("bibo", "http://purl.org/ontology/bibo/");
-			put("hr", "http://vivo.cornell.edu/ns/hr/0.9/hr.owl#");
-			put("dcterms", "http://purl.org/dc/terms/");
-			put("dcelem", "http://purl.org/dc/elements/1.1/");
-			put("event", "http://purl.org/NET/c4dm/event.owl#");
-			put("foaf", "http://xmlns.com/foaf/0.1/");
-			put("geo", "http://aims.fao.org/aos/geopolitical.owl#");
-			put("mann", "http://vivo.cornell.edu/ns/mannadditions/0.1#");
-			put("pubmed", "http://vitro.mannlib.cornell.edu/ns/pubmed#");
-			put("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
-			put("rdfsyn", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
-			put("skos", "http://www.w3.org/2004/02/skos/core#");
-			put("socsci", "http://vivo.library.cornell.edu/ns/vivo/socsci/0.1#");
-			put("stars", "http://vitro.mannlib.cornell.edu/ns/cornell/stars/classes#");
-			put("temp", "http://vitro.mannlib.cornell.edu/ns/temp#");
-			put("wos", "http://vivo.mannlib.cornell.edu/ns/ThomsonWOS/0.1#");
-			put("core", "http://vivoweb.org/ontology/core#");
-			put("vivo", "http://vivo.library.cornell.edu/ns/0.1#");
-			put("geo", "http://aims.fao.org/aos/geopolitical.owl#");
-			put("public", "http://vitro.mannlib.cornell.edu/ns/vitro/public#");
-			put("vivosocnet", "http://vivo.cns.iu.edu/ns/#");
-			put("obo", "http://purl.obolibrary.org/obo/");
-			put("vcard", "http://www.w3.org/2006/vcard/ns#");
-	} };
-	
-	public static String getSparqlPrefixQuery() {
-		
-		StringBuilder prefixSection = new StringBuilder(); 
-		
-		for (Map.Entry prefixEntry : PREFIX_TO_NAMESPACE.entrySet()) {
-			prefixSection.append("PREFIX ").append(prefixEntry.getKey()).append(": <").append(prefixEntry.getValue()).append(">\n");
-		}
-		return prefixSection.toString();
-	}
-}
-
-
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@SuppressWarnings("serial")
+public class QueryConstants {
+
+	public static final Map PREFIX_TO_NAMESPACE = new HashMap() { {
+
+			put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+			put("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
+			put("xsd", "http://www.w3.org/2001/XMLSchema#");
+			put("owl", "http://www.w3.org/2002/07/owl#");
+			put("swrl", "http://www.w3.org/2003/11/swrl#");
+			put("swrlb", "http://www.w3.org/2003/11/swrlb#");
+			put("vitro", "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#");
+			put("far", "http://vitro.mannlib.cornell.edu/ns/reporting#");
+			put("ai", "http://vitro.mannlib.cornell.edu/ns/hotel#");
+			put("aktp", "http://www.aktors.org/ontology/portal#");
+			put("akts", "http://www.aktors.org/ontology/support#");
+			put("bibo", "http://purl.org/ontology/bibo/");
+			put("hr", "http://vivo.cornell.edu/ns/hr/0.9/hr.owl#");
+			put("dcterms", "http://purl.org/dc/terms/");
+			put("dcelem", "http://purl.org/dc/elements/1.1/");
+			put("event", "http://purl.org/NET/c4dm/event.owl#");
+			put("foaf", "http://xmlns.com/foaf/0.1/");
+			put("geo", "http://aims.fao.org/aos/geopolitical.owl#");
+			put("mann", "http://vivo.cornell.edu/ns/mannadditions/0.1#");
+			put("pubmed", "http://vitro.mannlib.cornell.edu/ns/pubmed#");
+			put("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
+			put("rdfsyn", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+			put("skos", "http://www.w3.org/2004/02/skos/core#");
+			put("socsci", "http://vivo.library.cornell.edu/ns/vivo/socsci/0.1#");
+			put("stars", "http://vitro.mannlib.cornell.edu/ns/cornell/stars/classes#");
+			put("temp", "http://vitro.mannlib.cornell.edu/ns/temp#");
+			put("wos", "http://vivo.mannlib.cornell.edu/ns/ThomsonWOS/0.1#");
+			put("core", "http://vivoweb.org/ontology/core#");
+			put("vivo", "http://vivo.library.cornell.edu/ns/0.1#");
+			put("geo", "http://aims.fao.org/aos/geopolitical.owl#");
+			put("public", "http://vitro.mannlib.cornell.edu/ns/vitro/public#");
+			put("vivosocnet", "http://vivo.cns.iu.edu/ns/#");
+			put("obo", "http://purl.obolibrary.org/obo/");
+			put("vcard", "http://www.w3.org/2006/vcard/ns#");
+	} };
+
+	public static String getSparqlPrefixQuery() {
+
+		StringBuilder prefixSection = new StringBuilder();
+
+		for (Map.Entry prefixEntry : PREFIX_TO_NAMESPACE.entrySet()) {
+			prefixSection.append("PREFIX ").append(prefixEntry.getKey()).append(": <").append(prefixEntry.getValue()).append(">\n");
+		}
+		return prefixSection.toString();
+	}
+}
+
+
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java
index b5df83be..7ad97d16 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java
@@ -3,20 +3,20 @@
 package edu.cornell.mannlib.vitro.webapp.visualization.constants;
 
 /**
- * Thsi contains the sparql fields which are used to capture data for the value objects.  
+ * Thsi contains the sparql fields which are used to capture data for the value objects.
  * @author cdtank
  */
 public class QueryFieldLabels {
-	
+
 	/*
-	 * Generic Query related field labels 
+	 * Generic Query related field labels
 	 * */
 	public static final String PREDICATE = "predicateLit";
 	public static final String OBJECT = "objectLit";
-	
-	
+
+
 	/*
-	 * Document related field labels 
+	 * Document related field labels
 	 * */
 	public static final String DOCUMENT_URL = "documentLit";
 	public static final String DOCUMENT_MONIKER = "documentMonikerLit";
@@ -28,40 +28,40 @@ public class QueryFieldLabels {
 	public static final String DOCUMENT_PUBLICATION_YEAR_MONTH = "publicationYearMonthLit";
 	public static final String DOCUMENT_PUBLICATION_DATE = "publicationDateLit";
 	public static final String DOCUMENT_JOURNAL_LABEL = "journalLabelLit";
-	
-	
+
+
 	/*
 	 * Image related field labels
 	 * */
 	public static final String THUMBNAIL_LOCATION_URL = "thumbnailDownloadLocationLit";
 	public static final String THUMBNAIL_FILENAME = "thumbnailFileNameLit";
-	
+
 	/*
 	 * Author related field labels
 	 * */
 	public static final String AUTHOR_URL = "authPersonLit";
 	public static final String AUTHOR_LABEL = "authorLabelLit";
-	
+
 	/*
 	 * Co-Author related field labels
 	 * */
 	public static final String CO_AUTHOR_URL = "coAuthPersonLit";
 	public static final String CO_AUTHOR_LABEL = "coAuthPersonLabelLit";
-	
+
 	/*
-	 * College related field labels 
+	 * College related field labels
 	 * */
 	public static final String COLLEGE_URL = "collegeLit";
 	public static final String COLLEGE_LABEL = "collegeLabelLit";
-	
 
-	
+
+
 	/*
-	 * Employee related field labels 
+	 * Employee related field labels
 	 * */
 	public static final String ACADEMIC_FACULTY_EMPLOYEE_URL = "academicFacultyEmployeeLit";
 	public static final String ACADEMIC_STAFF_EMPLOYEE_URL = "academicStaffEmployeeLit";
-	
+
 	/*
 	 * Person related field Labels
 	 */
@@ -69,51 +69,51 @@ public class QueryFieldLabels {
 	public static final String PERSON_LABEL = "personLabelLit";
 	public static final String PERSON_TYPE = "personTypeLit";
 	public static final String PERSON_TYPE_LABEL = "personTypeLabelLit";
-	
-	
+
+
 	/*
 	 * Position related field labels
 	 */
 	public static final String SECONDARY_POSITION_LABEL = "SecondaryPositionLabelLit";
-	
+
 	/*
 	 * start year related field labels
 	 */
 	public static final String START_YEAR_LABEL = "StartYearLit";
-	
-	
+
+
 	/*
 	 * Organization related field Labels
 	 */
 	public static final String ORGANIZATION_URL = "organizationLit";
 	public static final String ORGANIZATION_LABEL = "organizationLabelLit";
-	
-	
+
+
 	/*
 	 * Sub Organization related field labels
 	 */
 	public static final String SUBORGANIZATION_URL = "subOrganizationLit";
 	public static final String SUBORGANIZATION_LABEL = "subOrganizationLabelLit";
-	
+
 	/*
 	 * Parent Organization related field labels
 	 */
 	public static final String PARENT_ORGANIZATION_URL = "parentOrganizationLit";
 	public static final String PARENT_ORGANIZATION_LABEL = "parentOrganizationLabelLit";
-	
+
 	/*
 	 * Sub Organization related field labels
 	 */
 	public static final String SUBORGANIZATION_TYPE = "subOrganizationTypeLit";
 	public static final String SUBORGANIZATION_TYPE_LABEL = "subOrganizationTypeLabelLit";
-	
-	
+
+
 	/*
-	 * Department related field labels 
+	 * Department related field labels
 	 * */
 	public static final String DEPARTMENT_URL = "departmentLit";
-	public static final String DEPARTMENT_LABEL = "departmentLabelLit";	
-	
+	public static final String DEPARTMENT_LABEL = "departmentLabelLit";
+
 	/*
 	 * Co-PI related field labels
 	 */
@@ -123,18 +123,18 @@ public class QueryFieldLabels {
 	public static final String CO_PI_LABEL = "coPILabelLit";
 	public static final String GRANT_URL = "grantLit";
 	public static final String GRANT_LABEL = "grantLabelLit";
-	
+
 	/*
 	 * Role Start/End Date is chosen as the default Start Date for all the queries,
 	 * in whose absence Grant Start/End Date is chosen.
 	 */
-	
+
 	public static final String ROLE_START_DATE = "grantStartDateLit";
 	public static final String ROLE_END_DATE = "grantEndDateLit";
 	public static final String GRANT_START_DATE = "grantStartDateForGrantLit";
 	public static final String GRANT_END_DATE = "grantEndDateForGrantLit";
-	
-	
+
+
 	public static final String LAST_CACHED_AT_DATETIME = "lastCachedDateTimeLit";
-	
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java
index 210810a6..39412d20 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java
@@ -1,44 +1,44 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.constants;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-
-import org.joda.time.format.DateTimeFormatter;
-import org.joda.time.format.ISODateTimeFormat;
-
-/**
- * This contains the constants related to all the value objects.
- * @author cdtank
- */
-public class VOConstants {
-	
-	public static final String DEFAULT_ACTIVITY_YEAR = "Unknown";
-	public static final String DEFAULT_PUBLICATION_YEAR = "Unknown";
-	public static final String DEFAULT_GRANT_YEAR = "Unknown";
-	
-	/*
-	 * Employee related constants 
-	 * */
-	public static enum EntityClassType {
-		ORGANIZATION, PERSON, UNKNOWN
-	} 
-	
-	public static final int NUM_CHARS_IN_YEAR_FORMAT = 4;
-	public static final int MINIMUM_PUBLICATION_YEAR = 1800;
-	public static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR);
-	
-	@SuppressWarnings("serial")
-	public static final List POSSIBLE_DATE_TIME_FORMATTERS = new ArrayList() {{
-		
-		add(ISODateTimeFormat.dateTimeNoMillis());
-		add(ISODateTimeFormat.dateHourMinuteSecond());
-		add(ISODateTimeFormat.dateTimeParser());
-		
-	}};
-	
-
-	
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.constants;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+import org.joda.time.format.DateTimeFormatter;
+import org.joda.time.format.ISODateTimeFormat;
+
+/**
+ * This contains the constants related to all the value objects.
+ * @author cdtank
+ */
+public class VOConstants {
+
+	public static final String DEFAULT_ACTIVITY_YEAR = "Unknown";
+	public static final String DEFAULT_PUBLICATION_YEAR = "Unknown";
+	public static final String DEFAULT_GRANT_YEAR = "Unknown";
+
+	/*
+	 * Employee related constants
+	 * */
+	public static enum EntityClassType {
+		ORGANIZATION, PERSON, UNKNOWN
+	}
+
+	public static final int NUM_CHARS_IN_YEAR_FORMAT = 4;
+	public static final int MINIMUM_PUBLICATION_YEAR = 1800;
+	public static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR);
+
+	@SuppressWarnings("serial")
+	public static final List POSSIBLE_DATE_TIME_FORMATTERS = new ArrayList() {{
+
+		add(ISODateTimeFormat.dateTimeNoMillis());
+		add(ISODateTimeFormat.dateHourMinuteSecond());
+		add(ISODateTimeFormat.dateTimeParser());
+
+	}};
+
+
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VisConstants.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VisConstants.java
index 344aef1d..4bdbad0f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VisConstants.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/constants/VisConstants.java
@@ -1,21 +1,21 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.constants;
-
-/**
- * This contains constants related to the visualization code.
- * @author cdtank
- */
-public class VisConstants {
-	
-	public static final int MAX_NAME_TEXT_LENGTH = 20;
-	public static final int MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE = 10;
-	
-	public static final String RESULT_FORMAT_PARAM = "RS_TEXT";
-	public static final String RDF_RESULT_FORMAT_PARAM = "RDF/XML-ABBREV";
-	
-	public static enum DataVisMode {
-		CSV, JSON
-	};
-	
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.constants;
+
+/**
+ * This contains constants related to the visualization code.
+ * @author cdtank
+ */
+public class VisConstants {
+
+	public static final int MAX_NAME_TEXT_LENGTH = 20;
+	public static final int MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE = 10;
+
+	public static final String RESULT_FORMAT_PARAM = "RS_TEXT";
+	public static final String RDF_RESULT_FORMAT_PARAM = "RDF/XML-ABBREV";
+
+	public static enum DataVisMode {
+		CSV, JSON
+	};
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java
index 3a78ef5b..fb43c9b2 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java
@@ -36,7 +36,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
 	private Log log = LogFactory
 			.getLog(CoPIGrantCountConstructQueryRunner.class.getName());
 
-	private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING = 
+	private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING =
 			"?Role core:relatedBy ?Grant . "
 			+ "?Grant rdf:type core:Grant ."
 			+ "?Grant core:relates ?RelatedRole . ";
@@ -67,14 +67,14 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
 				+ "?RelatedRole  ?coInvestigator ."
 			    + "?coInvestigator rdf:type foaf:Person  ."
 				+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " + "}"
-				+ "WHERE { " + "<" + queryURI + ">" + preboundProperty + " ?Role . "  
+				+ "WHERE { " + "<" + queryURI + ">" + preboundProperty + " ?Role . "
 				+ "?Role rdf:type " + preboundRoleType + " . "
 				+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
 				+ "?RelatedRole rdf:type core:InvestigatorRole ."
 				+ "?RelatedRole vitro:mostSpecificType ?subclass ."
 				+ "?RelatedRole  ?coInvestigator ."
 		        + "?coInvestigator rdf:type foaf:Person  ."
-				+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " 
+				+ "?coInvestigator rdfs:label ?coInvestigatorLabel . "
 				+ "FILTER (?subclass != core:PrincipalInvestigatorRole && ?subclass != core:CoPrincipalInvestigatorRole)}";
 
 		return sparqlQuery;
@@ -154,7 +154,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
 				+ "?dateTimeIntervalValue core:start ?startDate . "
 				+ "?startDate core:dateTime ?startDateTimeValue . "
 //				+ "?dateTimeIntervalValue core:end ?endDate . "
-//				+ "?endDate core:dateTime ?endDateTimeValue . " 
+//				+ "?endDate core:dateTime ?endDateTimeValue . "
 				+ "}"
 				+ "WHERE { " + "{" + "<" + queryURI + ">" + preboundProperty
 				+ " ?Role . "
@@ -166,7 +166,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
 //				+ " ?Role . "
 //				+ "?Role core:dateTimeInterval ?dateTimeIntervalValue . "
 //				+ "?dateTimeIntervalValue core:end ?endDate . "
-//				+ "?endDate core:dateTime ?endDateTimeValue . " 
+//				+ "?endDate core:dateTime ?endDateTimeValue . "
 				+ "}" + "}";
 
 		return sparqlQuery;
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
index b32bfc94..c5fce802 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountQueryRunner.java
@@ -44,13 +44,13 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator
  * Deepak Konidena
  */
 public class CoPIGrantCountQueryRunner implements QueryRunner {
-	
+
 	private static final int MAX_PI_PER_GRANT_ALLOWED = 100;
-	
+
 	protected static final Syntax SYNTAX = Syntax.syntaxARQ;
-	
+
 	private String egoURI;
-	
+
 	private RDFService rdfService;
 	private VitroRequest vitroRequest;
 
@@ -59,28 +59,28 @@ public class CoPIGrantCountQueryRunner implements QueryRunner
 	private long before, after;
 
 	private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME = ""
-		+ 		"OPTIONAL {"		
+		+ 		"OPTIONAL {"
 		+ "			?Role core:dateTimeInterval ?dateTimeIntervalValue . "
-		+			"?dateTimeIntervalValue core:start ?startDate . "		
-		+			"?startDate core:dateTime ?startDateTimeValue . " 	
-//		+			"OPTIONAL {"	
-//		+				"?dateTimeIntervalValue core:end ?endDate . "	
-//		+				"?endDate core:dateTime ?endDateTimeValue . " 			
+		+			"?dateTimeIntervalValue core:start ?startDate . "
+		+			"?startDate core:dateTime ?startDateTimeValue . "
+//		+			"OPTIONAL {"
+//		+				"?dateTimeIntervalValue core:end ?endDate . "
+//		+				"?endDate core:dateTime ?endDateTimeValue . "
 //		+			"}"
-		+ 		"} . ";	
-	
+		+ 		"} . ";
+
 	private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME = ""
-		+ 		"OPTIONAL {"	
+		+ 		"OPTIONAL {"
 		+ "			?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
-		+			"?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "		
-		+			"?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " 	
-//		+			"OPTIONAL {"	
-//		+				"?dateTimeIntervalValueForGrant core:end ?endDateForGrant . "	
-//		+				"?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " 			
+		+			"?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "
+		+			"?startDateForGrant core:dateTime ?startDateTimeValueForGrant . "
+//		+			"OPTIONAL {"
+//		+				"?dateTimeIntervalValueForGrant core:end ?endDateForGrant . "
+//		+				"?endDateForGrant core:dateTime ?endDateTimeValueForGrant . "
 //		+			"}"
-		+ 		"}";	
-	
-	
+		+ 		"}";
+
+
 	public CoPIGrantCountQueryRunner(String egoURI, VitroRequest vreq, Log log) {
 
 		this.egoURI = egoURI;
@@ -88,24 +88,24 @@ public class CoPIGrantCountQueryRunner implements QueryRunner
 		this.vitroRequest = vreq;
 	//	this.log = log;
 	}
-	
+
 	private String generateEgoCoPIquery(String queryURI) {
 
 		String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
 			+ "SELECT "
-			+ "		(str(<" + queryURI + ">) as ?" + QueryFieldLabels.PI_URL + ") " 
-			+ "		(str(?PILabel) as ?" + QueryFieldLabels.PI_LABEL + ") " 
-			+ "		(str(?Grant) as ?"	+ QueryFieldLabels.GRANT_URL + ") "	
-//			+ "		(str(?GrantLabel) as ?" + QueryFieldLabels.GRANT_LABEL + ") " 
+			+ "		(str(<" + queryURI + ">) as ?" + QueryFieldLabels.PI_URL + ") "
+			+ "		(str(?PILabel) as ?" + QueryFieldLabels.PI_LABEL + ") "
+			+ "		(str(?Grant) as ?"	+ QueryFieldLabels.GRANT_URL + ") "
+//			+ "		(str(?GrantLabel) as ?" + QueryFieldLabels.GRANT_LABEL + ") "
 			+ " 	(str(?startDateTimeValue) as ?grantStartDateLit) "
 //			+ "		(str(?endDateTimeValue) as ?grantEndDateLit)  "
 			+ " 	(str(?startDateTimeValueForGrant) as ?grantStartDateForGrantLit) "
-//			+ "		(str(?endDateTimeValueForGrant) as ?grantEndDateForGrantLit)  "			
+//			+ "		(str(?endDateTimeValueForGrant) as ?grantEndDateForGrantLit)  "
 			+ "		(str(?CoPI) as ?" + QueryFieldLabels.CO_PI_URL + ") "
 			+ "		(str(?CoPILabel) as ?" + QueryFieldLabels.CO_PI_LABEL + ") "
 			+ "WHERE "
-			+ "{ "  	
-			+ 		"<" + queryURI + "> rdfs:label ?PILabel . "  	
+			+ "{ "
+			+ 		"<" + queryURI + "> rdfs:label ?PILabel . "
 			+  		"{ "
 			+			"<" + queryURI + ">  ?Role . "
 		    +			"?Role rdf:type core:CoPrincipalInvestigatorRole . "
@@ -351,12 +351,12 @@ public class CoPIGrantCountQueryRunner implements QueryRunner
 
 	private static class QueryResultConsumer extends ResultSetConsumer {
 		Set nodes = new HashSet();
-		
+
 		Map grantURLToVO = new HashMap();
 		Map> grantURLToCoPIs = new HashMap>();
 		Map nodeURLToVO = new HashMap();
 		Map edgeUniqueIdentifierToVO = new HashMap();
-		
+
 		Collaborator egoNode = null;
 
 		Set edges = new HashSet();
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
index 8686787d..4d4b249e 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java
@@ -27,12 +27,12 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
 import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
 
 public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler {
-	
+
 
 	@Override
 	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log,
 			Dataset dataset) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Co-PI Grant Count" 
+		throw new UnsupportedOperationException("Co-PI Grant Count"
 				+ " does not provide Ajax response.");
 	}
 
@@ -40,7 +40,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
 	public ResponseValues generateVisualizationForShortURLRequests(
 			Map parameters, VitroRequest vitroRequest, Log log,
 			Dataset dataSource) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Co-PI Grant Count" 
+		throw new UnsupportedOperationException("Co-PI Grant Count"
 				+ " does not provide Short URL response.");
 	}
 
@@ -48,104 +48,104 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
 	public Map generateDataVisualization(
 			VitroRequest vitroRequest, Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
-		
+
 		String egoURI = vitroRequest.getParameter(VisualizationFrameworkConstants
 														.INDIVIDUAL_URI_KEY);
 		String visMode = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
-		
-		ModelConstructor constructQueryRunner = 
+
+		ModelConstructor constructQueryRunner =
 				new CoPIGrantCountConstructQueryRunner(egoURI, vitroRequest.getRDFService(), log);
 		Model constructedModel = constructQueryRunner.getConstructedModel();
-		
-		QueryRunner queryManager = 
+
+		QueryRunner queryManager =
 				new CoPIGrantCountQueryRunner(egoURI, vitroRequest, log);
-		
+
 		CollaborationData investigatorNodesAndEdges = queryManager.getQueryResult();
-				
-    	/* 
+
+    	/*
     	 * We will be using the same visualization package for both sparkline & co-pi
-    	 * flash vis. We will use "VIS_MODE_KEY" as a modifier to differentiate 
+    	 * flash vis. We will use "VIS_MODE_KEY" as a modifier to differentiate
     	 * between these two. The default will be to render the co-pi network vis.
-    	 * */ 
+    	 * */
 		if (VisualizationFrameworkConstants.COPIS_COUNT_PER_YEAR_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareCoPIsCountPerYearDataResponse(investigatorNodesAndEdges);
-				
+
 		} else if (VisualizationFrameworkConstants.COPIS_LIST_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareCoPIsListDataResponse(investigatorNodesAndEdges);
-				
+
 		} else if (VisualizationFrameworkConstants.COPI_NETWORK_DOWNLOAD_VIS_MODE
-				.equalsIgnoreCase(visMode)) { 
+				.equalsIgnoreCase(visMode)) {
 			/*
-			 * When the csv file is required - based on which sparkline visualization will 
+			 * When the csv file is required - based on which sparkline visualization will
 			 * be rendered.
 			 * */
 				return prepareNetworkDownloadDataResponse(investigatorNodesAndEdges);
-				
+
 		} else {
     			/*
-    			 * When the graphML file is required - based on which co-pi network 
+    			 * When the graphML file is required - based on which co-pi network
     			 * visualization will be rendered.
     			 * */
     			return prepareNetworkStreamDataResponse(investigatorNodesAndEdges);
 		}
-			
+
 	}
-	
+
 	@Override
 	public ResponseValues generateStandardVisualization(
 			VitroRequest vitroRequest, Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
 		/*
-		 * Support for this has ceased to exist. Standalone mode was created only for demo 
+		 * Support for this has ceased to exist. Standalone mode was created only for demo
 		 * purposes for VIVO Conf.
-		 * */		
+		 * */
 		throw new UnsupportedOperationException("CoPI does not provide Standalone Response.");
 	}
-	
+
 	private String getCoPIsListCSVContent(CollaborationData coPIData) {
-		
+
 		StringBuilder csvFileContent = new StringBuilder();
-		
+
 		csvFileContent.append("Co-investigator, Count\n");
-		
+
 		for (Collaborator currNode : coPIData.getCollaborators()) {
-			
+
 			/*
 			 * We have already printed the Ego Node info.
 			 * */
 			if (currNode != coPIData.getEgoCollaborator()) {
-			
+
 			csvFileContent.append(StringEscapeUtils.escapeCsv(currNode.getCollaboratorName()));
 			csvFileContent.append(",");
 			csvFileContent.append(currNode.getNumOfActivities());
 			csvFileContent.append("\n");
-			
+
 			}
-			
+
 		}
-		
+
 		return csvFileContent.toString();
-	}	
-	
+	}
+
 
 	private String getCoPIsPerYearCSVContent(Map> yearToCoPI) {
 
 		StringBuilder csvFileContent = new StringBuilder();
-		
+
 		csvFileContent.append("Year, Count, Co-investigator(s)\n");
 
 		for (Map.Entry> currentEntry : yearToCoPI.entrySet()) {
-			
+
 			csvFileContent.append(StringEscapeUtils.escapeCsv(currentEntry.getKey()));
 			csvFileContent.append(",");
 			csvFileContent.append(currentEntry.getValue().size());
@@ -154,136 +154,136 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
 										getCoPINamesAsString(currentEntry.getValue())));
 			csvFileContent.append("\n");
 		}
-		
+
 		return csvFileContent.toString();
 	}
 
 	private String getCoPINamesAsString(Set coInvestigators) {
-		
+
 		StringBuilder coPIsMerged = new StringBuilder();
-		
+
 		String coPISeparator = ";";
 		for (Collaborator currentCoPI : coInvestigators) {
 			coPIsMerged.append(currentCoPI.getCollaboratorName()).append(coPISeparator);
 		}
-		
+
 		return StringUtils.removeEnd(coPIsMerged.toString(), coPISeparator);
 	}
-	
-	
+
+
 	/**
-	 * Provides response when a csv file containing number & names of unique co-pis per 
-	 * year is requested. 
+	 * Provides response when a csv file containing number & names of unique co-pis per
+	 * year is requested.
 	 * @param piNodesAndEdges PI nodes and edges
 	 */
 	private Map prepareCoPIsCountPerYearDataResponse(
 					CollaborationData piNodesAndEdges) {
-		
+
 		String outputFileName;
 		Map> yearToCoPIs = new TreeMap>();
-		
-		if (piNodesAndEdges.getCollaborators() != null 
+
+		if (piNodesAndEdges.getCollaborators() != null
 				&& piNodesAndEdges.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(piNodesAndEdges
 									.getEgoCollaborator().getCollaboratorName())
 			+ "_co-investigators-per-year" + ".csv";
-			
+
 			yearToCoPIs = UtilityFunctions.getActivityYearToCollaborators(piNodesAndEdges);
-			
+
 		} else {
-			
-			outputFileName = "no_co-investigators-per-year" + ".csv";			
+
+			outputFileName = "no_co-investigators-per-year" + ".csv";
 		}
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
 					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 getCoPIsPerYearCSVContent(yearToCoPIs));
 
 		return fileData;
 	}
 
 	/**
-	 * Provides response when a csv file containing number & names of unique co-pis per 
-	 * year is requested. 
+	 * Provides response when a csv file containing number & names of unique co-pis per
+	 * year is requested.
 	 * @param coPIData Co Principal Investigator Data
 	 */
 	private Map prepareCoPIsListDataResponse(CollaborationData coPIData) {
-		
+
 		String outputFileName = "";
-		
+
 		if (coPIData.getCollaborators() != null && coPIData.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(coPIData.getEgoCollaborator()
-															.getCollaboratorName()) 
+															.getCollaboratorName())
 									+ "_co-investigators" + ".csv";
-	
+
 		} else {
 			outputFileName = "no_co-investigators" + ".csv";
 		}
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
 					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 getCoPIsListCSVContent(coPIData));
 
 		return fileData;
 	}
 
 	/**
-	 * Provides a response when graphml formatted co-pi network is requested, typically by 
+	 * Provides a response when graphml formatted co-pi network is requested, typically by
 	 * the flash vis.
 	 * @param coPIData Co Investigator data
 	 */
 	private Map prepareNetworkStreamDataResponse(CollaborationData coPIData) {
-	
-		CoPIGraphMLWriter coPIGraphMLWriter = 
+
+		CoPIGraphMLWriter coPIGraphMLWriter =
 				new CoPIGraphMLWriter(coPIData);
-		
+
         Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "text/xml");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 coPIGraphMLWriter.getCoPIGraphMLContent().toString());
 
 		return fileData;
-	
+
 	}
-	
+
 	private Map prepareNetworkDownloadDataResponse(CollaborationData coPIData) {
-		
+
 		String outputFileName = "";
-		
+
 		if (coPIData.getCollaborators() != null && coPIData.getCollaborators().size() > 0) {
-			
+
 			outputFileName = UtilityFunctions.slugify(coPIData.getEgoCollaborator()
-															.getCollaboratorName()) 
+															.getCollaboratorName())
 									+ "_co-investigator-network.graphml" + ".xml";
-			
+
 		} else {
-			outputFileName = "no_co-investigator-network.graphml" + ".xml";			
+			outputFileName = "no_co-investigator-network.graphml" + ".xml";
 		}
-		
-		CoPIGraphMLWriter coPIGraphMLWriter = 
+
+		CoPIGraphMLWriter coPIGraphMLWriter =
 				new CoPIGraphMLWriter(coPIData);
-		
+
         Map fileData = new HashMap();
-        fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+        fileData.put(DataVisualizationController.FILE_NAME_KEY,
 				 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "text/xml");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					 coPIGraphMLWriter.getCoPIGraphMLContent().toString());
 
 		return fileData;
-	
+
 	}
 
 	@Override
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGraphMLWriter.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGraphMLWriter.java
index 03cae0a0..15a13a0a 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGraphMLWriter.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGraphMLWriter.java
@@ -88,7 +88,7 @@ public class CoPIGraphMLWriter {
 
         return graphMLContent;
 	}
-	
+
 	public StringBuilder getCoPIGraphMLContent(){
 		return coPIGraphMLContent;
 	}
@@ -103,7 +103,7 @@ public class CoPIGraphMLWriter {
 		if (coPIData.getCollaborators() != null & coPIData.getCollaborators().size() > 0) {
 			generateNodeSectionContent(coPIData, graph);
 		}
-		
+
 		if (coPIData.getCollaborations() != null & coPIData.getCollaborations().size() > 0) {
 			generateEdgeSectionContent(coPIData, graph);
 		}
@@ -113,7 +113,7 @@ public class CoPIGraphMLWriter {
 		Document doc = graphElement.getOwnerDocument();
 
 		graphElement.appendChild(doc.createComment("edges"));
-		
+
 		Set edges = coPIData.getCollaborations();
 		List orderedEdges = new ArrayList(edges);
 		orderedEdges.sort(new CollaborationComparator());
@@ -121,12 +121,12 @@ public class CoPIGraphMLWriter {
 		for (Collaboration currentEdge : orderedEdges) {
 			/*
 			 * This method actually creates the XML code for a single edge. "graphMLContent"
-			 * is being side-effected. 
+			 * is being side-effected.
 			 * */
 			getEdgeContent(graphElement, currentEdge);
 		}
 	}
-	
+
 	private void getEdgeContent(Element graphElement, Collaboration currentEdge) {
 		Document doc = graphElement.getOwnerDocument();
 
@@ -168,9 +168,9 @@ public class CoPIGraphMLWriter {
 				earliestCount.setTextContent(publicationInfo.getValue().toString());
 				edge.appendChild(earliestCount);
 			}
-			
+
 		}
-		
+
 		if (currentEdge.getLatestCollaborationYearCount() != null) {
 			for (Map.Entry publicationInfo : currentEdge.getLatestCollaborationYearCount().entrySet()) {
 				Element latest = doc.createElementNS(GRAPHML_NS, "data");
@@ -183,9 +183,9 @@ public class CoPIGraphMLWriter {
 				latestCount.setTextContent(publicationInfo.getValue().toString());
 				edge.appendChild(latestCount);
 			}
-			
+
 		}
-		
+
 		if (currentEdge.getUnknownCollaborationYearCount() != null) {
 			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
 			unknown.setAttribute("key", "num_unknown_collaboration");
@@ -201,21 +201,21 @@ public class CoPIGraphMLWriter {
 
 		Collaborator egoNode = coPIData.getEgoCollaborator();
 		Set piNodes = coPIData.getCollaborators();
-		
+
 		/*
 		 * This method actually creates the XML code for a single node. "graphMLContent"
 		 * is being side-effected. The egoNode is added first because this is the "requirement"
 		 * of the co-pi vis. Ego should always come first.
-		 * 
+		 *
 		 * */
 		getNodeContent(graphElement, egoNode);
-		
+
 		List orderedPINodes = new ArrayList(piNodes);
 		orderedPINodes.remove(egoNode);
-		
+
 		orderedPINodes.sort(new CollaboratorComparator());
-		
-		
+
+
 		for (Collaborator currNode : orderedPINodes) {
 			/*
 			 * We have already printed the Ego Node info.
@@ -247,7 +247,7 @@ public class CoPIGraphMLWriter {
 		label.setAttribute("key", "label");
 		label.setTextContent(collaborator.getCollaboratorName());
 		node.appendChild(label);
-		
+
 		if (profileURL != null) {
 			Element profile = doc.createElementNS(GRAPHML_NS, "data");
 			profile.setAttribute("key", "profile_url");
@@ -264,7 +264,7 @@ public class CoPIGraphMLWriter {
 			/*
 			 * There is no clean way of getting the map contents in java even though
 			 * we are sure to have only one entry on the map. So using the for loop.
-			 * I am feeling dirty just about now. 
+			 * I am feeling dirty just about now.
 			 * */
 			for (Map.Entry publicationInfo : collaborator.getEarliestActivityYearCount().entrySet()) {
 				Element earliest = doc.createElementNS(GRAPHML_NS, "data");
@@ -278,7 +278,7 @@ public class CoPIGraphMLWriter {
 				node.appendChild(earliestCount);
 			}
 		}
-		
+
 		if (collaborator.getLatestActivityYearCount() != null) {
 			for (Map.Entry publicationInfo : collaborator.getLatestActivityYearCount().entrySet()) {
 				Element latest = doc.createElementNS(GRAPHML_NS, "data");
@@ -292,7 +292,7 @@ public class CoPIGraphMLWriter {
 				node.appendChild(latestCount);
 			}
 		}
-		
+
 		if (collaborator.getUnknownActivityYearCount() != null) {
 			Element unknown = doc.createElementNS(GRAPHML_NS, "data");
 			unknown.setAttribute("key", "num_unknown_grant");
@@ -303,16 +303,16 @@ public class CoPIGraphMLWriter {
 
 	private void generateKeyDefinitionContent(CollaborationData coPIData, Element rootElement) {
 		/*
-		 * Generate the key definition content for node. 
+		 * Generate the key definition content for node.
 		 * */
 		getKeyDefinitionFromSchema(coPIData.getNodeSchema(), rootElement);
-		
+
 		/*
-		 * Generate the key definition content for edge. 
+		 * Generate the key definition content for edge.
 		 * */
 		getKeyDefinitionFromSchema(coPIData.getEdgeSchema(), rootElement);
 	}
-	
+
 	private void getKeyDefinitionFromSchema(Set> schema, Element rootElement) {
 		Document doc = rootElement.getOwnerDocument();
 
@@ -322,7 +322,7 @@ public class CoPIGraphMLWriter {
 			for (Map.Entry currentAttributeKey : currentNodeSchemaAttribute.entrySet()) {
 				key.setAttribute(currentAttributeKey.getKey(), currentAttributeKey.getValue());
 			}
-			
+
 			if (currentNodeSchemaAttribute.containsKey("default")) {
 				Element def = doc.createElementNS(GRAPHML_NS, "default");
 				def.setTextContent(currentNodeSchemaAttribute.get("default"));
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java
index 71b2ae38..031fa338 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java
@@ -23,7 +23,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.YearToEntityC
 import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
 
 /**
- * This class contains code for rendering sparklines and displaying tables for 
+ * This class contains code for rendering sparklines and displaying tables for
  * Co-PI visualization.
  * @author bkoniden
  * Deepak Konidena
@@ -34,14 +34,14 @@ public class CoPIVisCodeGenerator {
 	 * There are 2 modes of sparkline that are available via this visualization.
 	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
 	 * 			which in this case are the copi(s) over the years, from the last 10 years.
-	 * 
-	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks) 
+	 *
+	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks)
 	 * 			spanning the career of the person & last 10 years at the minimum, in case if
 	 * 			the person started his career in the last 10 years.
 	 * */
-	private static final String DEFAULT_VISCONTAINER_DIV_ID = 
+	private static final String DEFAULT_VISCONTAINER_DIV_ID =
 								"unique_coinvestigators_vis_container";
-	
+
 	private Map> yearToUniqueCoPIs;
 
 	private Log log;
@@ -50,20 +50,20 @@ public class CoPIVisCodeGenerator {
 
 	private String individualURI;
 
-	public CoPIVisCodeGenerator(String individualURI, 
-			  String visMode, 
-			  String visContainer, 
-			  Map> yearToUniqueCoPIs, 
+	public CoPIVisCodeGenerator(String individualURI,
+			  String visMode,
+			  String visContainer,
+			  Map> yearToUniqueCoPIs,
 			  Log log){
-		
+
 		this.individualURI = individualURI;
-		
+
 		this.yearToUniqueCoPIs = yearToUniqueCoPIs;
 
 		this.log = log;
-		
+
 		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
-		
+
 	}
 
 	/**
@@ -78,11 +78,11 @@ public class CoPIVisCodeGenerator {
 		SparklineData sparklineData = new SparklineData();
 
 		int numOfYearsToBeRendered = 0;
-		
+
 		/*
-		 * It was decided that to prevent downward curve that happens if there are no publications 
+		 * It was decided that to prevent downward curve that happens if there are no publications
 		 * in the current year seems a bit harsh, so we consider only publications from the last 10
-		 * complete years. 
+		 * complete years.
 		 * */
 		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
 		int shortSparkMinYear = currentYear
@@ -133,12 +133,12 @@ public class CoPIVisCodeGenerator {
 		}
 
 		numOfYearsToBeRendered = currentYear - minGrantYearConsidered + 1;
-		
+
 		sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
-		
+
 		int uniqueCoPICounter = 0;
 		Set allCoPIsWithKnownGrantShipYears = new HashSet();
-		List yearToUniqueInvestigatorsCountDataTable = 
+		List yearToUniqueInvestigatorsCountDataTable =
 					new ArrayList();
 
 		for (int grantYear = minGrantYearConsidered; grantYear <= currentYear; grantYear++) {
@@ -157,13 +157,13 @@ public class CoPIVisCodeGenerator {
 			}
 
 			yearToUniqueInvestigatorsCountDataTable.add(new YearToEntityCountDataElement(
-					uniqueCoPICounter, 
-					grantYearAsString, 
+					uniqueCoPICounter,
+					grantYearAsString,
 					currentUniqueCoPIs));
-			
+
 			uniqueCoPICounter++;
 		}
-		
+
 		/*
 		 * For the purpose of this visualization I have come up with a term
 		 * "Sparks" which essentially means data points. Sparks that will be
@@ -171,18 +171,18 @@ public class CoPIVisCodeGenerator {
 		 * associated with it. Hence.
 		 */
 		sparklineData.setRenderedSparks(allCoPIsWithKnownGrantShipYears.size());
-		
+
 		sparklineData.setYearToEntityCountDataTable(yearToUniqueInvestigatorsCountDataTable);
 
 		/*
-		 * This is required only for the sparklines which convey collaborationships like 
-		 * coinvestigatorships and coauthorship. There are edge cases where a collaborator can be 
-		 * present for in a collaboration with known & unknown year. We do not want to repeat the 
-		 * count for this collaborator when we present it in the front-end. 
+		 * This is required only for the sparklines which convey collaborationships like
+		 * coinvestigatorships and coauthorship. There are edge cases where a collaborator can be
+		 * present for in a collaboration with known & unknown year. We do not want to repeat the
+		 * count for this collaborator when we present it in the front-end.
 		 * */
-		Set totalUniqueCoInvestigators = 
+		Set totalUniqueCoInvestigators =
 					new HashSet(allCoPIsWithKnownGrantShipYears);
-		
+
 		/*
 		 * Total grants will also consider grants that have no year
 		 * associated with them. Hence.
@@ -194,9 +194,9 @@ public class CoPIVisCodeGenerator {
 			totalUniqueCoInvestigators.addAll(
 					yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR));
 		}
-		
+
 		sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
-		
+
 		sparklineData.setUnknownYearGrants(unknownYearGrants);
 
 		if (providedVisContainerID != null) {
@@ -206,7 +206,7 @@ public class CoPIVisCodeGenerator {
 		}
 
 		sparklineData.setVisContainerDivID(visContainerID);
-		
+
 		/*
 		 * By default these represents the range of the rendered sparks. Only in
 		 * case of "short" sparkline mode we will set the Earliest
@@ -226,35 +226,35 @@ public class CoPIVisCodeGenerator {
 
 			sparklineData.setEarliestRenderedGrantYear(shortSparkMinYear);
 			sparklineData.setShortVisMode(true);
-			
+
 		} else {
 			sparklineData.setShortVisMode(false);
 		}
-		
+
 		if (yearToUniqueCoPIs.size() > 0) {
-			
+
 			sparklineData.setFullTimelineNetworkLink(
 					UtilityFunctions.getCollaboratorshipNetworkLink(
 							individualURI,
 							VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
 							VisualizationFrameworkConstants.COPI_VIS_MODE));
-			
+
 			sparklineData.setDownloadDataLink(
 					UtilityFunctions.getCSVDownloadURL(
 							individualURI,
 							VisualizationFrameworkConstants.CO_PI_VIS,
 							VisualizationFrameworkConstants.COPIS_COUNT_PER_YEAR_VIS_MODE));
-			
+
 			Map yearToUniqueCoPIsCount = new HashMap();
-			for (Map.Entry> currentYearToUniqueCoPIsCount 
+			for (Map.Entry> currentYearToUniqueCoPIsCount
 					: yearToUniqueCoPIs.entrySet()) {
-				
-				yearToUniqueCoPIsCount.put(currentYearToUniqueCoPIsCount.getKey(), 
+
+				yearToUniqueCoPIsCount.put(currentYearToUniqueCoPIsCount.getKey(),
 											   currentYearToUniqueCoPIsCount.getValue().size());
 			}
 
 			sparklineData.setYearToActivityCount(yearToUniqueCoPIsCount);
-			
+
 		}
 
 		return sparklineData;
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/DocumentFieldNotFoundException.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/DocumentFieldNotFoundException.java
index 7d4de93b..2bd6c64f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/DocumentFieldNotFoundException.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/DocumentFieldNotFoundException.java
@@ -1,21 +1,21 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
-
-public class DocumentFieldNotFoundException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-	
-	public DocumentFieldNotFoundException(String message) {
-		super(message);
-	}
-	
-	public DocumentFieldNotFoundException(Exception cause) {
-		super(createMessage(cause), cause);
-	}
-
-	private static String createMessage(Exception cause) {
-		return "Document Field is empty " + cause.getMessage();
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
+
+public class DocumentFieldNotFoundException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	public DocumentFieldNotFoundException(String message) {
+		super(message);
+	}
+
+	public DocumentFieldNotFoundException(Exception cause) {
+		super(createMessage(cause), cause);
+	}
+
+	private static String createMessage(Exception cause) {
+		return "Document Field is empty " + cause.getMessage();
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/IllegalConstructedModelIdentifierException.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/IllegalConstructedModelIdentifierException.java
index a5bf5b8d..22317cd8 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/IllegalConstructedModelIdentifierException.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/IllegalConstructedModelIdentifierException.java
@@ -1,21 +1,21 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
-
-public class IllegalConstructedModelIdentifierException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-	
-	public IllegalConstructedModelIdentifierException(String message) {
-		super(message);
-	}
-	
-	public IllegalConstructedModelIdentifierException(Exception cause) {
-		super(createMessage(cause), cause);
-	}
-
-	private static String createMessage(Exception cause) {
-		return "Illegal Constructed Model Identifier provided. It should be of the form $. " + cause.getMessage();
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
+
+public class IllegalConstructedModelIdentifierException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	public IllegalConstructedModelIdentifierException(String message) {
+		super(message);
+	}
+
+	public IllegalConstructedModelIdentifierException(Exception cause) {
+		super(createMessage(cause), cause);
+	}
+
+	private static String createMessage(Exception cause) {
+		return "Illegal Constructed Model Identifier provided. It should be of the form $. " + cause.getMessage();
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/MalformedQueryParametersException.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/MalformedQueryParametersException.java
index 8b361fe1..df39a4a4 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/MalformedQueryParametersException.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/exceptions/MalformedQueryParametersException.java
@@ -1,21 +1,21 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
-
-public class MalformedQueryParametersException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-	
-	public MalformedQueryParametersException(String message) {
-		super(message);
-	}
-	
-	public MalformedQueryParametersException(Exception cause) {
-		super(createMessage(cause), cause);
-	}
-
-	private static String createMessage(Exception cause) {
-		return "Malformed Query Params " + cause.getMessage();
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.exceptions;
+
+public class MalformedQueryParametersException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	public MalformedQueryParametersException(String message) {
+		super(message);
+	}
+
+	public MalformedQueryParametersException(Exception cause) {
+		super(createMessage(cause), cause);
+	}
+
+	private static String createMessage(Exception cause) {
+		return "Malformed Query Params " + cause.getMessage();
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/mapofscience/MapOfScienceVisualizationRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/mapofscience/MapOfScienceVisualizationRequestHandler.java
index cdf8992b..f4fe4307 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/mapofscience/MapOfScienceVisualizationRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/mapofscience/MapOfScienceVisualizationRequestHandler.java
@@ -1,667 +1,667 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.mapofscience;
-
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.jena.query.QuerySolution;
-import edu.cornell.mannlib.vitro.webapp.beans.Individual;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
-import mapping.ScienceMapping;
-import mapping.ScienceMappingResult;
-
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-
-import org.apache.jena.query.Dataset;
-
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.MapOfScienceConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-import edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph.OrganizationUtilityFunctions;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.GenericQueryMap;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.MapOfScience;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
-
-public class MapOfScienceVisualizationRequestHandler implements VisualizationRequestHandler {
-	
-	@Override
-	public ResponseValues generateStandardVisualization(
-			VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException {
-		
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		return generateStandardVisualizationForScienceMapVis(vitroRequest, log, dataset, entityURI);
-	}
-	
-	@Override
-	public ResponseValues generateVisualizationForShortURLRequests(
-			Map parameters, VitroRequest vitroRequest, Log log,
-			Dataset dataset) throws MalformedQueryParametersException {
-
-		if (vitroRequest.getRequestURI().endsWith("/about")) {
-			return generateAboutScienceMapVisPage();
-		} else {
-			return generateStandardVisualizationForScienceMapVis(
-					vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
-		}
-	}
-
-	private ResponseValues generateAboutScienceMapVisPage() {
-		return new TemplateResponseValues("aboutMapOfScience.ftl");
-	}
-	
-	private ResponseValues generateStandardVisualizationForScienceMapVis(
-			VitroRequest vitroRequest, Log log, Dataset dataset,
-			String entityURI) throws MalformedQueryParametersException {
-		
-		if (StringUtils.isBlank(entityURI)) {
-			
-			entityURI = OrganizationUtilityFunctions
-								.getStaffProvidedOrComputedHighestLevelOrganization(
-											log, 
-											dataset, 
-											vitroRequest);
-			
-		}
-		
-		
-		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
-	}
-
-	private Set getPublicationsForPerson(RDFService rdfService, String personUri) {
-		if (preferCachesForPersonMap() && VisualizationCaches.personToPublication.isCached()) {
-			Map> personToPublicationMap = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
-			return personToPublicationMap.get(personUri);
-		} else {
-			final Set queryResults = new HashSet();
-			String query = QueryConstants.getSparqlPrefixQuery() +
-					"SELECT ?document\n" +
-					"WHERE\n" +
-					"{\n" +
-					"  <" + personUri + "> core:relatedBy ?authorship .\n" +
-					"  ?authorship a core:Authorship .\n" +
-					"  ?authorship core:relates ?document .\n" +
-					"  ?document a bibo:Document .\n" +
-					"}\n";
-
-			try {
-				rdfService.sparqlSelectQuery(query, new ResultSetConsumer() {
-					@Override
-					protected void processQuerySolution(QuerySolution qs) {
-						queryResults.add(qs.getResource("document").getURI());
-					}
-				});
-
-			} catch (RDFServiceException e) {
-			}
-
-			return queryResults;
-		}
-	}
-
-	private Map getJournalsForPerson(RDFService rdfService, String personUri) {
-		if (preferCachesForPersonMap() && VisualizationCaches.publicationToJournal.isCached()) {
-			return VisualizationCaches.publicationToJournal.get(rdfService);
-		} else {
-			final Map queryResults = new HashMap();
-			String query = QueryConstants.getSparqlPrefixQuery() +
-					"SELECT ?document ?journalLabel\n" +
-					"WHERE\n" +
-					"{\n" +
-					"  <" + personUri + "> core:relatedBy ?authorship .\n" +
-					"  ?authorship a core:Authorship .\n" +
-					"  ?authorship core:relates ?document .\n" +
-					"  ?document a bibo:Document .\n" +
-					"  ?document core:hasPublicationVenue ?journal . \n" +
-					"  ?journal rdfs:label ?journalLabel . \n" +
-					"}\n";
-
-			try {
-				rdfService.sparqlSelectQuery(query, new ResultSetConsumer() {
-					@Override
-					protected void processQuerySolution(QuerySolution qs) {
-						queryResults.put(qs.getResource("document").getURI(), qs.getLiteral("journalLabel").getString());
-					}
-				});
-
-			} catch (RDFServiceException e) {
-			}
-
-			return queryResults;
-		}
-	}
-
-	private static boolean preferCachesForPersonMap() {
-		return timeToGeneratePersonMap > 2000;
-	}
-
-	private static long timeToGeneratePersonMap = -1;
-	private synchronized static void recordExecutionTimeForPersonMap(long time) {
-		timeToGeneratePersonMap = Math.max(timeToGeneratePersonMap, time);
-	}
-
-	private Map getSubjectPersonEntityAndGenerateDataResponse(
-			VitroRequest vitroRequest, String subjectEntityURI, String entityLabel, VisConstants.DataVisMode dataOuputFormat)
-			throws MalformedQueryParametersException, JsonProcessingException {
-
-		long startTime = System.currentTimeMillis();
-		try {
-			RDFService rdfService = vitroRequest.getRDFService();
-
-			Set publicationsForPerson = getPublicationsForPerson(rdfService, subjectEntityURI);
-
-			if (publicationsForPerson == null || publicationsForPerson.size() == 0) {
-				if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
-					return prepareStandaloneDataErrorResponse();
-				} else {
-					return prepareDataErrorResponse();
-				}
-			} else {
-				Map publicationToJournalMap = getJournalsForPerson(rdfService, subjectEntityURI);
-
-				JournalPublicationCounts journalCounts = new JournalPublicationCounts();
-
-				for (String publication : publicationsForPerson) {
-					journalCounts.increment(publicationToJournalMap.get(publication));
-				}
-
-				ScienceMappingResult result = getScienceMappingResult(journalCounts.map);
-
-				Map fileData = new HashMap();
-				if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
-					Set jsonContent = new HashSet();
-
-					MapOfScience entityJson = new MapOfScience(subjectEntityURI);
-					entityJson.setLabel("");
-					entityJson.setType("PERSON");
-
-					entityJson.setPubsWithNoJournals(journalCounts.noJournalCount);
-					updateEntityMapOfScienceInformation(entityJson, result);
-
-					jsonContent.add(entityJson);
-
-					ObjectMapper mapper = new ObjectMapper();
-
-					fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-					fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(jsonContent));
-				} else {
-					if (StringUtils.isBlank(entityLabel)) {
-						entityLabel = "no-name";
-					}
-
-					String outputFileName = UtilityFunctions.slugify(entityLabel);
-					String fileContent = null;
-
-					String visModeKey = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
-					if (VisualizationFrameworkConstants.SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE.equalsIgnoreCase(visModeKey)) {
-						outputFileName += "_subdiscipline-to-publications" + ".csv";
-						fileContent = getSubDisciplineToPublicationsCSVContent(result);
-					} else if (VisualizationFrameworkConstants.SCIENCE_UNLOCATED_JOURNALS_VIS_MODE.equalsIgnoreCase(visModeKey)) {
-						outputFileName += "_unmapped-journals" + ".csv";
-						fileContent = getUnlocatedJournalsCSVContent(result, journalCounts.noJournalCount);
-					} else {
-						outputFileName += "_discipline-to-publications" + ".csv";
-						fileContent = getDisciplineToPublicationsCSVContent(result);
-					}
-
-					fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-					fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-					fileData.put(DataVisualizationController.FILE_CONTENT_KEY, fileContent);
-				}
-
-				return fileData;
-			}
-		} finally {
-			recordExecutionTimeForPersonMap(System.currentTimeMillis() - startTime);
-		}
-	}
-
-	private Map getSubjectEntityAndGenerateDataResponse(
-			VitroRequest vitroRequest, String subjectEntityURI, String entityLabel, VisConstants.DataVisMode dataOuputFormat)
-			throws MalformedQueryParametersException, JsonProcessingException {
-
-		RDFService rdfService = vitroRequest.getRDFService();
-
-		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
-
-		if (orgLabelMap.get(subjectEntityURI) == null) {
-			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		}
-
-		Map> subOrgMap = VisualizationCaches.organizationSubOrgs.get(rdfService);
-		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
-		Map> personToPublicationMap = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
-		Map publicationToJournalMap = VisualizationCaches.publicationToJournal.get(rdfService);
-
-		Set orgPublications       = new HashSet();
-		Set orgPublicationsPeople = new HashSet();
-
-		Map> subOrgPublicationsMap = new HashMap>();
-
-		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
-				subjectEntityURI,
-				orgPublications,
-				orgPublicationsPeople,
-				subOrgPublicationsMap,
-				subOrgMap,
-				organisationToPeopleMap.organizationToPeople,
-				personToPublicationMap
-		);
-
-		if (orgPublications.isEmpty()) {
-			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		} else {
-			JournalPublicationCounts journalCounts = new JournalPublicationCounts();
-
-			for (String publication : orgPublications) {
-				journalCounts.increment(publicationToJournalMap.get(publication));
-			}
-
-			ScienceMappingResult result = getScienceMappingResult(journalCounts.map);
-
-			Map fileData = new HashMap();
-			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
-				Set jsonContent = new HashSet();
-
-				MapOfScience entityJson = new MapOfScience(subjectEntityURI);
-				entityJson.setLabel(entityLabel);
-				entityJson.setType("ORGANIZATION");
-
-				if (subOrgMap.containsKey(subjectEntityURI)) {
-					for (String subOrg : subOrgMap.get(subjectEntityURI)) {
-						Set publications = subOrgPublicationsMap.get(subOrg);
-						entityJson.addSubEntity(subOrg,
-								orgLabelMap.get(subOrg),
-								"ORGANIZATION",
-								publications == null ? 0 : publications.size());
-					}
-				}
-
-				entityJson.setPubsWithNoJournals(journalCounts.noJournalCount);
-				updateEntityMapOfScienceInformation(entityJson, result);
-
-				jsonContent.add(entityJson);
-
-				ObjectMapper mapper = new ObjectMapper();
-
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(jsonContent));
-			} else {
-				if (StringUtils.isBlank(entityLabel)) {
-					entityLabel = "no-organization";
-				}
-
-				String outputFileName = UtilityFunctions.slugify(entityLabel);
-				String fileContent = null;
-
-				String visModeKey = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
-				if (VisualizationFrameworkConstants.SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE.equalsIgnoreCase(visModeKey)) {
-					outputFileName += "_subdiscipline-to-publications" + ".csv";
-					fileContent = getSubDisciplineToPublicationsCSVContent(result);
-				} else if (VisualizationFrameworkConstants.SCIENCE_UNLOCATED_JOURNALS_VIS_MODE.equalsIgnoreCase(visModeKey)) {
-					outputFileName += "_unmapped-journals" + ".csv";
-					fileContent = getUnlocatedJournalsCSVContent(result, journalCounts.noJournalCount);
-				} else {
-					outputFileName += "_discipline-to-publications" + ".csv";
-					fileContent = getDisciplineToPublicationsCSVContent(result);
-				}
-
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, fileContent);
-			}
-			return fileData;
-		}
-	}
-
-	private Map prepareDataErrorResponse() {
-		
-		String outputFileName = "no-organization_publications-per-year.csv";
-		
-		Map fileData = new HashMap();
-		
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
-					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
-					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, "");
-		return fileData;
-	}
-
-	private Map prepareStandaloneDataErrorResponse() throws JsonProcessingException {
-		
-		GenericQueryMap errorDataResponse = new GenericQueryMap();
-		errorDataResponse.addEntry("error", "No Publications for this Entity found in VIVO.");
-		
-		Map fileData = new HashMap();
-		
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
-					 "application/octet-stream");
-
-		ObjectMapper mapper = new ObjectMapper();
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(errorDataResponse));
-		
-		return fileData;
-	}
-
-	@Override
-	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException, JsonProcessingException {
-
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		
-		if (StringUtils.isBlank(entityURI)) {
-			entityURI = OrganizationUtilityFunctions
-							.getStaffProvidedOrComputedHighestLevelOrganization(
-									log,
-									dataset,
-									vitroRequest);
-		}
-		
-		VisConstants.DataVisMode currentDataVisMode = VisConstants.DataVisMode.CSV;
-		
-		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
-				.equalsIgnoreCase(vitroRequest.getParameter(
-						VisualizationFrameworkConstants.OUTPUT_FORMAT_KEY))) {
-			currentDataVisMode = VisConstants.DataVisMode.JSON;
-		}
-
-		Individual individual = vitroRequest.getWebappDaoFactory()
-				.getIndividualDao()
-				.getIndividualByURI(entityURI);
-
-		try {
-			if (individual != null && individual.isVClass("http://xmlns.com/foaf/0.1/Person")) {
-				return getSubjectPersonEntityAndGenerateDataResponse(
-						vitroRequest,
-						entityURI,
-						individual != null ? individual.getDataValue("http://www.w3.org/2000/01/rdf-schema#label") : "",
-						currentDataVisMode);
-			} else {
-				return getSubjectEntityAndGenerateDataResponse(
-						vitroRequest,
-						entityURI,
-						individual != null ? individual.getDataValue("http://www.w3.org/2000/01/rdf-schema#label") : "",
-						currentDataVisMode);
-			}
-		} finally {
-			VisualizationCaches.buildMissing();
-		}
-	}
-	
-	
-	@Override
-	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Map of Science Vis does not provide Ajax Response.");
-	}
-
-	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq, String entityURI)
-				throws MalformedQueryParametersException {
-
-        String standaloneTemplate = "mapOfScienceStandalone.ftl";
-		
-        String entityLabel = UtilityFunctions.getIndividualLabelFromDAO(vreq, entityURI);
-        
-        Map body = new HashMap();
-        body.put("title", entityLabel + " - Map of Science Visualization");
-        body.put("entityURI", entityURI);
-        body.put("entityLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
-        body.put("entityLabel", entityLabel);
-        
-        if (UtilityFunctions.isEntityAPerson(vreq, entityURI)) {
-        	body.put("entityType", "PERSON");
-			if (preferCachesForPersonMap() && VisualizationCaches.personToPublication.isCached()) {
-				body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
-			}
-        } else {
-        	body.put("entityType", "ORGANIZATION");
-			if (VisualizationCaches.personToPublication.isCached()) {
-				body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
-			}
-        }
-
-
-        body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
-
-		ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
-		if (properties != null) {
-			String key = properties.getProperty("google.maps.key");
-			if (!StringUtils.isEmpty(key)) {
-				body.put("googleMapsKey", key);
-			}
-		}
-
-        return new TemplateResponseValues(standaloneTemplate, body);
-	}
-
-	private void updateEntityMapOfScienceInformation(MapOfScience entityJson, ScienceMappingResult result) {
-		int mappedPublicationCount = 0;
-		int publicationsWithInvalidJournalCount = 0;
-		Map subdisciplineToActivity = new HashMap();
-		
-		if (result != null) {
-			subdisciplineToActivity = result.getMappedResult();
-			publicationsWithInvalidJournalCount = Math.round(result.getUnMappedPublications());
-			mappedPublicationCount = Math.round(result.getMappedPublications());
-		}
-		
-		entityJson.setPubsMapped(mappedPublicationCount);
-		entityJson.setPubsWithInvalidJournals(publicationsWithInvalidJournalCount);
-		entityJson.setSubdisciplineActivity(subdisciplineToActivity);
-	}
-
-	private ScienceMappingResult getScienceMappingResult(
-			Map journalToPublicationCount) {
-		ScienceMappingResult result = null;
-		try {
-			result = (new ScienceMapping()).generateScienceMappingResult(journalToPublicationCount);
-		} catch (NumberFormatException e) {
-			System.err.println("NumberFormatException coming from Map Of Science Vis");
-			e.printStackTrace();
-		} catch (IOException e) {
-			System.err.println("IOException coming from Map Of Science Vis");
-			e.printStackTrace();
-		}
-		return result;
-	}
-
-	private String getDisciplineToPublicationsCSVContent(ScienceMappingResult result) {
-		StringBuilder csvFileContent = new StringBuilder();
-		
-		csvFileContent.append("Discipline, Publication Count, % Activity\n");
-		
-		Map disciplineToPublicationCount = new HashMap();
-		
-		Float totalMappedPublications = new Float(0);
-		
-		if (result != null) {
-			for (Map.Entry currentMappedSubdiscipline : result.getMappedResult().entrySet()) {
-				float updatedPublicationCount = currentMappedSubdiscipline.getValue();
-				
-				Integer lookedUpDisciplineID = MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_DISCIPLINE_ID
-													.get(currentMappedSubdiscipline.getKey());
-				
-				if (disciplineToPublicationCount.containsKey(lookedUpDisciplineID)) {
-					updatedPublicationCount += disciplineToPublicationCount.get(lookedUpDisciplineID);
-				}
-				
-				disciplineToPublicationCount.put(lookedUpDisciplineID, updatedPublicationCount);
-			}
-			
-			totalMappedPublications = result.getMappedPublications();
-		}
-		
-		DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
-		
-		for (Map.Entry currentMappedDiscipline : disciplineToPublicationCount.entrySet()) {
-			csvFileContent.append(StringEscapeUtils.escapeCsv(MapOfScienceConstants.DISCIPLINE_ID_TO_LABEL.get(currentMappedDiscipline.getKey())));
-			csvFileContent.append(", ");
-			csvFileContent.append(percentageActivityFormat.format(currentMappedDiscipline.getValue()));
-			csvFileContent.append(", ");
-			
-			if (totalMappedPublications > 0) {
-				csvFileContent.append(percentageActivityFormat.format(100 * currentMappedDiscipline.getValue() / totalMappedPublications));
-			} else {
-				csvFileContent.append("Not Available");
-			}
-			
-			csvFileContent.append("\n");
-		}
-		
-		for (Map.Entry currentDiscipline : MapOfScienceConstants.DISCIPLINE_ID_TO_LABEL.entrySet()) {
-			
-			Float currentDisciplineValue = disciplineToPublicationCount.get(currentDiscipline.getKey());
-			if (currentDisciplineValue == null) {
-				csvFileContent.append(StringEscapeUtils.escapeCsv(currentDiscipline.getValue()));
-				csvFileContent.append(", ");
-				csvFileContent.append(0);
-				csvFileContent.append(", ");
-				csvFileContent.append(0);	
-				csvFileContent.append("\n");
-			}
-		}
-		
-		return csvFileContent.toString();
-	}
-	
-	private String getUnlocatedJournalsCSVContent(ScienceMappingResult result, int noJournalCount) {
-		StringBuilder csvFileContent = new StringBuilder();
-		
-		csvFileContent.append("Publication Venue, Publication Count\n");
-		
-		DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
-		
-		if (noJournalCount > 0) {
-			csvFileContent.append(StringEscapeUtils.escapeCsv("No Publication Venue Given"));
-			csvFileContent.append(", ");
-			csvFileContent.append(percentageActivityFormat.format(noJournalCount));
-			csvFileContent.append("\n");
-		}
-		
-		if (result != null) {
-			Map mappedResult = result.getUnmappedResult();
-			
-			for (Map.Entry currentUnMappedJournal : mappedResult.entrySet()) {
-				csvFileContent.append(StringEscapeUtils.escapeCsv(currentUnMappedJournal.getKey()));
-				csvFileContent.append(", ");
-				csvFileContent.append(percentageActivityFormat.format(currentUnMappedJournal.getValue()));
-				csvFileContent.append("\n");
-			}
-		}
-		
-		return csvFileContent.toString();
-	}
-	
-	private String getSubDisciplineToPublicationsCSVContent(ScienceMappingResult result) {
-		StringBuilder csvFileContent = new StringBuilder();
-		
-		csvFileContent.append("Sub-Discipline, Publication Count, % Activity\n");
-		
-		Float totalMappedPublications = new Float(0);
-		
-		if (result != null) {
-			DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
-			
-			totalMappedPublications = result.getMappedPublications();
-			Map mappedResult = result.getMappedResult();
-			
-			for (Map.Entry currentMappedSubdiscipline : mappedResult.entrySet()) {
-				csvFileContent.append(StringEscapeUtils.escapeCsv(MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_LABEL
-																	.get(currentMappedSubdiscipline.getKey())));
-				csvFileContent.append(", ");
-				csvFileContent.append(percentageActivityFormat.format(currentMappedSubdiscipline.getValue()));
-				csvFileContent.append(", ");
-				
-				if (totalMappedPublications > 0) {
-					csvFileContent.append(percentageActivityFormat.format(100 * currentMappedSubdiscipline.getValue() / totalMappedPublications));
-				} else {
-					csvFileContent.append("Not Available");
-				}
-				csvFileContent.append("\n");
-			}
-			
-			for (Map.Entry currentSubdiscipline : MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_LABEL.entrySet()) {
-				Float currentMappedSubdisciplineValue = mappedResult.get(currentSubdiscipline.getKey());
-				if (currentMappedSubdisciplineValue == null) {
-					csvFileContent.append(StringEscapeUtils.escapeCsv(currentSubdiscipline.getValue()));
-					csvFileContent.append(", ");
-					csvFileContent.append(0);
-					csvFileContent.append(", ");
-					csvFileContent.append(0);	
-					csvFileContent.append("\n");
-				}
-			}
-		}
-		
-		return csvFileContent.toString();
-	}
-
-	@Override
-	public AuthorizationRequest getRequiredPrivileges() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	private static class JournalPublicationCounts {
-		Map map = new HashMap();
-		int noJournalCount = 0;
-		int total = 0;
-
-		void increment(String journalName) {
-			if (StringUtils.isEmpty(journalName)) {
-				noJournalCount++;
-			} else {
-				Integer count = map.get(journalName);
-				if (count == null) {
-					map.put(journalName, 1);
-				} else {
-					map.put(journalName, 1 + count.intValue());
-				}
-			}
-
-			total++;
-		}
-
-		boolean isEmpty() {
-			return total == 0;
-		}
-
-		long getTotal() {
-			return total;
-		}
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.mapofscience;
+
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.jena.query.QuerySolution;
+import edu.cornell.mannlib.vitro.webapp.beans.Individual;
+import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
+import mapping.ScienceMapping;
+import mapping.ScienceMappingResult;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+
+import org.apache.jena.query.Dataset;
+
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.MapOfScienceConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+import edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph.OrganizationUtilityFunctions;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.GenericQueryMap;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.MapOfScience;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
+
+public class MapOfScienceVisualizationRequestHandler implements VisualizationRequestHandler {
+
+	@Override
+	public ResponseValues generateStandardVisualization(
+			VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+		return generateStandardVisualizationForScienceMapVis(vitroRequest, log, dataset, entityURI);
+	}
+
+	@Override
+	public ResponseValues generateVisualizationForShortURLRequests(
+			Map parameters, VitroRequest vitroRequest, Log log,
+			Dataset dataset) throws MalformedQueryParametersException {
+
+		if (vitroRequest.getRequestURI().endsWith("/about")) {
+			return generateAboutScienceMapVisPage();
+		} else {
+			return generateStandardVisualizationForScienceMapVis(
+					vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
+		}
+	}
+
+	private ResponseValues generateAboutScienceMapVisPage() {
+		return new TemplateResponseValues("aboutMapOfScience.ftl");
+	}
+
+	private ResponseValues generateStandardVisualizationForScienceMapVis(
+			VitroRequest vitroRequest, Log log, Dataset dataset,
+			String entityURI) throws MalformedQueryParametersException {
+
+		if (StringUtils.isBlank(entityURI)) {
+
+			entityURI = OrganizationUtilityFunctions
+								.getStaffProvidedOrComputedHighestLevelOrganization(
+											log,
+											dataset,
+											vitroRequest);
+
+		}
+
+
+		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
+	}
+
+	private Set getPublicationsForPerson(RDFService rdfService, String personUri) {
+		if (preferCachesForPersonMap() && VisualizationCaches.personToPublication.isCached()) {
+			Map> personToPublicationMap = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
+			return personToPublicationMap.get(personUri);
+		} else {
+			final Set queryResults = new HashSet();
+			String query = QueryConstants.getSparqlPrefixQuery() +
+					"SELECT ?document\n" +
+					"WHERE\n" +
+					"{\n" +
+					"  <" + personUri + "> core:relatedBy ?authorship .\n" +
+					"  ?authorship a core:Authorship .\n" +
+					"  ?authorship core:relates ?document .\n" +
+					"  ?document a bibo:Document .\n" +
+					"}\n";
+
+			try {
+				rdfService.sparqlSelectQuery(query, new ResultSetConsumer() {
+					@Override
+					protected void processQuerySolution(QuerySolution qs) {
+						queryResults.add(qs.getResource("document").getURI());
+					}
+				});
+
+			} catch (RDFServiceException e) {
+			}
+
+			return queryResults;
+		}
+	}
+
+	private Map getJournalsForPerson(RDFService rdfService, String personUri) {
+		if (preferCachesForPersonMap() && VisualizationCaches.publicationToJournal.isCached()) {
+			return VisualizationCaches.publicationToJournal.get(rdfService);
+		} else {
+			final Map queryResults = new HashMap();
+			String query = QueryConstants.getSparqlPrefixQuery() +
+					"SELECT ?document ?journalLabel\n" +
+					"WHERE\n" +
+					"{\n" +
+					"  <" + personUri + "> core:relatedBy ?authorship .\n" +
+					"  ?authorship a core:Authorship .\n" +
+					"  ?authorship core:relates ?document .\n" +
+					"  ?document a bibo:Document .\n" +
+					"  ?document core:hasPublicationVenue ?journal . \n" +
+					"  ?journal rdfs:label ?journalLabel . \n" +
+					"}\n";
+
+			try {
+				rdfService.sparqlSelectQuery(query, new ResultSetConsumer() {
+					@Override
+					protected void processQuerySolution(QuerySolution qs) {
+						queryResults.put(qs.getResource("document").getURI(), qs.getLiteral("journalLabel").getString());
+					}
+				});
+
+			} catch (RDFServiceException e) {
+			}
+
+			return queryResults;
+		}
+	}
+
+	private static boolean preferCachesForPersonMap() {
+		return timeToGeneratePersonMap > 2000;
+	}
+
+	private static long timeToGeneratePersonMap = -1;
+	private synchronized static void recordExecutionTimeForPersonMap(long time) {
+		timeToGeneratePersonMap = Math.max(timeToGeneratePersonMap, time);
+	}
+
+	private Map getSubjectPersonEntityAndGenerateDataResponse(
+			VitroRequest vitroRequest, String subjectEntityURI, String entityLabel, VisConstants.DataVisMode dataOuputFormat)
+			throws MalformedQueryParametersException, JsonProcessingException {
+
+		long startTime = System.currentTimeMillis();
+		try {
+			RDFService rdfService = vitroRequest.getRDFService();
+
+			Set publicationsForPerson = getPublicationsForPerson(rdfService, subjectEntityURI);
+
+			if (publicationsForPerson == null || publicationsForPerson.size() == 0) {
+				if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
+					return prepareStandaloneDataErrorResponse();
+				} else {
+					return prepareDataErrorResponse();
+				}
+			} else {
+				Map publicationToJournalMap = getJournalsForPerson(rdfService, subjectEntityURI);
+
+				JournalPublicationCounts journalCounts = new JournalPublicationCounts();
+
+				for (String publication : publicationsForPerson) {
+					journalCounts.increment(publicationToJournalMap.get(publication));
+				}
+
+				ScienceMappingResult result = getScienceMappingResult(journalCounts.map);
+
+				Map fileData = new HashMap();
+				if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
+					Set jsonContent = new HashSet();
+
+					MapOfScience entityJson = new MapOfScience(subjectEntityURI);
+					entityJson.setLabel("");
+					entityJson.setType("PERSON");
+
+					entityJson.setPubsWithNoJournals(journalCounts.noJournalCount);
+					updateEntityMapOfScienceInformation(entityJson, result);
+
+					jsonContent.add(entityJson);
+
+					ObjectMapper mapper = new ObjectMapper();
+
+					fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+					fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(jsonContent));
+				} else {
+					if (StringUtils.isBlank(entityLabel)) {
+						entityLabel = "no-name";
+					}
+
+					String outputFileName = UtilityFunctions.slugify(entityLabel);
+					String fileContent = null;
+
+					String visModeKey = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
+					if (VisualizationFrameworkConstants.SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE.equalsIgnoreCase(visModeKey)) {
+						outputFileName += "_subdiscipline-to-publications" + ".csv";
+						fileContent = getSubDisciplineToPublicationsCSVContent(result);
+					} else if (VisualizationFrameworkConstants.SCIENCE_UNLOCATED_JOURNALS_VIS_MODE.equalsIgnoreCase(visModeKey)) {
+						outputFileName += "_unmapped-journals" + ".csv";
+						fileContent = getUnlocatedJournalsCSVContent(result, journalCounts.noJournalCount);
+					} else {
+						outputFileName += "_discipline-to-publications" + ".csv";
+						fileContent = getDisciplineToPublicationsCSVContent(result);
+					}
+
+					fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+					fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+					fileData.put(DataVisualizationController.FILE_CONTENT_KEY, fileContent);
+				}
+
+				return fileData;
+			}
+		} finally {
+			recordExecutionTimeForPersonMap(System.currentTimeMillis() - startTime);
+		}
+	}
+
+	private Map getSubjectEntityAndGenerateDataResponse(
+			VitroRequest vitroRequest, String subjectEntityURI, String entityLabel, VisConstants.DataVisMode dataOuputFormat)
+			throws MalformedQueryParametersException, JsonProcessingException {
+
+		RDFService rdfService = vitroRequest.getRDFService();
+
+		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
+
+		if (orgLabelMap.get(subjectEntityURI) == null) {
+			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		}
+
+		Map> subOrgMap = VisualizationCaches.organizationSubOrgs.get(rdfService);
+		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
+		Map> personToPublicationMap = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
+		Map publicationToJournalMap = VisualizationCaches.publicationToJournal.get(rdfService);
+
+		Set orgPublications       = new HashSet();
+		Set orgPublicationsPeople = new HashSet();
+
+		Map> subOrgPublicationsMap = new HashMap>();
+
+		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
+				subjectEntityURI,
+				orgPublications,
+				orgPublicationsPeople,
+				subOrgPublicationsMap,
+				subOrgMap,
+				organisationToPeopleMap.organizationToPeople,
+				personToPublicationMap
+		);
+
+		if (orgPublications.isEmpty()) {
+			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		} else {
+			JournalPublicationCounts journalCounts = new JournalPublicationCounts();
+
+			for (String publication : orgPublications) {
+				journalCounts.increment(publicationToJournalMap.get(publication));
+			}
+
+			ScienceMappingResult result = getScienceMappingResult(journalCounts.map);
+
+			Map fileData = new HashMap();
+			if (VisConstants.DataVisMode.JSON.equals(dataOuputFormat)) {
+				Set jsonContent = new HashSet();
+
+				MapOfScience entityJson = new MapOfScience(subjectEntityURI);
+				entityJson.setLabel(entityLabel);
+				entityJson.setType("ORGANIZATION");
+
+				if (subOrgMap.containsKey(subjectEntityURI)) {
+					for (String subOrg : subOrgMap.get(subjectEntityURI)) {
+						Set publications = subOrgPublicationsMap.get(subOrg);
+						entityJson.addSubEntity(subOrg,
+								orgLabelMap.get(subOrg),
+								"ORGANIZATION",
+								publications == null ? 0 : publications.size());
+					}
+				}
+
+				entityJson.setPubsWithNoJournals(journalCounts.noJournalCount);
+				updateEntityMapOfScienceInformation(entityJson, result);
+
+				jsonContent.add(entityJson);
+
+				ObjectMapper mapper = new ObjectMapper();
+
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(jsonContent));
+			} else {
+				if (StringUtils.isBlank(entityLabel)) {
+					entityLabel = "no-organization";
+				}
+
+				String outputFileName = UtilityFunctions.slugify(entityLabel);
+				String fileContent = null;
+
+				String visModeKey = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
+				if (VisualizationFrameworkConstants.SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE.equalsIgnoreCase(visModeKey)) {
+					outputFileName += "_subdiscipline-to-publications" + ".csv";
+					fileContent = getSubDisciplineToPublicationsCSVContent(result);
+				} else if (VisualizationFrameworkConstants.SCIENCE_UNLOCATED_JOURNALS_VIS_MODE.equalsIgnoreCase(visModeKey)) {
+					outputFileName += "_unmapped-journals" + ".csv";
+					fileContent = getUnlocatedJournalsCSVContent(result, journalCounts.noJournalCount);
+				} else {
+					outputFileName += "_discipline-to-publications" + ".csv";
+					fileContent = getDisciplineToPublicationsCSVContent(result);
+				}
+
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, fileContent);
+			}
+			return fileData;
+		}
+	}
+
+	private Map prepareDataErrorResponse() {
+
+		String outputFileName = "no-organization_publications-per-year.csv";
+
+		Map fileData = new HashMap();
+
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
+					 outputFileName);
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
+					 "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, "");
+		return fileData;
+	}
+
+	private Map prepareStandaloneDataErrorResponse() throws JsonProcessingException {
+
+		GenericQueryMap errorDataResponse = new GenericQueryMap();
+		errorDataResponse.addEntry("error", "No Publications for this Entity found in VIVO.");
+
+		Map fileData = new HashMap();
+
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
+					 "application/octet-stream");
+
+		ObjectMapper mapper = new ObjectMapper();
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(errorDataResponse));
+
+		return fileData;
+	}
+
+	@Override
+	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException, JsonProcessingException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		if (StringUtils.isBlank(entityURI)) {
+			entityURI = OrganizationUtilityFunctions
+							.getStaffProvidedOrComputedHighestLevelOrganization(
+									log,
+									dataset,
+									vitroRequest);
+		}
+
+		VisConstants.DataVisMode currentDataVisMode = VisConstants.DataVisMode.CSV;
+
+		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
+				.equalsIgnoreCase(vitroRequest.getParameter(
+						VisualizationFrameworkConstants.OUTPUT_FORMAT_KEY))) {
+			currentDataVisMode = VisConstants.DataVisMode.JSON;
+		}
+
+		Individual individual = vitroRequest.getWebappDaoFactory()
+				.getIndividualDao()
+				.getIndividualByURI(entityURI);
+
+		try {
+			if (individual != null && individual.isVClass("http://xmlns.com/foaf/0.1/Person")) {
+				return getSubjectPersonEntityAndGenerateDataResponse(
+						vitroRequest,
+						entityURI,
+						individual != null ? individual.getDataValue("http://www.w3.org/2000/01/rdf-schema#label") : "",
+						currentDataVisMode);
+			} else {
+				return getSubjectEntityAndGenerateDataResponse(
+						vitroRequest,
+						entityURI,
+						individual != null ? individual.getDataValue("http://www.w3.org/2000/01/rdf-schema#label") : "",
+						currentDataVisMode);
+			}
+		} finally {
+			VisualizationCaches.buildMissing();
+		}
+	}
+
+
+	@Override
+	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset) throws MalformedQueryParametersException {
+		throw new UnsupportedOperationException("Map of Science Vis does not provide Ajax Response.");
+	}
+
+	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq, String entityURI)
+				throws MalformedQueryParametersException {
+
+        String standaloneTemplate = "mapOfScienceStandalone.ftl";
+
+        String entityLabel = UtilityFunctions.getIndividualLabelFromDAO(vreq, entityURI);
+
+        Map body = new HashMap();
+        body.put("title", entityLabel + " - Map of Science Visualization");
+        body.put("entityURI", entityURI);
+        body.put("entityLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
+        body.put("entityLabel", entityLabel);
+
+        if (UtilityFunctions.isEntityAPerson(vreq, entityURI)) {
+        	body.put("entityType", "PERSON");
+			if (preferCachesForPersonMap() && VisualizationCaches.personToPublication.isCached()) {
+				body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
+			}
+        } else {
+        	body.put("entityType", "ORGANIZATION");
+			if (VisualizationCaches.personToPublication.isCached()) {
+				body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
+			}
+        }
+
+
+        body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
+
+		ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
+		if (properties != null) {
+			String key = properties.getProperty("google.maps.key");
+			if (!StringUtils.isEmpty(key)) {
+				body.put("googleMapsKey", key);
+			}
+		}
+
+        return new TemplateResponseValues(standaloneTemplate, body);
+	}
+
+	private void updateEntityMapOfScienceInformation(MapOfScience entityJson, ScienceMappingResult result) {
+		int mappedPublicationCount = 0;
+		int publicationsWithInvalidJournalCount = 0;
+		Map subdisciplineToActivity = new HashMap();
+
+		if (result != null) {
+			subdisciplineToActivity = result.getMappedResult();
+			publicationsWithInvalidJournalCount = Math.round(result.getUnMappedPublications());
+			mappedPublicationCount = Math.round(result.getMappedPublications());
+		}
+
+		entityJson.setPubsMapped(mappedPublicationCount);
+		entityJson.setPubsWithInvalidJournals(publicationsWithInvalidJournalCount);
+		entityJson.setSubdisciplineActivity(subdisciplineToActivity);
+	}
+
+	private ScienceMappingResult getScienceMappingResult(
+			Map journalToPublicationCount) {
+		ScienceMappingResult result = null;
+		try {
+			result = (new ScienceMapping()).generateScienceMappingResult(journalToPublicationCount);
+		} catch (NumberFormatException e) {
+			System.err.println("NumberFormatException coming from Map Of Science Vis");
+			e.printStackTrace();
+		} catch (IOException e) {
+			System.err.println("IOException coming from Map Of Science Vis");
+			e.printStackTrace();
+		}
+		return result;
+	}
+
+	private String getDisciplineToPublicationsCSVContent(ScienceMappingResult result) {
+		StringBuilder csvFileContent = new StringBuilder();
+
+		csvFileContent.append("Discipline, Publication Count, % Activity\n");
+
+		Map disciplineToPublicationCount = new HashMap();
+
+		Float totalMappedPublications = new Float(0);
+
+		if (result != null) {
+			for (Map.Entry currentMappedSubdiscipline : result.getMappedResult().entrySet()) {
+				float updatedPublicationCount = currentMappedSubdiscipline.getValue();
+
+				Integer lookedUpDisciplineID = MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_DISCIPLINE_ID
+													.get(currentMappedSubdiscipline.getKey());
+
+				if (disciplineToPublicationCount.containsKey(lookedUpDisciplineID)) {
+					updatedPublicationCount += disciplineToPublicationCount.get(lookedUpDisciplineID);
+				}
+
+				disciplineToPublicationCount.put(lookedUpDisciplineID, updatedPublicationCount);
+			}
+
+			totalMappedPublications = result.getMappedPublications();
+		}
+
+		DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
+
+		for (Map.Entry currentMappedDiscipline : disciplineToPublicationCount.entrySet()) {
+			csvFileContent.append(StringEscapeUtils.escapeCsv(MapOfScienceConstants.DISCIPLINE_ID_TO_LABEL.get(currentMappedDiscipline.getKey())));
+			csvFileContent.append(", ");
+			csvFileContent.append(percentageActivityFormat.format(currentMappedDiscipline.getValue()));
+			csvFileContent.append(", ");
+
+			if (totalMappedPublications > 0) {
+				csvFileContent.append(percentageActivityFormat.format(100 * currentMappedDiscipline.getValue() / totalMappedPublications));
+			} else {
+				csvFileContent.append("Not Available");
+			}
+
+			csvFileContent.append("\n");
+		}
+
+		for (Map.Entry currentDiscipline : MapOfScienceConstants.DISCIPLINE_ID_TO_LABEL.entrySet()) {
+
+			Float currentDisciplineValue = disciplineToPublicationCount.get(currentDiscipline.getKey());
+			if (currentDisciplineValue == null) {
+				csvFileContent.append(StringEscapeUtils.escapeCsv(currentDiscipline.getValue()));
+				csvFileContent.append(", ");
+				csvFileContent.append(0);
+				csvFileContent.append(", ");
+				csvFileContent.append(0);
+				csvFileContent.append("\n");
+			}
+		}
+
+		return csvFileContent.toString();
+	}
+
+	private String getUnlocatedJournalsCSVContent(ScienceMappingResult result, int noJournalCount) {
+		StringBuilder csvFileContent = new StringBuilder();
+
+		csvFileContent.append("Publication Venue, Publication Count\n");
+
+		DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
+
+		if (noJournalCount > 0) {
+			csvFileContent.append(StringEscapeUtils.escapeCsv("No Publication Venue Given"));
+			csvFileContent.append(", ");
+			csvFileContent.append(percentageActivityFormat.format(noJournalCount));
+			csvFileContent.append("\n");
+		}
+
+		if (result != null) {
+			Map mappedResult = result.getUnmappedResult();
+
+			for (Map.Entry currentUnMappedJournal : mappedResult.entrySet()) {
+				csvFileContent.append(StringEscapeUtils.escapeCsv(currentUnMappedJournal.getKey()));
+				csvFileContent.append(", ");
+				csvFileContent.append(percentageActivityFormat.format(currentUnMappedJournal.getValue()));
+				csvFileContent.append("\n");
+			}
+		}
+
+		return csvFileContent.toString();
+	}
+
+	private String getSubDisciplineToPublicationsCSVContent(ScienceMappingResult result) {
+		StringBuilder csvFileContent = new StringBuilder();
+
+		csvFileContent.append("Sub-Discipline, Publication Count, % Activity\n");
+
+		Float totalMappedPublications = new Float(0);
+
+		if (result != null) {
+			DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
+
+			totalMappedPublications = result.getMappedPublications();
+			Map mappedResult = result.getMappedResult();
+
+			for (Map.Entry currentMappedSubdiscipline : mappedResult.entrySet()) {
+				csvFileContent.append(StringEscapeUtils.escapeCsv(MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_LABEL
+																	.get(currentMappedSubdiscipline.getKey())));
+				csvFileContent.append(", ");
+				csvFileContent.append(percentageActivityFormat.format(currentMappedSubdiscipline.getValue()));
+				csvFileContent.append(", ");
+
+				if (totalMappedPublications > 0) {
+					csvFileContent.append(percentageActivityFormat.format(100 * currentMappedSubdiscipline.getValue() / totalMappedPublications));
+				} else {
+					csvFileContent.append("Not Available");
+				}
+				csvFileContent.append("\n");
+			}
+
+			for (Map.Entry currentSubdiscipline : MapOfScienceConstants.SUB_DISCIPLINE_ID_TO_LABEL.entrySet()) {
+				Float currentMappedSubdisciplineValue = mappedResult.get(currentSubdiscipline.getKey());
+				if (currentMappedSubdisciplineValue == null) {
+					csvFileContent.append(StringEscapeUtils.escapeCsv(currentSubdiscipline.getValue()));
+					csvFileContent.append(", ");
+					csvFileContent.append(0);
+					csvFileContent.append(", ");
+					csvFileContent.append(0);
+					csvFileContent.append("\n");
+				}
+			}
+		}
+
+		return csvFileContent.toString();
+	}
+
+	@Override
+	public AuthorizationRequest getRequiredPrivileges() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	private static class JournalPublicationCounts {
+		Map map = new HashMap();
+		int noJournalCount = 0;
+		int total = 0;
+
+		void increment(String journalName) {
+			if (StringUtils.isEmpty(journalName)) {
+				noJournalCount++;
+			} else {
+				Integer count = map.get(journalName);
+				if (count == null) {
+					map.put(journalName, 1);
+				} else {
+					map.put(journalName, 1 + count.intValue());
+				}
+			}
+
+			total++;
+		}
+
+		boolean isEmpty() {
+			return total == 0;
+		}
+
+		long getTotal() {
+			return total;
+		}
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorRequestHandler.java
index 1cd82b18..9f2390f3 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorRequestHandler.java
@@ -33,7 +33,7 @@ public class ModelConstructorRequestHandler implements
 		VisualizationRequestHandler {
 
     public static final AuthorizationRequest REQUIRED_ACTIONS = SimplePermission.REFRESH_VISUALIZATION_CACHE.ACTION;
-    
+
 	@Override
 	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log,
 			Dataset dataSource) throws MalformedQueryParametersException, JsonProcessingException {
@@ -82,7 +82,7 @@ public class ModelConstructorRequestHandler implements
 		return new TemplateResponseValues(standaloneTemplate, body);
 	}
 
-	private Map regenerateConstructedModels(VitroRequest vitroRequest, 
+	private Map regenerateConstructedModels(VitroRequest vitroRequest,
 															Dataset dataSource) throws JsonProcessingException {
 
 		VisualizationCaches.rebuildAll(vitroRequest.getRDFService());
@@ -90,17 +90,17 @@ public class ModelConstructorRequestHandler implements
 		List refreshedModels = new ArrayList();
 
 		Set currentModelIdentifiers = new HashSet(ConstructedModelTracker.getAllModels().keySet());
-		
+
 		for (String currentIdentifier : currentModelIdentifiers) {
 			try {
 
 				ConstructedModel parseModelIdentifier = ConstructedModelTracker
 																.parseModelIdentifier(currentIdentifier);
 
-				ConstructedModelTracker.removeModel(parseModelIdentifier.getUri(), 
+				ConstructedModelTracker.removeModel(parseModelIdentifier.getUri(),
 													parseModelIdentifier.getType());
 
-				ModelConstructorUtilities.getOrConstructModel(parseModelIdentifier.getUri(), 
+				ModelConstructorUtilities.getOrConstructModel(parseModelIdentifier.getUri(),
 															  parseModelIdentifier.getType(), vitroRequest.getRDFService());
 				refreshedModels.add(parseModelIdentifier);
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorUtilities.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorUtilities.java
index 760c3a22..2b48b1c4 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorUtilities.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/ModelConstructorUtilities.java
@@ -1,32 +1,32 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-package edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.jena.rdf.model.Model;
-
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-import edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor.factory.ModelFactoryInterface;
-
-@SuppressWarnings("deprecation,serial")
-public class ModelConstructorUtilities {
-
-	/**
-	 * @deprecated
-	 */
-	private static final Map modelTypeIdentifierToFactory = new HashMap() {{
-	}};
-
-	/**
-	 * @deprecated
-	 */
-	public static final Map modelTypeToHumanReadableName = new HashMap() {{
-	}};
-
-	public static Model getOrConstructModel(String uri, String modelType, RDFService rdfService)
-			throws MalformedQueryParametersException {
-		return modelTypeIdentifierToFactory.get(modelType).getOrCreateModel(uri, rdfService);
-	}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+package edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jena.rdf.model.Model;
+
+import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+import edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor.factory.ModelFactoryInterface;
+
+@SuppressWarnings("deprecation,serial")
+public class ModelConstructorUtilities {
+
+	/**
+	 * @deprecated
+	 */
+	private static final Map modelTypeIdentifierToFactory = new HashMap() {{
+	}};
+
+	/**
+	 * @deprecated
+	 */
+	public static final Map modelTypeToHumanReadableName = new HashMap() {{
+	}};
+
+	public static Model getOrConstructModel(String uri, String modelType, RDFService rdfService)
+			throws MalformedQueryParametersException {
+		return modelTypeIdentifierToFactory.get(modelType).getOrCreateModel(uri, rdfService);
+	}
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/PersonToGrantsModelConstructor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/PersonToGrantsModelConstructor.java
index 42300bd4..c97762d0 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/PersonToGrantsModelConstructor.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/PersonToGrantsModelConstructor.java
@@ -17,29 +17,29 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 import edu.cornell.mannlib.vitro.webapp.visualization.visutils.ModelConstructor;
 
 public class PersonToGrantsModelConstructor implements ModelConstructor {
-	
+
 	protected static final Syntax SYNTAX = Syntax.syntaxARQ;
-	
+
 	private RDFService rdfService;
-	
-	public static final String MODEL_TYPE = "PERSON_TO_GRANTS"; 
+
+	public static final String MODEL_TYPE = "PERSON_TO_GRANTS";
 	public static final String MODEL_TYPE_HUMAN_READABLE = "Grants for specific person via all roles";
-	
+
 	private String personURI;
-	
+
 	private Log log = LogFactory.getLog(PersonToGrantsModelConstructor.class.getName());
-	
+
 	private long before, after;
-	
+
 	public PersonToGrantsModelConstructor(String personURI, RDFService rdfService) {
 		this.personURI = personURI;
 		this.rdfService = rdfService;
 	}
-	
+
 private Set constructPersonGrantsQueryTemplate(String constructProperty, String roleType) {
-		
+
 		Set differentPerspectiveQueries = new HashSet();
-		
+
 		String justGrantsQuery = ""
 			+ " CONSTRUCT {  "
 			+ "     <" + personURI + "> vivosocnet:lastCachedAt ?now . "
@@ -84,7 +84,7 @@ private Set constructPersonGrantsQueryTemplate(String constructProperty,
 			+ "      "
 			+ "     LET(?now := now()) "
 			+ " } ";
-		
+
 		String justDateTimeOnRolesQuery = ""
 			+ " CONSTRUCT {  "
 			+ "     <" + personURI + "> vivosocnet:lastCachedAt ?now . "
@@ -110,18 +110,18 @@ private Set constructPersonGrantsQueryTemplate(String constructProperty,
 			+ "      "
 			+ "     LET(?now := now()) "
 			+ " } ";
-		
+
 		differentPerspectiveQueries.add(justGrantsQuery);
 		differentPerspectiveQueries.add(justDateTimeOnGrantsQuery);
 		differentPerspectiveQueries.add(justDateTimeOnRolesQuery);
-		
+
 		return differentPerspectiveQueries;
 	}
-	
+
 	private Set constructPersonToGrantsQuery() {
 
 		Set differentInvestigatorTypeQueries = new HashSet();
-		
+
 		Set investigatorRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsAnInvestigator", "InvestigatorRole");
 		Set piRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsPI", "PrincipalInvestigatorRole");
 		Set coPIRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsCoPI", "CoPrincipalInvestigatorRole");
@@ -129,16 +129,16 @@ private Set constructPersonGrantsQueryTemplate(String constructProperty,
 		differentInvestigatorTypeQueries.addAll(investigatorRoleQuery);
 		differentInvestigatorTypeQueries.addAll(piRoleQuery);
 		differentInvestigatorTypeQueries.addAll(coPIRoleQuery);
-		
+
 		return differentInvestigatorTypeQueries;
 	}
-	
+
 	private Model executeQuery(Set constructQueries) {
 		Model constructedModel = ModelFactory.createDefaultModel();
 
 		before = System.currentTimeMillis();
 		log.debug("CONSTRUCT query string : " + constructQueries);
-		
+
 		for (String currentQuery : constructQueries) {
 			try {
 				rdfService.sparqlConstructQuery(QueryConstants.getSparqlPrefixQuery() + currentQuery, constructedModel);
@@ -149,14 +149,14 @@ private Set constructPersonGrantsQueryTemplate(String constructProperty,
 			}
 
 		}
-		
+
 		after = System.currentTimeMillis();
 		log.debug("Time taken to execute the CONSTRUCT queries is in milliseconds: "
 				+ (after - before));
-		
+
 		return constructedModel;
-	}	
-	
+	}
+
 	public Model getConstructedModel() throws MalformedQueryParametersException {
 		return executeQuery(constructPersonToGrantsQuery());
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/factory/ModelFactoryInterface.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/factory/ModelFactoryInterface.java
index bb9f8adb..b205712d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/factory/ModelFactoryInterface.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/modelconstructor/factory/ModelFactoryInterface.java
@@ -7,6 +7,6 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
 import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
 
 public interface ModelFactoryInterface {
-	
+
 	public Model getOrCreateModel(String uri, RDFService rdfService) throws MalformedQueryParametersException;
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountQueryRunner.java
index cf5b012c..ffd76d75 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountQueryRunner.java
@@ -31,7 +31,7 @@ import java.util.Set;
 /**
  * This query runner is used to execute a sparql query that will fetch all the publications
  * defined by bibo:Document property for a particular individual.
- * 
+ *
  * @author cdtank
  */
 public class PersonGrantCountQueryRunner implements QueryRunner> {
@@ -107,7 +107,7 @@ public class PersonGrantCountQueryRunner implements QueryRunner> {
 							+ "} GROUP BY ?grant\n";
 
 		log.debug(sparqlQuery);
-		
+
 		return sparqlQuery;
 	}
 
@@ -127,7 +127,7 @@ public class PersonGrantCountQueryRunner implements QueryRunner> {
                 throw new MalformedQueryParametersException(
                 		"URI provided for an individual is malformed.");
             }
-        	
+
         } else {
         	throw new MalformedQueryParametersException("URL parameter is either null or empty.");
         }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java
index d2eda2e0..4e64ce4d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java
@@ -28,22 +28,22 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
 
 
 /**
- * 
+ *
  * This request handler is used to serve the content related to an individual's
  * grants over the years like,
  * 		1. Sparkline representing this
  * 		2. An entire page dedicated to the sparkline vis which will also have links to
  * download the data using which the sparkline was rendered & its tabular representation etc.
  * 		3. Downloadable CSV file containing number of grants over the years.
- * 		4. Downloadable PDf file containing the grant content, among other things. 
- * Currently this is disabled because the feature is half-baked. We plan to activate this in 
- * the next major release.  
- * 
+ * 		4. Downloadable PDf file containing the grant content, among other things.
+ * Currently this is disabled because the feature is half-baked. We plan to activate this in
+ * the next major release.
+ *
  * @author bkoniden
  * Deepak Konidena
  */
 public class PersonGrantCountRequestHandler implements VisualizationRequestHandler {
-	
+
 	@Override
 	public Map generateDataVisualization(
 			VitroRequest vitroRequest, Log log, Dataset dataset)
@@ -51,11 +51,11 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 
 		String personURI = vitroRequest
 				.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		
+
 		SubEntity person = new SubEntity(
 									personURI,
 									UtilityFunctions.getIndividualLabelFromDAO(vitroRequest, personURI));
-		
+
 		QueryRunner> queryManager = new PersonGrantCountQueryRunner(
 				personURI,
 				vitroRequest.getRDFService(),
@@ -69,18 +69,18 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 		 */
 		Map yearToGrantCount =
 				UtilityFunctions.getYearToActivityCount(authorGrants);
-	
+
     	return prepareDataResponse(person,
 				yearToGrantCount);
 
-	
+
 	}
-	
+
 	@Override
 	public ResponseValues generateVisualizationForShortURLRequests(
 			Map parameters, VitroRequest vitroRequest, Log log,
 			Dataset dataSource) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Person Grant Count Visualization does not provide " 
+		throw new UnsupportedOperationException("Person Grant Count Visualization does not provide "
 					+ "Short URL Response.");
 	}
 
@@ -93,7 +93,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 
 		String visMode = vitroRequest
 				.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY);
-		
+
 		String visContainer = vitroRequest
 				.getParameter(VisualizationFrameworkConstants.VIS_CONTAINER_KEY);
 
@@ -113,11 +113,11 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 
 
 		boolean shouldVIVOrenderVis = (yearToGrantCount.size() > 0);
-			
+
 			/*
 	    	 * Computations required to generate HTML for the sparkline & related context.
 	    	 * */
-	    	PersonGrantCountVisCodeGenerator visualizationCodeGenerator = 
+	    	PersonGrantCountVisCodeGenerator visualizationCodeGenerator =
 	    		new PersonGrantCountVisCodeGenerator(personURI,
 	    									   visMode,
 	    									   visContainer,
@@ -127,19 +127,19 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 
 	    	SparklineData sparklineData = visualizationCodeGenerator
 			.getValueObjectContainer();
-	    	
-	    	return prepareDynamicResponse(vitroRequest, 
-			   		  sparklineData, 
+
+	    	return prepareDynamicResponse(vitroRequest,
+			   		  sparklineData,
 			   		shouldVIVOrenderVis);
 
-		
+
 	}
-	
+
 	@Override
 	public ResponseValues generateStandardVisualization(
 			VitroRequest vitroRequest, Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
-		
+
 		String personURI = vitroRequest
 				.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
 
@@ -162,28 +162,28 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 		 */
 		Map yearToGrantCount =
 				UtilityFunctions.getYearToActivityCount(authorGrants);
-	
+
     	/*
     	 * Computations required to generate HTML for the sparkline & related context.
     	 * */
-    	PersonGrantCountVisCodeGenerator visualizationCodeGenerator = 
+    	PersonGrantCountVisCodeGenerator visualizationCodeGenerator =
     		new PersonGrantCountVisCodeGenerator(personURI,
     									   visMode,
     									   visContainer,
     									   yearToGrantCount,
     									   log);
-    	
+
     	SparklineData sparklineData = visualizationCodeGenerator
 											.getValueObjectContainer();
-    	
-			return prepareStandaloneResponse(vitroRequest, 
+
+			return prepareStandaloneResponse(vitroRequest,
     							  sparklineData);
 	}
-	
+
 	private String getGrantsOverTimeCSVContent(Map yearToGrantCount) {
-		
+
 		StringBuilder csvFileContent = new StringBuilder();
-		
+
 		csvFileContent.append("Year, Grants\n");
 
 		for (Entry currentEntry : yearToGrantCount.entrySet()) {
@@ -195,7 +195,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 
 		return csvFileContent.toString();
 	}
-	
+
 	/**
 	 * Provides response when csv file containing the grant count over the years
 	 * is requested.
@@ -205,23 +205,23 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 	private Map prepareDataResponse(
 						SubEntity investigator,
 						Map yearToGrantCount) {
-		
+
 		String piName = investigator.getIndividualLabel();
-		
-		String outputFileName = UtilityFunctions.slugify(piName) 
+
+		String outputFileName = UtilityFunctions.slugify(piName)
 										+ "_grants-per-year" + ".csv";
 
 		Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
 					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
 					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
 					getGrantsOverTimeCSVContent(yearToGrantCount));
 
 		return fileData;
 	}
-	
+
 	/**
 	 * Provides response when an entire page dedicated to grant sparkline is requested.
 	 * @param vreq Vitro Request
@@ -229,7 +229,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 	 */
 	private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq,
 			SparklineData valueObjectContainer) {
-        
+
         String standaloneTemplate = "personGrantCountStandaloneActivator.ftl";
 
         Map body = new HashMap();
@@ -237,11 +237,11 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
         body.put("sparklineVO", valueObjectContainer);
 
         return new TemplateResponseValues(standaloneTemplate, body);
-        
+
 	}
-	
+
 	/**
-	 * Provides response when the grant sparkline has to be rendered in already existing 
+	 * Provides response when the grant sparkline has to be rendered in already existing
 	 * page, e.g. profile page.
 	 * @param vreq Vitro Request
 	 * @param valueObjectContainer Sparkline data
@@ -249,7 +249,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
 	 */
 	private TemplateResponseValues prepareDynamicResponse(
 			VitroRequest vreq,
-			SparklineData valueObjectContainer, 
+			SparklineData valueObjectContainer,
 			boolean shouldVIVOrenderVis) {
 
         String dynamicTemplate = "personGrantCountDynamicActivator.ftl";
@@ -257,9 +257,9 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
         Map body = new HashMap();
         body.put("sparklineVO", valueObjectContainer);
         body.put("shouldVIVOrenderVis", shouldVIVOrenderVis);
-        
+
         return new TemplateResponseValues(dynamicTemplate, body);
-        
+
 	}
 
 	@Override
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java
index 95f16033..e6bee35b 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java
@@ -22,19 +22,19 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
 
 
 public class PersonGrantCountVisCodeGenerator {
-	
+
 	/*
 	 * There are 2 modes of sparkline that are available via this visualization.
 	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
 	 * 			which in this case are the grants over the years, from the last 10 years.
-	 * 
-	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks) 
+	 *
+	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks)
 	 * 			spanning the career of the person & last 10 years at the minimum, in case if
 	 * 			the person started his career in the last 10 yeras.
 	 * */
-	
+
 	private static final String DEFAULT_VIS_CONTAINER_DIV_ID = "grant_count_vis_container";
-	
+
 	private Map yearToGrantCount;
 
 	private Log log;
@@ -42,7 +42,7 @@ public class PersonGrantCountVisCodeGenerator {
 	private SparklineData sparklineParameterVO;
 
 	private String individualURI;
-	
+
 	public PersonGrantCountVisCodeGenerator(String individualURIParam,
 			String visMode, String visContainer, Map yearToGrantCount,
 			Log log) {
@@ -50,13 +50,13 @@ public class PersonGrantCountVisCodeGenerator {
 		this.individualURI = individualURIParam;
 
 		this.yearToGrantCount = yearToGrantCount;
-		
+
 		this.log = log;
-		
+
 		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
 
 	}
-	
+
 	/**
 	 * This method is used to setup parameters for the sparkline value object. These parameters
 	 * will be used in the template to construct the actual html/javascript code.
@@ -65,16 +65,16 @@ public class PersonGrantCountVisCodeGenerator {
 	 */
 	private SparklineData setupSparklineParameters(String visMode,
 			  							  String providedVisContainerID) {
-		
+
 		SparklineData sparklineData = new SparklineData();
 		sparklineData.setYearToActivityCount(yearToGrantCount);
-		
+
 		int numOfYearsToBeRendered = 0;
-		
+
 		/*
-		 * It was decided that to prevent downward curve that happens if there are no publications 
+		 * It was decided that to prevent downward curve that happens if there are no publications
 		 * in the current year seems a bit harsh, so we consider only publications from the last 10
-		 * complete years. 
+		 * complete years.
 		 * */
 		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
 		int shortSparkMinYear = currentYear
@@ -137,7 +137,7 @@ public class PersonGrantCountVisCodeGenerator {
 		 */
 		int renderedFullSparks = 0;
 
-		List yearToGrantCountDataTable = 
+		List yearToGrantCountDataTable =
 					new ArrayList();
 
 		for (int grantYear = minGrantYearConsidered; grantYear <= currentYear; grantYear++) {
@@ -211,12 +211,12 @@ public class PersonGrantCountVisCodeGenerator {
 		}
 
 		if (yearToGrantCount.size() > 0) {
-			
+
 			sparklineData.setFullTimelineNetworkLink(
 					UtilityFunctions.getCollaboratorshipNetworkLink(individualURI,
 						VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
 						VisualizationFrameworkConstants.COPI_VIS_MODE));
-			
+
 			sparklineData.setDownloadDataLink(
 					UtilityFunctions.getCSVDownloadURL(
 							individualURI,
@@ -225,7 +225,7 @@ public class PersonGrantCountVisCodeGenerator {
 		}
 		return sparklineData;
 	}
-	
+
 	public SparklineData getValueObjectContainer() {
 		return this.sparklineParameterVO;
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personlevel/PersonLevelRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personlevel/PersonLevelRequestHandler.java
index d9d39201..e2ae7a22 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personlevel/PersonLevelRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personlevel/PersonLevelRequestHandler.java
@@ -38,16 +38,16 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
  * 		2. Downloadable file having the co-author network in graphml format.
  * 		3. Downloadable file having the list of co-authors that the individual has
  * worked with & count of such co-authorships.
- * 
+ *
  * @author cdtank
  */
 public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 
     private static final String EGO_PUB_SPARKLINE_VIS_CONTAINER_ID = "ego_pub_sparkline";
-    private static final String UNIQUE_COAUTHORS_SPARKLINE_VIS_CONTAINER_ID = 
+    private static final String UNIQUE_COAUTHORS_SPARKLINE_VIS_CONTAINER_ID =
     									"unique_coauthors_sparkline";
     private static final String EGO_GRANT_SPARKLINE_VIS_CONTAINER_ID = "ego_grant_sparkline";
-    private static final String UNIQUE_COPIS_SPARKLINE_VIS_CONTAINER_ID = 
+    private static final String UNIQUE_COPIS_SPARKLINE_VIS_CONTAINER_ID =
     									"unique_copis_sparkline";
 
 	@Override
@@ -62,13 +62,13 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 			throws MalformedQueryParametersException {
 		throw new UnsupportedOperationException("Person Level does not provide Data Response.");
 	}
-    
-	
+
+
 	@Override
 	public ResponseValues generateStandardVisualization(
 			VitroRequest vitroRequest, Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
-		
+
         String egoURI = vitroRequest.getParameter(
         							VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
 
@@ -113,7 +113,7 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 	private ResponseValues generateStandardVisualizationForPersonLevelVis(
 			VitroRequest vitroRequest, Log log, Dataset dataset, String egoURI,
 			String visMode) throws MalformedQueryParametersException {
-		
+
 		if (VisualizationFrameworkConstants.COPI_VIS_MODE.equalsIgnoreCase(visMode)) {
 			CoPIGrantCountQueryRunner coPIQueryManager = new CoPIGrantCountQueryRunner(egoURI, vitroRequest, log);
 
@@ -125,43 +125,43 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
         	 * Create a map from the year to number of grants. Use the Grant's
         	 * parsedGrantYear to populate the data.
         	 * */
-        	Map yearToGrantCount = 
+        	Map yearToGrantCount =
     			UtilityFunctions.getYearToActivityCount(grantsToURI.values());
-        	
-	    	
-	    	PersonGrantCountVisCodeGenerator personGrantCountVisCodeGenerator = 
+
+
+	    	PersonGrantCountVisCodeGenerator personGrantCountVisCodeGenerator =
 	    		new PersonGrantCountVisCodeGenerator(
 	    			egoURI,
 	    			VisualizationFrameworkConstants.FULL_SPARKLINE_VIS_MODE,
 	    			EGO_GRANT_SPARKLINE_VIS_CONTAINER_ID,
 	    			yearToGrantCount,
 	    			log);
-	    	
+
 	    	SparklineData grantSparklineVO = personGrantCountVisCodeGenerator.getValueObjectContainer();
-	    	
-	    	
+
+
 	    	/*
 	    	 * Co-PI's over time sparkline
 	    	 */
-	    	CoPIVisCodeGenerator uniqueCopisVisCodeGenerator = 
+	    	CoPIVisCodeGenerator uniqueCopisVisCodeGenerator =
 	    		new CoPIVisCodeGenerator(
 	    			egoURI,
 	    			VisualizationFrameworkConstants.FULL_SPARKLINE_VIS_MODE,
 	    			UNIQUE_COPIS_SPARKLINE_VIS_CONTAINER_ID,
 	    			UtilityFunctions.getActivityYearToCollaborators(coPIData),
 	    			log);
-	    	
+
 	    	SparklineData uniqueCopisSparklineVO = uniqueCopisVisCodeGenerator.getValueObjectContainer();
 
 	    	return prepareCoPIStandaloneResponse(
-					egoURI, 
+					egoURI,
 					grantSparklineVO,
 					uniqueCopisSparklineVO,
 					coPIData,
 	    			vitroRequest);
-	    	
+
         } else {
-        	
+
         	CoAuthorshipQueryRunner coAuthorshipQueryManager =
         			new CoAuthorshipQueryRunner(egoURI, vitroRequest, log);
 
@@ -178,30 +178,30 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 	    	/*
 	    	 * Computations required to generate HTML for the sparklines & related context.
 	    	 * */
-	    	PersonPublicationCountVisCodeGenerator personPubCountVisCodeGenerator = 
+	    	PersonPublicationCountVisCodeGenerator personPubCountVisCodeGenerator =
 	    		new PersonPublicationCountVisCodeGenerator(
 	    			egoURI,
 	    			VisualizationFrameworkConstants.FULL_SPARKLINE_VIS_MODE,
 	    			EGO_PUB_SPARKLINE_VIS_CONTAINER_ID,
 	    			yearToPublicationCount,
-	    			log);	  
-	    	
+	    			log);
+
 	    	SparklineData publicationSparklineVO = personPubCountVisCodeGenerator
 	    														.getValueObjectContainer();
-	    	
-            CoAuthorshipVisCodeGenerator uniqueCoauthorsVisCodeGenerator = 
+
+            CoAuthorshipVisCodeGenerator uniqueCoauthorsVisCodeGenerator =
 	    		new CoAuthorshipVisCodeGenerator(
 	    			egoURI,
 	    			VisualizationFrameworkConstants.FULL_SPARKLINE_VIS_MODE,
 	    			UNIQUE_COAUTHORS_SPARKLINE_VIS_CONTAINER_ID,
 	    			UtilityFunctions.getActivityYearToCollaborators(coAuthorshipData),
 	    			log);
-	    	
+
 	    	SparklineData uniqueCoauthorsSparklineVO = uniqueCoauthorsVisCodeGenerator
 	    															.getValueObjectContainer();
-	    	
+
 	    	return prepareCoAuthorStandaloneResponse(
-					egoURI, 
+					egoURI,
 	    			publicationSparklineVO,
 	    			uniqueCoauthorsSparklineVO,
 	    			coAuthorshipData,
@@ -209,36 +209,36 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 
         }
 	}
-	
+
 	private TemplateResponseValues prepareCoAuthorStandaloneResponse(
-					String egoURI, 
-					SparklineData egoPubSparklineVO, 
-					SparklineData uniqueCoauthorsSparklineVO, 
-					CollaborationData coAuthorshipVO, 
+					String egoURI,
+					SparklineData egoPubSparklineVO,
+					SparklineData uniqueCoauthorsSparklineVO,
+					CollaborationData coAuthorshipVO,
 					VitroRequest vitroRequest) {
-		
+
 		Map body = new HashMap();
-		
+
         String	standaloneTemplate = "coAuthorPersonLevelD3.ftl";
 		body.put("coAuthorshipData", new CollaborationDataViewHelper(coAuthorshipVO));
 
 		body.put("egoURIParam", egoURI);
-        
+
         body.put("egoLocalName", UtilityFunctions.getIndividualLocalName(egoURI, vitroRequest));
-        
+
         String title = "";
-        
-        if (coAuthorshipVO.getCollaborators() != null 
+
+        if (coAuthorshipVO.getCollaborators() != null
         			&& coAuthorshipVO.getCollaborators().size() > 0) {
         	body.put("numOfAuthors", coAuthorshipVO.getCollaborators().size());
         	title = coAuthorshipVO.getEgoCollaborator().getCollaboratorName() + " - ";
 		}
-		
-		if (coAuthorshipVO.getCollaborations() != null 
+
+		if (coAuthorshipVO.getCollaborations() != null
 					&& coAuthorshipVO.getCollaborations().size() > 0) {
 			body.put("numOfCoAuthorShips", coAuthorshipVO.getCollaborations().size());
 		}
-		
+
 		body.put("egoPubSparklineVO", egoPubSparklineVO);
 		body.put("uniqueCoauthorsSparklineVO", uniqueCoauthorsSparklineVO);
 
@@ -249,43 +249,43 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
 		body.put("title",  title + "Person Level Visualization");
 
 		return new TemplateResponseValues(standaloneTemplate, body);
-		
+
 	}
-	
+
 	private TemplateResponseValues prepareCoPIStandaloneResponse(
-					String egoURI, 
-					SparklineData egoGrantSparklineVO, 
-					SparklineData uniqueCopisSparklineVO, 
-					CollaborationData coPIVO, 
+					String egoURI,
+					SparklineData egoGrantSparklineVO,
+					SparklineData uniqueCopisSparklineVO,
+					CollaborationData coPIVO,
 					VitroRequest vitroRequest) {
-		
+
 		Map body = new HashMap();
-        
+
         body.put("egoURIParam", egoURI);
-        
+
         body.put("egoLocalName", UtilityFunctions.getIndividualLocalName(egoURI, vitroRequest));
-        
+
         String title = "";
-        
+
         if (coPIVO.getCollaborators() != null && coPIVO.getCollaborators().size() > 0) {
         	body.put("numOfInvestigators", coPIVO.getCollaborators().size());
         	title = coPIVO.getEgoCollaborator().getCollaboratorName() + " - ";
 		}
-		
+
 		if (coPIVO.getCollaborations() != null && coPIVO.getCollaborations().size() > 0) {
 			body.put("numOfCoInvestigations", coPIVO.getCollaborations().size());
 		}
-		
+
         String	standaloneTemplate = "coPIPersonLevelD3.ftl";
 		body.put("coInvestigatorData", new CollaborationDataViewHelper(coPIVO));
 
 		body.put("egoGrantSparklineVO", egoGrantSparklineVO);
-		body.put("uniqueCoInvestigatorsSparklineVO", uniqueCopisSparklineVO);        	
+		body.put("uniqueCoInvestigatorsSparklineVO", uniqueCopisSparklineVO);
 
 		body.put("title",  title + "Person Level Visualization");
 
 		return new TemplateResponseValues(standaloneTemplate, body);
-		
+
 	}
 
 	@Override
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java
index e0409cd2..984ec6aa 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountQueryRunner.java
@@ -37,7 +37,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.QueryRunner;
 /**
  * This query runner is used to execute a sparql query that will fetch all the publications
  * defined by bibo:Document property for a particular individual.
- * 
+ *
  * @author cdtank
  */
 public class PersonPublicationCountQueryRunner implements QueryRunner> {
@@ -111,7 +111,7 @@ public class PersonPublicationCountQueryRunner implements QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
-															personURI,
-															vitroRequest.getRDFService(),
-															log);
-
-		Set authorDocuments = queryManager.getQueryResult();
-
-		/*
-		 * Create a map from the year to number of publications. Use the
-		 * BiboDocument's parsedPublicationYear to populate the data.
-		 */
-		Map yearToPublicationCount = 
-				UtilityFunctions.getYearToActivityCount(authorDocuments);
-
-		boolean shouldVIVOrenderVis = false;
-
-		if (yearToPublicationCount.containsKey("Unknown")) {
-			if (yearToPublicationCount.size() > 1) {
-				shouldVIVOrenderVis = true;
-			}
-		} else {
-			if (yearToPublicationCount.size() > 0) {
-				shouldVIVOrenderVis = true;
-			}
-		}
-
-		/*
-		 * Computations required to generate HTML for the sparkline & related
-		 * context.
-		 */
-		PersonPublicationCountVisCodeGenerator visualizationCodeGenerator = 
-				new PersonPublicationCountVisCodeGenerator(
-						personURI, 
-						visMode, 
-						visContainer, 
-						yearToPublicationCount,
-						log);
-
-		SparklineData sparklineData = visualizationCodeGenerator.getValueObjectContainer();
-
-		return prepareDynamicResponse(vitroRequest, sparklineData,
-				shouldVIVOrenderVis, requestingTemplate);
-
-	}
-	
-	@Override
-	public ResponseValues generateVisualizationForShortURLRequests(
-			Map parameters, VitroRequest vitroRequest, Log log,
-			Dataset dataSource) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Person Publication Count Visualization does not provide " 
-					+ "Short URL Response.");
-	}
-
-	@Override
-	public Map generateDataVisualization(VitroRequest vitroRequest, Log log,
-			Dataset dataset) throws MalformedQueryParametersException {
-
-		String personURI = vitroRequest
-		.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-
-		QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
-																personURI,
-																vitroRequest.getRDFService(),
-																log);
-
-		Set authorDocuments = queryManager.getQueryResult();
-
-		/*
-		 * Create a map from the year to number of publications. Use the
-		 * BiboDocument's parsedPublicationYear to populate the data.
-		 */
-		Map yearToPublicationCount = 
-				UtilityFunctions.getYearToActivityCount(authorDocuments);
-
-		String authorName = ((PersonPublicationCountQueryRunner) queryManager).getAuthorName();
-
-
-		return prepareDataResponse(authorName,
-								   yearToPublicationCount);
-
-	}
-
-	@Override
-	public ResponseValues generateStandardVisualization(
-			VitroRequest vitroRequest, Log log, Dataset dataset)
-		throws MalformedQueryParametersException {
-
-		String personURI = vitroRequest.getParameter(
-									VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-
-		String visMode = vitroRequest.getParameter(
-									VisualizationFrameworkConstants.VIS_MODE_KEY);
-
-		String visContainer = vitroRequest.getParameter(
-									VisualizationFrameworkConstants.VIS_CONTAINER_KEY);
-
-		QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
-																personURI,
-																vitroRequest.getRDFService(),
-																log);
-
-		Set authorDocuments = queryManager.getQueryResult();
-
-		/*
-		 * Create a map from the year to number of publications. Use the
-		 * BiboDocument's parsedPublicationYear to populate the data.
-		 */
-		Map yearToPublicationCount = 
-				UtilityFunctions.getYearToActivityCount(authorDocuments);
-
-		/*
-		 * Computations required to generate HTML for the sparkline & related
-		 * context.
-		 */
-		PersonPublicationCountVisCodeGenerator visualizationCodeGenerator = 
-				new PersonPublicationCountVisCodeGenerator(
-						personURI, 
-						visMode, 
-						visContainer, 
-						yearToPublicationCount,
-						log);
-
-		SparklineData sparklineData = 
-				visualizationCodeGenerator.getValueObjectContainer();
-
-		return prepareStandaloneResponse(vitroRequest, sparklineData);
-	}
-
-	private String getPublicationsOverTimeCSVContent(
-			Map yearToPublicationCount) {
-
-		StringBuilder csvFileContent = new StringBuilder();
-
-		csvFileContent.append("Year, Publications\n");
-
-		for (Entry currentEntry : yearToPublicationCount
-				.entrySet()) {
-			csvFileContent.append(StringEscapeUtils.escapeCsv(currentEntry
-					.getKey()));
-			csvFileContent.append(",");
-			csvFileContent.append(currentEntry.getValue());
-			csvFileContent.append("\n");
-		}
-
-		return csvFileContent.toString();
-	}
-
-	/**
-	 * Provides response when csv file containing the publication count over the
-	 * years is requested.
-	 * 
-	 * @param authorName Name of author
-	 * @param yearToPublicationCount Year / publication counts
-	 */
-	private Map prepareDataResponse(String authorName,
-			Map yearToPublicationCount) {
-
-		/*
-		 * To make sure that null/empty records for author names do not cause
-		 * any mischief.
-		 */
-		if (StringUtils.isBlank(authorName)) {
-			authorName = "no-author";
-		}
-
-		String outputFileName = UtilityFunctions.slugify(authorName)
-									+ "_publications-per-year" + ".csv";
-
-		Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, 
-					 outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
-					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
-					 getPublicationsOverTimeCSVContent(yearToPublicationCount));
-
-		return fileData;
-	}
-
-	/**
-	 * Provides response when an entire page dedicated to publication sparkline
-	 * is requested.
-	 * 
-	 * @param vreq Vitro Request
-	 * @param valueObjectContainer Sparkline Data
-	 */
-	private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq,
-			SparklineData valueObjectContainer) {
-
-		String standaloneTemplate = "personPublicationCountStandaloneActivator.ftl";
-
-		Map body = new HashMap();
-		body.put("title", "Individual Publication Count visualization");
-		body.put("sparklineVO", valueObjectContainer);
-
-		return new TemplateResponseValues(standaloneTemplate, body);
-
-	}
-
-	/**
-	 * Provides response when the publication sparkline has to be rendered in
-	 * already existing page, e.g. profile page.
-	 * 
-	 * @param vreq Vitro Request
-	 * @param valueObjectContainer Sparkline data
-	 * @param shouldVIVOrenderVis Flag to render visualization
-	 * @param requestingTemplate Requesting template name
-	 */
-	private TemplateResponseValues prepareDynamicResponse(VitroRequest vreq,
-			SparklineData valueObjectContainer, boolean shouldVIVOrenderVis, String requestingTemplate) {
-
-		String dynamicTemplate = "personPublicationCountDynamicActivator.ftl";
-
-		Map body = new HashMap();
-		body.put("sparklineVO", valueObjectContainer);
-		body.put("shouldVIVOrenderVis", shouldVIVOrenderVis);
-		body.put("requestingTemplate", requestingTemplate); /* tlw72 -- Added in 1.6 for multi-view support.*/
-
-		return new TemplateResponseValues(dynamicTemplate, body);
-
-	}
-
-	@Override
-	public AuthorizationRequest getRequiredPrivileges() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+
+import org.apache.jena.query.Dataset;
+
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Activity;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.QueryRunner;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
+
+/**
+ *
+ * This request handler is used to serve the content related to an individual's
+ * publications over the years like, 1. Sprakline representing this 2. An entire
+ * page dedicated to the sparkline vis which will also have links to download
+ * the data using which the sparkline was rendered & its tabular representation
+ * etc. 3. Downloadable CSV file containing number of publications over the
+ * years. 4. Downloadable PDf file containing the publications content, among
+ * other things. Currently this is disabled because the feature is half-baked.
+ * We plan to activate this in the next major release.
+ *
+ * @author cdtank
+ */
+public class PersonPublicationCountRequestHandler implements
+VisualizationRequestHandler {
+
+	@Override
+	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log,
+			Dataset dataset) throws MalformedQueryParametersException {
+
+		String personURI = vitroRequest
+								.getParameter(
+										VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		String visMode = vitroRequest
+								.getParameter(
+										VisualizationFrameworkConstants.VIS_MODE_KEY);
+
+		String visContainer = vitroRequest
+								.getParameter(
+										VisualizationFrameworkConstants.VIS_CONTAINER_KEY);
+
+        /* tlw72 -- Added in 1.6 for multi-view support. There are now two different "sparkline" templates     */
+        /* and the one that gets loaded depends on which foaf person template is being used by the app. The    */
+        /* personPublicationCountDynamicActivator.ftl template needs to know which is the requesting template. */
+        String requestingTemplate = vitroRequest
+            					.getParameter(
+										VisualizationFrameworkConstants.REQUESTING_TEMPLATE_KEY);
+
+		QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
+															personURI,
+															vitroRequest.getRDFService(),
+															log);
+
+		Set authorDocuments = queryManager.getQueryResult();
+
+		/*
+		 * Create a map from the year to number of publications. Use the
+		 * BiboDocument's parsedPublicationYear to populate the data.
+		 */
+		Map yearToPublicationCount =
+				UtilityFunctions.getYearToActivityCount(authorDocuments);
+
+		boolean shouldVIVOrenderVis = false;
+
+		if (yearToPublicationCount.containsKey("Unknown")) {
+			if (yearToPublicationCount.size() > 1) {
+				shouldVIVOrenderVis = true;
+			}
+		} else {
+			if (yearToPublicationCount.size() > 0) {
+				shouldVIVOrenderVis = true;
+			}
+		}
+
+		/*
+		 * Computations required to generate HTML for the sparkline & related
+		 * context.
+		 */
+		PersonPublicationCountVisCodeGenerator visualizationCodeGenerator =
+				new PersonPublicationCountVisCodeGenerator(
+						personURI,
+						visMode,
+						visContainer,
+						yearToPublicationCount,
+						log);
+
+		SparklineData sparklineData = visualizationCodeGenerator.getValueObjectContainer();
+
+		return prepareDynamicResponse(vitroRequest, sparklineData,
+				shouldVIVOrenderVis, requestingTemplate);
+
+	}
+
+	@Override
+	public ResponseValues generateVisualizationForShortURLRequests(
+			Map parameters, VitroRequest vitroRequest, Log log,
+			Dataset dataSource) throws MalformedQueryParametersException {
+		throw new UnsupportedOperationException("Person Publication Count Visualization does not provide "
+					+ "Short URL Response.");
+	}
+
+	@Override
+	public Map generateDataVisualization(VitroRequest vitroRequest, Log log,
+			Dataset dataset) throws MalformedQueryParametersException {
+
+		String personURI = vitroRequest
+		.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
+																personURI,
+																vitroRequest.getRDFService(),
+																log);
+
+		Set authorDocuments = queryManager.getQueryResult();
+
+		/*
+		 * Create a map from the year to number of publications. Use the
+		 * BiboDocument's parsedPublicationYear to populate the data.
+		 */
+		Map yearToPublicationCount =
+				UtilityFunctions.getYearToActivityCount(authorDocuments);
+
+		String authorName = ((PersonPublicationCountQueryRunner) queryManager).getAuthorName();
+
+
+		return prepareDataResponse(authorName,
+								   yearToPublicationCount);
+
+	}
+
+	@Override
+	public ResponseValues generateStandardVisualization(
+			VitroRequest vitroRequest, Log log, Dataset dataset)
+		throws MalformedQueryParametersException {
+
+		String personURI = vitroRequest.getParameter(
+									VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		String visMode = vitroRequest.getParameter(
+									VisualizationFrameworkConstants.VIS_MODE_KEY);
+
+		String visContainer = vitroRequest.getParameter(
+									VisualizationFrameworkConstants.VIS_CONTAINER_KEY);
+
+		QueryRunner> queryManager = new PersonPublicationCountQueryRunner(
+																personURI,
+																vitroRequest.getRDFService(),
+																log);
+
+		Set authorDocuments = queryManager.getQueryResult();
+
+		/*
+		 * Create a map from the year to number of publications. Use the
+		 * BiboDocument's parsedPublicationYear to populate the data.
+		 */
+		Map yearToPublicationCount =
+				UtilityFunctions.getYearToActivityCount(authorDocuments);
+
+		/*
+		 * Computations required to generate HTML for the sparkline & related
+		 * context.
+		 */
+		PersonPublicationCountVisCodeGenerator visualizationCodeGenerator =
+				new PersonPublicationCountVisCodeGenerator(
+						personURI,
+						visMode,
+						visContainer,
+						yearToPublicationCount,
+						log);
+
+		SparklineData sparklineData =
+				visualizationCodeGenerator.getValueObjectContainer();
+
+		return prepareStandaloneResponse(vitroRequest, sparklineData);
+	}
+
+	private String getPublicationsOverTimeCSVContent(
+			Map yearToPublicationCount) {
+
+		StringBuilder csvFileContent = new StringBuilder();
+
+		csvFileContent.append("Year, Publications\n");
+
+		for (Entry currentEntry : yearToPublicationCount
+				.entrySet()) {
+			csvFileContent.append(StringEscapeUtils.escapeCsv(currentEntry
+					.getKey()));
+			csvFileContent.append(",");
+			csvFileContent.append(currentEntry.getValue());
+			csvFileContent.append("\n");
+		}
+
+		return csvFileContent.toString();
+	}
+
+	/**
+	 * Provides response when csv file containing the publication count over the
+	 * years is requested.
+	 *
+	 * @param authorName Name of author
+	 * @param yearToPublicationCount Year / publication counts
+	 */
+	private Map prepareDataResponse(String authorName,
+			Map yearToPublicationCount) {
+
+		/*
+		 * To make sure that null/empty records for author names do not cause
+		 * any mischief.
+		 */
+		if (StringUtils.isBlank(authorName)) {
+			authorName = "no-author";
+		}
+
+		String outputFileName = UtilityFunctions.slugify(authorName)
+									+ "_publications-per-year" + ".csv";
+
+		Map fileData = new HashMap();
+		fileData.put(DataVisualizationController.FILE_NAME_KEY,
+					 outputFileName);
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
+					 "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
+					 getPublicationsOverTimeCSVContent(yearToPublicationCount));
+
+		return fileData;
+	}
+
+	/**
+	 * Provides response when an entire page dedicated to publication sparkline
+	 * is requested.
+	 *
+	 * @param vreq Vitro Request
+	 * @param valueObjectContainer Sparkline Data
+	 */
+	private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq,
+			SparklineData valueObjectContainer) {
+
+		String standaloneTemplate = "personPublicationCountStandaloneActivator.ftl";
+
+		Map body = new HashMap();
+		body.put("title", "Individual Publication Count visualization");
+		body.put("sparklineVO", valueObjectContainer);
+
+		return new TemplateResponseValues(standaloneTemplate, body);
+
+	}
+
+	/**
+	 * Provides response when the publication sparkline has to be rendered in
+	 * already existing page, e.g. profile page.
+	 *
+	 * @param vreq Vitro Request
+	 * @param valueObjectContainer Sparkline data
+	 * @param shouldVIVOrenderVis Flag to render visualization
+	 * @param requestingTemplate Requesting template name
+	 */
+	private TemplateResponseValues prepareDynamicResponse(VitroRequest vreq,
+			SparklineData valueObjectContainer, boolean shouldVIVOrenderVis, String requestingTemplate) {
+
+		String dynamicTemplate = "personPublicationCountDynamicActivator.ftl";
+
+		Map body = new HashMap();
+		body.put("sparklineVO", valueObjectContainer);
+		body.put("shouldVIVOrenderVis", shouldVIVOrenderVis);
+		body.put("requestingTemplate", requestingTemplate); /* tlw72 -- Added in 1.6 for multi-view support.*/
+
+		return new TemplateResponseValues(dynamicTemplate, body);
+
+	}
+
+	@Override
+	public AuthorizationRequest getRequiredPrivileges() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java
index 435ae0ae..fd210585 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java
@@ -1,233 +1,233 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.YearToEntityCountDataElement;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-
-
-public class PersonPublicationCountVisCodeGenerator {
-
-	/*
-	 * There are 2 modes of sparkline that are available via this visualization.
-	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
-	 * 			which in this case are the publications over the years, from the last 10 years.
-	 * 
-	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks) 
-	 * 			spanning the career of the person & last 10 years at the minimum, in case if
-	 * 			the person started his career in the last 10 yeras.
-	 * */
-
-	private static final String DEFAULT_VIS_CONTAINER_DIV_ID = "pub_count_vis_container";
-	
-	private Map yearToPublicationCount;
-
-	private Log log;
-
-	private String individualURI;
-	
-	private SparklineData sparklineParameterVO;
-
-	public PersonPublicationCountVisCodeGenerator(String individualURIParam, 
-									  String visMode, 
-									  String visContainer, 
-									  Map yearToPublicationCount, 
-									  Log log) {
-		
-		this.individualURI = individualURIParam;
-		
-		this.yearToPublicationCount = yearToPublicationCount;
-
-		this.log = log;
-		
-		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
-		
-	}
-	
-	/**
-	 * This method is used to setup parameters for the sparkline value object. These parameters
-	 * will be used in the template to construct the actual html/javascript code.
-	 * @param visMode Visualization mode
-	 * @param providedVisContainerID container id
-	 */
-	private SparklineData setupSparklineParameters(String visMode,
-			  							  String providedVisContainerID) {
-		
-		SparklineData sparklineData = new SparklineData();
-		sparklineData.setYearToActivityCount(yearToPublicationCount);
-		
-
-		int numOfYearsToBeRendered = 0;
-		
-		/*
-		 * It was decided that to prevent downward curve that happens if there are no publications 
-		 * in the current year seems a bit harsh, so we consider only publications from the last 10
-		 * complete years. 
-		 * */
-		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
-		int shortSparkMinYear = currentYear 
-									- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE
-									+ 1;
-		
-    	/*
-    	 * This is required because when deciding the range of years over which the vis
-    	 * was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
-    	 * */
-		Set publishedYears = new HashSet(yearToPublicationCount.keySet());
-    	publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
-		
-		/*
-		 * We are setting the default value of minPublishedYear to be 10 years before 
-		 * the current year (which is suitably represented by the shortSparkMinYear),
-		 * this in case we run into invalid set of published years.
-		 * */
-		int minPublishedYear = shortSparkMinYear;
-		
-		String visContainerID = null;
-		
-		if (yearToPublicationCount.size() > 0) {
-			try {
-				minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
-			} catch (NoSuchElementException | NumberFormatException e1) {
-				log.debug("vis: " + e1.getMessage() + " error occurred for " 
-								+ yearToPublicationCount.toString());
-			}
-        }
-		
-		int minPubYearConsidered = 0;
-		
-		/*
-		 * There might be a case that the author has made his first publication within the 
-		 * last 10 years but we want to make sure that the sparkline is representative of 
-		 * at least the last 10 years, so we will set the minPubYearConsidered to 
-		 * "currentYear - 10" which is also given by "shortSparkMinYear".
-		 * */
-		if (minPublishedYear > shortSparkMinYear) {
-			minPubYearConsidered = shortSparkMinYear;
-		} else {
-			minPubYearConsidered = minPublishedYear;
-		}
-		
-		numOfYearsToBeRendered = currentYear - minPubYearConsidered + 1;
-		
-		sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
-		
-		int publicationCounter = 0;
-		
-		/*
-		 * For the purpose of this visualization I have come up with a term "Sparks" which 
-		 * essentially means data points. 
-		 * Sparks that will be rendered in full mode will always be the one's which have any year
-		 * associated with it. Hence.
-		 * */
-		int renderedFullSparks = 0;
-
-		List yearToPublicationCountDataTable = 
-				new ArrayList();
-		
-		for (int publicationYear = minPubYearConsidered; 
-					publicationYear <= currentYear; 
-					publicationYear++) {
-
-				String stringPublishedYear = String.valueOf(publicationYear);
-				Integer currentPublications = yearToPublicationCount.get(stringPublishedYear);
-
-				if (currentPublications == null) {
-					currentPublications = 0;
-				}
-
-				yearToPublicationCountDataTable.add(new YearToEntityCountDataElement(
-															publicationCounter, 
-															stringPublishedYear, 
-															currentPublications));
-				
-				/*
-				 * Sparks that will be rendered will always be the one's which has 
-				 * any year associated with it. Hence.
-				 * */
-				renderedFullSparks += currentPublications;
-				publicationCounter++;
-		}
-		
-		sparklineData.setYearToEntityCountDataTable(yearToPublicationCountDataTable);
-		sparklineData.setRenderedSparks(renderedFullSparks);
-
-		/*
-		 * Total publications will also consider publications that have no year associated with
-		 * it. Hence.
-		 * */
-		Integer unknownYearPublications = 0;
-		if (yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
-			unknownYearPublications = yearToPublicationCount
-											.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
-		}
-		
-		sparklineData.setUnknownYearPublications(unknownYearPublications);
-
-		if (providedVisContainerID != null) {
-			visContainerID = providedVisContainerID;
-		} else {
-			visContainerID = DEFAULT_VIS_CONTAINER_DIV_ID;
-		}
-		
-		sparklineData.setVisContainerDivID(visContainerID);
-		
-		/*
-		 * By default these represents the range of the rendered sparks. Only in case of
-		 * "short" sparkline mode we will set the Earliest RenderedPublication year to
-		 * "currentYear - 10". 
-		 * */
-		sparklineData.setEarliestYearConsidered(minPubYearConsidered);
-		sparklineData.setEarliestRenderedPublicationYear(minPublishedYear);
-		sparklineData.setLatestRenderedPublicationYear(currentYear);
-		
-		if (yearToPublicationCount.size() > 0) {
-			
-			sparklineData.setFullTimelineNetworkLink(
-					UtilityFunctions.getCollaboratorshipNetworkLink(
-						individualURI,
-						VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
-						VisualizationFrameworkConstants.COAUTHOR_VIS_MODE));
-			
-			sparklineData.setDownloadDataLink(
-					UtilityFunctions.getCSVDownloadURL(
-									individualURI, 
-									VisualizationFrameworkConstants.PERSON_PUBLICATION_COUNT_VIS,
-									""));
-		} 
-		
-		/*
-		 * The Full Sparkline will be rendered by default. Only if the url has specific mention of
-		 * SHORT_SPARKLINE_MODE_URL_HANDLE then we render the short sparkline and not otherwise.
-		 * */
-		if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) {
-			
-			sparklineData.setEarliestRenderedPublicationYear(shortSparkMinYear);
-			sparklineData.setShortVisMode(true);
-			
-		} else {
-			sparklineData.setShortVisMode(false);
-		}
-		
-		return sparklineData; 
-	}
-
-	public SparklineData getValueObjectContainer() {
-		return this.sparklineParameterVO;
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineData;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.YearToEntityCountDataElement;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+
+
+public class PersonPublicationCountVisCodeGenerator {
+
+	/*
+	 * There are 2 modes of sparkline that are available via this visualization.
+	 * 		1. Short Sparkline - This sparkline will render all the data points (or sparks),
+	 * 			which in this case are the publications over the years, from the last 10 years.
+	 *
+	 * 		2. Full Sparkline - This sparkline will render all the data points (or sparks)
+	 * 			spanning the career of the person & last 10 years at the minimum, in case if
+	 * 			the person started his career in the last 10 yeras.
+	 * */
+
+	private static final String DEFAULT_VIS_CONTAINER_DIV_ID = "pub_count_vis_container";
+
+	private Map yearToPublicationCount;
+
+	private Log log;
+
+	private String individualURI;
+
+	private SparklineData sparklineParameterVO;
+
+	public PersonPublicationCountVisCodeGenerator(String individualURIParam,
+									  String visMode,
+									  String visContainer,
+									  Map yearToPublicationCount,
+									  Log log) {
+
+		this.individualURI = individualURIParam;
+
+		this.yearToPublicationCount = yearToPublicationCount;
+
+		this.log = log;
+
+		this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer);
+
+	}
+
+	/**
+	 * This method is used to setup parameters for the sparkline value object. These parameters
+	 * will be used in the template to construct the actual html/javascript code.
+	 * @param visMode Visualization mode
+	 * @param providedVisContainerID container id
+	 */
+	private SparklineData setupSparklineParameters(String visMode,
+			  							  String providedVisContainerID) {
+
+		SparklineData sparklineData = new SparklineData();
+		sparklineData.setYearToActivityCount(yearToPublicationCount);
+
+
+		int numOfYearsToBeRendered = 0;
+
+		/*
+		 * It was decided that to prevent downward curve that happens if there are no publications
+		 * in the current year seems a bit harsh, so we consider only publications from the last 10
+		 * complete years.
+		 * */
+		int currentYear = Calendar.getInstance().get(Calendar.YEAR) - 1;
+		int shortSparkMinYear = currentYear
+									- VisConstants.MINIMUM_YEARS_CONSIDERED_FOR_SPARKLINE
+									+ 1;
+
+    	/*
+    	 * This is required because when deciding the range of years over which the vis
+    	 * was rendered we dont want to be influenced by the "DEFAULT_PUBLICATION_YEAR".
+    	 * */
+		Set publishedYears = new HashSet(yearToPublicationCount.keySet());
+    	publishedYears.remove(VOConstants.DEFAULT_PUBLICATION_YEAR);
+
+		/*
+		 * We are setting the default value of minPublishedYear to be 10 years before
+		 * the current year (which is suitably represented by the shortSparkMinYear),
+		 * this in case we run into invalid set of published years.
+		 * */
+		int minPublishedYear = shortSparkMinYear;
+
+		String visContainerID = null;
+
+		if (yearToPublicationCount.size() > 0) {
+			try {
+				minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
+			} catch (NoSuchElementException | NumberFormatException e1) {
+				log.debug("vis: " + e1.getMessage() + " error occurred for "
+								+ yearToPublicationCount.toString());
+			}
+        }
+
+		int minPubYearConsidered = 0;
+
+		/*
+		 * There might be a case that the author has made his first publication within the
+		 * last 10 years but we want to make sure that the sparkline is representative of
+		 * at least the last 10 years, so we will set the minPubYearConsidered to
+		 * "currentYear - 10" which is also given by "shortSparkMinYear".
+		 * */
+		if (minPublishedYear > shortSparkMinYear) {
+			minPubYearConsidered = shortSparkMinYear;
+		} else {
+			minPubYearConsidered = minPublishedYear;
+		}
+
+		numOfYearsToBeRendered = currentYear - minPubYearConsidered + 1;
+
+		sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
+
+		int publicationCounter = 0;
+
+		/*
+		 * For the purpose of this visualization I have come up with a term "Sparks" which
+		 * essentially means data points.
+		 * Sparks that will be rendered in full mode will always be the one's which have any year
+		 * associated with it. Hence.
+		 * */
+		int renderedFullSparks = 0;
+
+		List yearToPublicationCountDataTable =
+				new ArrayList();
+
+		for (int publicationYear = minPubYearConsidered;
+					publicationYear <= currentYear;
+					publicationYear++) {
+
+				String stringPublishedYear = String.valueOf(publicationYear);
+				Integer currentPublications = yearToPublicationCount.get(stringPublishedYear);
+
+				if (currentPublications == null) {
+					currentPublications = 0;
+				}
+
+				yearToPublicationCountDataTable.add(new YearToEntityCountDataElement(
+															publicationCounter,
+															stringPublishedYear,
+															currentPublications));
+
+				/*
+				 * Sparks that will be rendered will always be the one's which has
+				 * any year associated with it. Hence.
+				 * */
+				renderedFullSparks += currentPublications;
+				publicationCounter++;
+		}
+
+		sparklineData.setYearToEntityCountDataTable(yearToPublicationCountDataTable);
+		sparklineData.setRenderedSparks(renderedFullSparks);
+
+		/*
+		 * Total publications will also consider publications that have no year associated with
+		 * it. Hence.
+		 * */
+		Integer unknownYearPublications = 0;
+		if (yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
+			unknownYearPublications = yearToPublicationCount
+											.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
+		}
+
+		sparklineData.setUnknownYearPublications(unknownYearPublications);
+
+		if (providedVisContainerID != null) {
+			visContainerID = providedVisContainerID;
+		} else {
+			visContainerID = DEFAULT_VIS_CONTAINER_DIV_ID;
+		}
+
+		sparklineData.setVisContainerDivID(visContainerID);
+
+		/*
+		 * By default these represents the range of the rendered sparks. Only in case of
+		 * "short" sparkline mode we will set the Earliest RenderedPublication year to
+		 * "currentYear - 10".
+		 * */
+		sparklineData.setEarliestYearConsidered(minPubYearConsidered);
+		sparklineData.setEarliestRenderedPublicationYear(minPublishedYear);
+		sparklineData.setLatestRenderedPublicationYear(currentYear);
+
+		if (yearToPublicationCount.size() > 0) {
+
+			sparklineData.setFullTimelineNetworkLink(
+					UtilityFunctions.getCollaboratorshipNetworkLink(
+						individualURI,
+						VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
+						VisualizationFrameworkConstants.COAUTHOR_VIS_MODE));
+
+			sparklineData.setDownloadDataLink(
+					UtilityFunctions.getCSVDownloadURL(
+									individualURI,
+									VisualizationFrameworkConstants.PERSON_PUBLICATION_COUNT_VIS,
+									""));
+		}
+
+		/*
+		 * The Full Sparkline will be rendered by default. Only if the url has specific mention of
+		 * SHORT_SPARKLINE_MODE_URL_HANDLE then we render the short sparkline and not otherwise.
+		 * */
+		if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) {
+
+			sparklineData.setEarliestRenderedPublicationYear(shortSparkMinYear);
+			sparklineData.setShortVisMode(true);
+
+		} else {
+			sparklineData.setShortVisMode(false);
+		}
+
+		return sparklineData;
+	}
+
+	public SparklineData getValueObjectContainer() {
+		return this.sparklineParameterVO;
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/OrganizationUtilityFunctions.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/OrganizationUtilityFunctions.java
index 896b9795..b409f7e9 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/OrganizationUtilityFunctions.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/OrganizationUtilityFunctions.java
@@ -43,7 +43,7 @@ public class OrganizationUtilityFunctions {
 
 	public static String getHighestLevelOrganizationURI(Log log, Dataset dataset)
 			throws MalformedQueryParametersException {
-		
+
 		Map fieldLabelToOutputFieldLabel = new HashMap();
 		fieldLabelToOutputFieldLabel.put("organization",
 				QueryFieldLabels.ORGANIZATION_URL);
@@ -52,7 +52,7 @@ public class OrganizationUtilityFunctions {
 
 		String aggregationRules = "(count(?organization) AS ?numOfChildren)";
 
-		String whereClause = "?organization rdf:type foaf:Organization ;" 
+		String whereClause = "?organization rdf:type foaf:Organization ;"
 						+ " rdfs:label ?organizationLabel . \n"
 				+ "OPTIONAL { ?organization  ?subOrg . \n"
 			    + "           ?subOrg rdf:type foaf:Organization } . \n"
@@ -73,79 +73,79 @@ public class OrganizationUtilityFunctions {
 						fieldLabelToOutputFieldLabel);
 		return highestLevelOrgURI;
 	}
-	
+
 	public static String getEntityLabelFromDAO(VitroRequest vitroRequest,
 			String entityURI) {
-		
+
 		IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao();
         Individual ind = iDao.getIndividualByURI(entityURI);
-        
-        String organizationLabel = "Unknown Organization"; 
-        
+
+        String organizationLabel = "Unknown Organization";
+
         if (ind != null) {
         	organizationLabel = ind.getName();
         }
 		return organizationLabel;
 	}
-	
+
 	public static String getStaffProvidedOrComputedHighestLevelOrganization(Log log,
 			Dataset dataset, VitroRequest vitroRequest)
 			throws MalformedQueryParametersException {
-		
+
 		String staffProvidedHighestLevelOrganization = ConfigurationProperties.getBean(vitroRequest)
 					.getProperty("visualization.topLevelOrg");
-		
+
 		/*
 		 * First checking if the staff has provided highest level organization in runtime.properties
 		 * if so use to temporal graph vis.
 		 */
 		if (StringUtils.isNotBlank(staffProvidedHighestLevelOrganization)) {
-			
+
 			/*
 			 * To test for the validity of the URI submitted.
 			 */
 			IRIFactory iRIFactory = IRIFactory.jenaImplementation();
 			IRI iri = iRIFactory.create(staffProvidedHighestLevelOrganization);
-		    
-			
+
+
 			if (!iri.hasViolation(false)) {
 		    	return staffProvidedHighestLevelOrganization;
 		    }
-		} 
-		
+		}
+
 		/*
 		 * If the provided value was not proper compute it yourself.
 		 * */
 		return OrganizationUtilityFunctions.getHighestLevelOrganizationURI(log, dataset);
 	}
-	
+
 	public static Entity mergeEntityIfShareSameURI(Entity entityA, Entity entityB) {
-		
+
 		if (StringUtils.equalsIgnoreCase(entityA.getEntityURI(), entityB.getEntityURI())) {
-			
+
 			Entity mergedEntity = new Entity(entityA.getEntityURI());
-			
+
 			if (StringUtils.isNotBlank(entityA.getEntityLabel())) {
-				
+
 				mergedEntity.setEntityLabel(entityA.getEntityLabel());
-				
+
 			} else if (StringUtils.isNotBlank(entityB.getEntityLabel())) {
-				
+
 				mergedEntity.setEntityLabel(entityB.getEntityLabel());
 			}
-			
+
 			mergedEntity.addSubEntitities(entityA.getSubEntities());
 			mergedEntity.addSubEntitities(entityB.getSubEntities());
-			
+
 			mergedEntity.addParents(entityA.getParents());
 			mergedEntity.addParents(entityB.getParents());
-			
+
 			return mergedEntity;
-			
+
 		} else {
 			return null;
 		}
-		
+
 	}
-	
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalGrantVisualizationRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalGrantVisualizationRequestHandler.java
index 10986918..7c73effb 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalGrantVisualizationRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalGrantVisualizationRequestHandler.java
@@ -1,313 +1,313 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-
-import org.apache.jena.query.Dataset;
-
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.JsonObject;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.SubjectEntityJSON;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
-
-
-public class TemporalGrantVisualizationRequestHandler implements
-		VisualizationRequestHandler {
-	
-	@Override
-	public ResponseValues generateStandardVisualization(
-			VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException {
-		
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		return generateStandardVisualizationForGrantTemporalVis(vitroRequest, log, dataset, entityURI);
-	}
-
-
-	private ResponseValues generateStandardVisualizationForGrantTemporalVis(
-			VitroRequest vitroRequest, Log log, Dataset dataset,
-			String entityURI) throws MalformedQueryParametersException {
-
-		if (StringUtils.isBlank(entityURI)) {
-			entityURI = OrganizationUtilityFunctions.getStaffProvidedOrComputedHighestLevelOrganization(
-										log,
-										dataset, 
-										vitroRequest);
-			
-		}
-		
-		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
-	}
-	
-	
-	@Override
-	public ResponseValues generateVisualizationForShortURLRequests(
-			Map parameters, VitroRequest vitroRequest, Log log,
-			Dataset dataset) throws MalformedQueryParametersException {
-
-		return generateStandardVisualizationForGrantTemporalVis(
-				vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
-		
-	}
-
-	@Override
-	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException, JsonProcessingException {
-
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		
-		VisConstants.DataVisMode currentDataMode = VisConstants.DataVisMode.CSV;
-		
-		/*
-		 * This will provide the data in json format mainly used for standalone temporal vis. 
-		 * */
-		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
-					.equalsIgnoreCase(vitroRequest
-							.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
-			
-			currentDataMode = VisConstants.DataVisMode.JSON;
-			
-			if (StringUtils.isBlank(entityURI)) {
-				
-				entityURI = OrganizationUtilityFunctions
-								.getStaffProvidedOrComputedHighestLevelOrganization(
-										log,
-										dataset,
-										vitroRequest);								
-								
-			} 
-			
-		} 		
-
-		try {
-			return getSubjectEntityAndGenerateDataResponse(
-					vitroRequest,
-					log,
-					dataset,
-					entityURI,
-					currentDataMode);
-		} finally {
-			VisualizationCaches.buildMissing();
-		}
-	}
-	
-	private Map prepareDataErrorResponse() {
-		String outputFileName = "no-organization_grants-per-year.csv";
-		
-		Map fileData = new HashMap();
-		
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, "");
-		return fileData;
-	}
-	
-	@Override
-	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException {
-		
-		throw new UnsupportedOperationException("Entity Grant Count does not provide Ajax response.");
-	}
-	
-	private Map getSubjectEntityAndGenerateDataResponse(
-			VitroRequest vitroRequest, Log log, Dataset dataset,
-			String subjectEntityURI, VisConstants.DataVisMode visMode)
-			throws MalformedQueryParametersException, JsonProcessingException {
-
-		RDFService rdfService = vitroRequest.getRDFService();
-
-		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
-		Map personLabelMap = VisualizationCaches.personLabels.get(rdfService);
-
-		if (orgLabelMap.get(subjectEntityURI) == null) {
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		}
-
-		Map> subOrgMap               = VisualizationCaches.organizationSubOrgs.get(rdfService);
-		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
-		Map orgMostSpecificLabelMap      = VisualizationCaches.organizationToMostSpecificLabel.get(rdfService);
-		Map personMostSpecificLabelMap   = VisualizationCaches.personToMostSpecificLabel.get(rdfService);
-		Map> personToGrantMap        = VisualizationCaches.personToGrant.get(rdfService);
-		Map      grantToYearMap          = VisualizationCaches.grantToYear.get(rdfService);
-
-		Set orgGrants       = new HashSet();
-		Set orgGrantsPeople = new HashSet();
-
-		Map> subOrgGrantsMap = new HashMap>();
-
-		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
-				subjectEntityURI,
-				orgGrants,
-				orgGrantsPeople,
-				subOrgGrantsMap,
-				subOrgMap,
-				organisationToPeopleMap.organizationToPeople,
-				personToGrantMap
-		);
-
-		if (orgGrants.isEmpty()) {
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		} else {
-
-			Map fileData = new HashMap();
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				Set subEntitiesJson = new HashSet();
-
-				// For each suborganisation
-				for (String subOrg : subOrgGrantsMap.keySet()) {
-					JsonObject entityJson = new JsonObject(orgLabelMap.get(subOrg));
-
-					if (subOrgGrantsMap.containsKey(subOrg)) {
-						List> yearPubCounts = CounterUtils.getObjectCountByYear(subOrgGrantsMap.get(subOrg), grantToYearMap);
-						entityJson.setYearToActivityCount(yearPubCounts);
-					} else {
-						entityJson.setYearToActivityCount(new ArrayList>());
-					}
-
-					String type = orgMostSpecificLabelMap.get(subOrg);
-					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Organization" : type));
-
-					entityJson.setEntityURI(subOrg);
-					entityJson.setVisMode("ORGANIZATION");
-
-					subEntitiesJson.add(entityJson);
-				}
-
-				// For each person
-				for (String person : orgGrantsPeople) {
-					JsonObject entityJson = new JsonObject(personLabelMap.get(person));
-
-					if (personToGrantMap.containsKey(person)) {
-						List> yearPubCounts = CounterUtils.getObjectCountByYear(personToGrantMap.get(person), grantToYearMap);
-						entityJson.setYearToActivityCount(yearPubCounts);
-					} else {
-						entityJson.setYearToActivityCount(new ArrayList>());
-					}
-
-					String type = personMostSpecificLabelMap.get(person);
-					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Person" : type));
-
-					entityJson.setEntityURI(person);
-					entityJson.setVisMode("PERSON");
-
-					subEntitiesJson.add(entityJson);
-				}
-
-				SubjectEntityJSON subjectEntityJSON = new SubjectEntityJSON(
-						orgLabelMap.get(subjectEntityURI),
-						subjectEntityURI,
-						OrgUtils.getParentURIsToLabel(subjectEntityURI, subOrgMap, orgLabelMap));
-
-				subEntitiesJson.add(subjectEntityJSON);
-
-				ObjectMapper mapper = new ObjectMapper();
-
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(subEntitiesJson));
-
-			} else {
-				String entityLabel = orgLabelMap.get(subjectEntityURI);
-				if (StringUtils.isBlank(entityLabel)) {
-					entityLabel = "no-organization";
-				}
-
-				StringBuilder csvFileContent = new StringBuilder();
-
-				csvFileContent.append("Entity Name, Grant Count, Entity Type\n");
-
-				for (String subOrg : subOrgGrantsMap.keySet()) {
-					csvFileContent.append(StringEscapeUtils.escapeCsv(orgLabelMap.get(subOrg)));
-					csvFileContent.append(", ");
-
-					csvFileContent.append(subOrgGrantsMap.get(subOrg).size());
-					csvFileContent.append(", ");
-
-					csvFileContent.append("Organization");
-					csvFileContent.append("\n");
-
-				}
-
-				String outputFileName = UtilityFunctions.slugify(entityLabel) + "_grants-per-year" + ".csv";
-				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, csvFileContent.toString());
-			}
-			return fileData;
-		}
-	}
-
-	private Map prepareStandaloneDataErrorResponse() {
-
-		Map fileData = new HashMap();
-		
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, 
-					 "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, 
-					 "{\"error\" : \"No Grants for this Organization found in VIVO.\"}");
-		return fileData;
-	}
-	
-	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq,
-			   String entityURI) {
-
-		String standaloneTemplate = "entityComparisonOnGrantsStandalone.ftl";
-
-		String organizationLabel = OrganizationUtilityFunctions.getEntityLabelFromDAO(vreq,
-											  entityURI);
-
-		Map body = new HashMap();
-		body.put("title", organizationLabel + " - Temporal Graph Visualization");
-		body.put("organizationURI", entityURI);
-		body.put("organizationLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
-		body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
-		body.put("organizationLabel", organizationLabel);
-
-		if (VisualizationCaches.personToGrant.isCached()) {
-			body.put("builtFromCacheTime", VisualizationCaches.personToGrant.cachedWhen());
-		}
-
-		return new TemplateResponseValues(standaloneTemplate, body);
-	}
-	
-	@Override
-	public AuthorizationRequest getRequiredPrivileges() {
-		return null;
-	}	
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
+import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+
+import org.apache.jena.query.Dataset;
+
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.JsonObject;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.SubjectEntityJSON;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
+
+
+public class TemporalGrantVisualizationRequestHandler implements
+		VisualizationRequestHandler {
+
+	@Override
+	public ResponseValues generateStandardVisualization(
+			VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+		return generateStandardVisualizationForGrantTemporalVis(vitroRequest, log, dataset, entityURI);
+	}
+
+
+	private ResponseValues generateStandardVisualizationForGrantTemporalVis(
+			VitroRequest vitroRequest, Log log, Dataset dataset,
+			String entityURI) throws MalformedQueryParametersException {
+
+		if (StringUtils.isBlank(entityURI)) {
+			entityURI = OrganizationUtilityFunctions.getStaffProvidedOrComputedHighestLevelOrganization(
+										log,
+										dataset,
+										vitroRequest);
+
+		}
+
+		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
+	}
+
+
+	@Override
+	public ResponseValues generateVisualizationForShortURLRequests(
+			Map parameters, VitroRequest vitroRequest, Log log,
+			Dataset dataset) throws MalformedQueryParametersException {
+
+		return generateStandardVisualizationForGrantTemporalVis(
+				vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
+
+	}
+
+	@Override
+	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException, JsonProcessingException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		VisConstants.DataVisMode currentDataMode = VisConstants.DataVisMode.CSV;
+
+		/*
+		 * This will provide the data in json format mainly used for standalone temporal vis.
+		 * */
+		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
+					.equalsIgnoreCase(vitroRequest
+							.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
+
+			currentDataMode = VisConstants.DataVisMode.JSON;
+
+			if (StringUtils.isBlank(entityURI)) {
+
+				entityURI = OrganizationUtilityFunctions
+								.getStaffProvidedOrComputedHighestLevelOrganization(
+										log,
+										dataset,
+										vitroRequest);
+
+			}
+
+		}
+
+		try {
+			return getSubjectEntityAndGenerateDataResponse(
+					vitroRequest,
+					log,
+					dataset,
+					entityURI,
+					currentDataMode);
+		} finally {
+			VisualizationCaches.buildMissing();
+		}
+	}
+
+	private Map prepareDataErrorResponse() {
+		String outputFileName = "no-organization_grants-per-year.csv";
+
+		Map fileData = new HashMap();
+
+		fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY, "");
+		return fileData;
+	}
+
+	@Override
+	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException {
+
+		throw new UnsupportedOperationException("Entity Grant Count does not provide Ajax response.");
+	}
+
+	private Map getSubjectEntityAndGenerateDataResponse(
+			VitroRequest vitroRequest, Log log, Dataset dataset,
+			String subjectEntityURI, VisConstants.DataVisMode visMode)
+			throws MalformedQueryParametersException, JsonProcessingException {
+
+		RDFService rdfService = vitroRequest.getRDFService();
+
+		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
+		Map personLabelMap = VisualizationCaches.personLabels.get(rdfService);
+
+		if (orgLabelMap.get(subjectEntityURI) == null) {
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		}
+
+		Map> subOrgMap               = VisualizationCaches.organizationSubOrgs.get(rdfService);
+		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
+		Map orgMostSpecificLabelMap      = VisualizationCaches.organizationToMostSpecificLabel.get(rdfService);
+		Map personMostSpecificLabelMap   = VisualizationCaches.personToMostSpecificLabel.get(rdfService);
+		Map> personToGrantMap        = VisualizationCaches.personToGrant.get(rdfService);
+		Map      grantToYearMap          = VisualizationCaches.grantToYear.get(rdfService);
+
+		Set orgGrants       = new HashSet();
+		Set orgGrantsPeople = new HashSet();
+
+		Map> subOrgGrantsMap = new HashMap>();
+
+		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
+				subjectEntityURI,
+				orgGrants,
+				orgGrantsPeople,
+				subOrgGrantsMap,
+				subOrgMap,
+				organisationToPeopleMap.organizationToPeople,
+				personToGrantMap
+		);
+
+		if (orgGrants.isEmpty()) {
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		} else {
+
+			Map fileData = new HashMap();
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				Set subEntitiesJson = new HashSet();
+
+				// For each suborganisation
+				for (String subOrg : subOrgGrantsMap.keySet()) {
+					JsonObject entityJson = new JsonObject(orgLabelMap.get(subOrg));
+
+					if (subOrgGrantsMap.containsKey(subOrg)) {
+						List> yearPubCounts = CounterUtils.getObjectCountByYear(subOrgGrantsMap.get(subOrg), grantToYearMap);
+						entityJson.setYearToActivityCount(yearPubCounts);
+					} else {
+						entityJson.setYearToActivityCount(new ArrayList>());
+					}
+
+					String type = orgMostSpecificLabelMap.get(subOrg);
+					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Organization" : type));
+
+					entityJson.setEntityURI(subOrg);
+					entityJson.setVisMode("ORGANIZATION");
+
+					subEntitiesJson.add(entityJson);
+				}
+
+				// For each person
+				for (String person : orgGrantsPeople) {
+					JsonObject entityJson = new JsonObject(personLabelMap.get(person));
+
+					if (personToGrantMap.containsKey(person)) {
+						List> yearPubCounts = CounterUtils.getObjectCountByYear(personToGrantMap.get(person), grantToYearMap);
+						entityJson.setYearToActivityCount(yearPubCounts);
+					} else {
+						entityJson.setYearToActivityCount(new ArrayList>());
+					}
+
+					String type = personMostSpecificLabelMap.get(person);
+					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Person" : type));
+
+					entityJson.setEntityURI(person);
+					entityJson.setVisMode("PERSON");
+
+					subEntitiesJson.add(entityJson);
+				}
+
+				SubjectEntityJSON subjectEntityJSON = new SubjectEntityJSON(
+						orgLabelMap.get(subjectEntityURI),
+						subjectEntityURI,
+						OrgUtils.getParentURIsToLabel(subjectEntityURI, subOrgMap, orgLabelMap));
+
+				subEntitiesJson.add(subjectEntityJSON);
+
+				ObjectMapper mapper = new ObjectMapper();
+
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(subEntitiesJson));
+
+			} else {
+				String entityLabel = orgLabelMap.get(subjectEntityURI);
+				if (StringUtils.isBlank(entityLabel)) {
+					entityLabel = "no-organization";
+				}
+
+				StringBuilder csvFileContent = new StringBuilder();
+
+				csvFileContent.append("Entity Name, Grant Count, Entity Type\n");
+
+				for (String subOrg : subOrgGrantsMap.keySet()) {
+					csvFileContent.append(StringEscapeUtils.escapeCsv(orgLabelMap.get(subOrg)));
+					csvFileContent.append(", ");
+
+					csvFileContent.append(subOrgGrantsMap.get(subOrg).size());
+					csvFileContent.append(", ");
+
+					csvFileContent.append("Organization");
+					csvFileContent.append("\n");
+
+				}
+
+				String outputFileName = UtilityFunctions.slugify(entityLabel) + "_grants-per-year" + ".csv";
+				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, csvFileContent.toString());
+			}
+			return fileData;
+		}
+	}
+
+	private Map prepareStandaloneDataErrorResponse() {
+
+		Map fileData = new HashMap();
+
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
+					 "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
+					 "{\"error\" : \"No Grants for this Organization found in VIVO.\"}");
+		return fileData;
+	}
+
+	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq,
+			   String entityURI) {
+
+		String standaloneTemplate = "entityComparisonOnGrantsStandalone.ftl";
+
+		String organizationLabel = OrganizationUtilityFunctions.getEntityLabelFromDAO(vreq,
+											  entityURI);
+
+		Map body = new HashMap();
+		body.put("title", organizationLabel + " - Temporal Graph Visualization");
+		body.put("organizationURI", entityURI);
+		body.put("organizationLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
+		body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
+		body.put("organizationLabel", organizationLabel);
+
+		if (VisualizationCaches.personToGrant.isCached()) {
+			body.put("builtFromCacheTime", VisualizationCaches.personToGrant.cachedWhen());
+		}
+
+		return new TemplateResponseValues(standaloneTemplate, body);
+	}
+
+	@Override
+	public AuthorizationRequest getRequiredPrivileges() {
+		return null;
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalPublicationVisualizationRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalPublicationVisualizationRequestHandler.java
index 02b0a576..133ab57b 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalPublicationVisualizationRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/temporalgraph/TemporalPublicationVisualizationRequestHandler.java
@@ -1,316 +1,316 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
-import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-
-import org.apache.jena.query.Dataset;
-
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
-import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.JsonObject;
-import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.SubjectEntityJSON;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
-
-public class TemporalPublicationVisualizationRequestHandler implements
-		VisualizationRequestHandler {
-	
-	@Override
-	public ResponseValues generateStandardVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
-			throws MalformedQueryParametersException {
-		
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		return generateStandardVisualizationForPublicationTemporalVis(vitroRequest, log, dataset, entityURI);
-	}
-	
-	@Override
-	public ResponseValues generateVisualizationForShortURLRequests(
-			Map parameters, VitroRequest vitroRequest, Log log,
-			Dataset dataset) throws MalformedQueryParametersException {
-
-		return generateStandardVisualizationForPublicationTemporalVis(
-				vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
-	}
-
-	private ResponseValues generateStandardVisualizationForPublicationTemporalVis(
-			VitroRequest vitroRequest, Log log, Dataset dataset,
-			String entityURI) throws MalformedQueryParametersException {
-		
-		if (StringUtils.isBlank(entityURI)) {
-			entityURI = OrganizationUtilityFunctions
-								.getStaffProvidedOrComputedHighestLevelOrganization(
-											log, 
-											dataset, 
-											vitroRequest);
-		}
-		
-		
-		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
-	}
-
-	private Map getSubjectEntityAndGenerateDataResponse(
-			VitroRequest vitroRequest, Log log, Dataset dataset,
-			String subjectEntityURI, VisConstants.DataVisMode visMode)
-            throws MalformedQueryParametersException, JsonProcessingException {
-
-		RDFService rdfService = vitroRequest.getRDFService();
-
-		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
-		Map personLabelMap = VisualizationCaches.personLabels.get(rdfService);
-
-		if (orgLabelMap.get(subjectEntityURI) == null) {
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		}
-
-		Map> subOrgMap               = VisualizationCaches.organizationSubOrgs.get(rdfService);
-		Map orgMostSpecificLabelMap      = VisualizationCaches.organizationToMostSpecificLabel.get(rdfService);
-		Map personMostSpecificLabelMap   = VisualizationCaches.personToMostSpecificLabel.get(rdfService);
-		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
-		Map> personToPublicationMap  = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
-		Map      publicationToYearMap    = VisualizationCaches.publicationToYear.get(rdfService);
-
-		Set orgPublications       = new HashSet();
-		Set orgPublicationsPeople = new HashSet();
-
-		Map> subOrgPublicationsMap = new HashMap>();
-
-		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
-				subjectEntityURI,
-				orgPublications,
-				orgPublicationsPeople,
-				subOrgPublicationsMap,
-				subOrgMap,
-				organisationToPeopleMap.organizationToPeople,
-				personToPublicationMap
-		);
-
-		if (orgPublications.isEmpty()) {
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				return prepareStandaloneDataErrorResponse();
-			} else {
-				return prepareDataErrorResponse();
-			}
-		} else {
-
-			Map fileData = new HashMap();
-			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
-				Set subEntitiesJson = new HashSet();
-
-				// For each suborganisation
-				for (String subOrg : subOrgPublicationsMap.keySet()) {
-					JsonObject entityJson = new JsonObject(orgLabelMap.get(subOrg));
-
-					if (subOrgPublicationsMap.containsKey(subOrg)) {
-						List> yearPubCounts = CounterUtils.getObjectCountByYear(subOrgPublicationsMap.get(subOrg), publicationToYearMap);
-						entityJson.setYearToActivityCount(yearPubCounts);
-					} else {
-						entityJson.setYearToActivityCount(new ArrayList>());
-					}
-
-					String type = orgMostSpecificLabelMap.get(subOrg);
-					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Organization" : type));
-
-					entityJson.setEntityURI(subOrg);
-					entityJson.setVisMode("ORGANIZATION");
-
-					subEntitiesJson.add(entityJson);
-				}
-
-				// For each person
-				for (String person : orgPublicationsPeople) {
-					JsonObject entityJson = new JsonObject(personLabelMap.get(person));
-
-					if (personToPublicationMap.containsKey(person)) {
-						List> yearPubCounts = CounterUtils.getObjectCountByYear(personToPublicationMap.get(person), publicationToYearMap);
-						entityJson.setYearToActivityCount(yearPubCounts);
-					} else {
-						entityJson.setYearToActivityCount(new ArrayList>());
-					}
-
-					String type = personMostSpecificLabelMap.get(person);
-					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Person" : type));
-
-					entityJson.setEntityURI(person);
-					entityJson.setVisMode("PERSON");
-
-					subEntitiesJson.add(entityJson);
-				}
-
-				SubjectEntityJSON subjectEntityJSON = new SubjectEntityJSON(
-						orgLabelMap.get(subjectEntityURI),
-						subjectEntityURI,
-						OrgUtils.getParentURIsToLabel(subjectEntityURI, subOrgMap, orgLabelMap));
-
-				subEntitiesJson.add(subjectEntityJSON);
-
-				ObjectMapper mapper = new ObjectMapper();
-
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(subEntitiesJson));
-
-			} else {
-				String entityLabel = orgLabelMap.get(subjectEntityURI);
-				if (StringUtils.isBlank(entityLabel)) {
-					entityLabel = "no-organization";
-				}
-
-				StringBuilder csvFileContent = new StringBuilder();
-
-				csvFileContent.append("Entity Name, Publication Count, Entity Type\n");
-
-				for (String subOrg : subOrgPublicationsMap.keySet()) {
-					csvFileContent.append(StringEscapeUtils.escapeCsv(orgLabelMap.get(subOrg)));
-					csvFileContent.append(", ");
-
-					csvFileContent.append(subOrgPublicationsMap.get(subOrg).size());
-					csvFileContent.append(", ");
-
-					csvFileContent.append("Organization");
-					csvFileContent.append("\n");
-
-				}
-
-				// For each person
-				for (String person : orgPublicationsPeople) {
-					csvFileContent.append(StringEscapeUtils.escapeCsv(personLabelMap.get(person)));
-					csvFileContent.append(", ");
-
-					if (personToPublicationMap.containsKey(person)) {
-						csvFileContent.append(personToPublicationMap.get(person).size());
-						csvFileContent.append(", ");
-					} else {
-						csvFileContent.append("0, ");
-					}
-
-					csvFileContent.append("Person");
-					csvFileContent.append("\n");
-				}
-
-				String outputFileName = UtilityFunctions.slugify(entityLabel) + "_publications-per-year" + ".csv";
-				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, csvFileContent.toString());
-			}
-			return fileData;
-		}
-	}
-
-	private Map prepareDataErrorResponse() {
-		String outputFileName = "no-organization_publications-per-year.csv";
-		
-		Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,      "");
-		return fileData;
-	}
-
-	private Map prepareStandaloneDataErrorResponse() {
-		Map fileData = new HashMap();
-		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
-		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,      "{\"error\" : \"No Publications for this Organization found in VIVO.\"}");
-		return fileData;
-	}
-
-	@Override
-	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
-            throws MalformedQueryParametersException, JsonProcessingException {
-
-		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
-		
-		VisConstants.DataVisMode currentDataMode = VisConstants.DataVisMode.CSV;
-		
-		/*
-		 * This will provide the data in json format mainly used for standalone tmeporal vis. 
-		 * */
-		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
-					.equalsIgnoreCase(vitroRequest.getParameter(
-							VisualizationFrameworkConstants.VIS_MODE_KEY))) {
-			
-			currentDataMode = VisConstants.DataVisMode.JSON;
-			
-			if (StringUtils.isBlank(entityURI)) {
-				
-				entityURI = OrganizationUtilityFunctions
-								.getStaffProvidedOrComputedHighestLevelOrganization(
-										log,
-										dataset,
-										vitroRequest);	
-				
-			} 
-			
-		} 
-
-		try {
-			return getSubjectEntityAndGenerateDataResponse(
-					vitroRequest,
-					log,
-					dataset,
-					entityURI,
-					currentDataMode);
-		} finally {
-			VisualizationCaches.buildMissing();
-		}
-	}
-	
-	
-	@Override
-	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Entity Pub Count does not provide Ajax Response.");
-	}
-
-	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq, String entityURI) {
-        String standaloneTemplate = "entityComparisonOnPublicationsStandalone.ftl";
-        String organizationLabel = OrganizationUtilityFunctions.getEntityLabelFromDAO(vreq, entityURI);
-
-        Map body = new HashMap();
-        body.put("title", organizationLabel + " - Temporal Graph Visualization");
-        body.put("organizationURI", entityURI);
-        body.put("organizationLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
-        body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
-        body.put("organizationLabel", organizationLabel);
-
-		if (VisualizationCaches.personToPublication.isCached()) {
-			body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
-		}
-
-        return new TemplateResponseValues(standaloneTemplate, body);
-	}
-
-	@Override
-	public AuthorizationRequest getRequiredPrivileges() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
+import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
+import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+
+import org.apache.jena.query.Dataset;
+
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.DataVisualizationController;
+import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFrameworkConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.JsonObject;
+import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json.SubjectEntityJSON;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
+
+public class TemporalPublicationVisualizationRequestHandler implements
+		VisualizationRequestHandler {
+
+	@Override
+	public ResponseValues generateStandardVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
+			throws MalformedQueryParametersException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+		return generateStandardVisualizationForPublicationTemporalVis(vitroRequest, log, dataset, entityURI);
+	}
+
+	@Override
+	public ResponseValues generateVisualizationForShortURLRequests(
+			Map parameters, VitroRequest vitroRequest, Log log,
+			Dataset dataset) throws MalformedQueryParametersException {
+
+		return generateStandardVisualizationForPublicationTemporalVis(
+				vitroRequest, log, dataset, parameters.get(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY));
+	}
+
+	private ResponseValues generateStandardVisualizationForPublicationTemporalVis(
+			VitroRequest vitroRequest, Log log, Dataset dataset,
+			String entityURI) throws MalformedQueryParametersException {
+
+		if (StringUtils.isBlank(entityURI)) {
+			entityURI = OrganizationUtilityFunctions
+								.getStaffProvidedOrComputedHighestLevelOrganization(
+											log,
+											dataset,
+											vitroRequest);
+		}
+
+
+		return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
+	}
+
+	private Map getSubjectEntityAndGenerateDataResponse(
+			VitroRequest vitroRequest, Log log, Dataset dataset,
+			String subjectEntityURI, VisConstants.DataVisMode visMode)
+            throws MalformedQueryParametersException, JsonProcessingException {
+
+		RDFService rdfService = vitroRequest.getRDFService();
+
+		Map orgLabelMap = VisualizationCaches.organizationLabels.get(rdfService);
+		Map personLabelMap = VisualizationCaches.personLabels.get(rdfService);
+
+		if (orgLabelMap.get(subjectEntityURI) == null) {
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		}
+
+		Map> subOrgMap               = VisualizationCaches.organizationSubOrgs.get(rdfService);
+		Map orgMostSpecificLabelMap      = VisualizationCaches.organizationToMostSpecificLabel.get(rdfService);
+		Map personMostSpecificLabelMap   = VisualizationCaches.personToMostSpecificLabel.get(rdfService);
+		OrganizationPeopleMap organisationToPeopleMap = VisualizationCaches.organisationToPeopleMap.get(rdfService);
+		Map> personToPublicationMap  = VisualizationCaches.personToPublication.get(rdfService).personToPublication;
+		Map      publicationToYearMap    = VisualizationCaches.publicationToYear.get(rdfService);
+
+		Set orgPublications       = new HashSet();
+		Set orgPublicationsPeople = new HashSet();
+
+		Map> subOrgPublicationsMap = new HashMap>();
+
+		OrgUtils.getObjectMappingsForOrgAndSubOrgs(
+				subjectEntityURI,
+				orgPublications,
+				orgPublicationsPeople,
+				subOrgPublicationsMap,
+				subOrgMap,
+				organisationToPeopleMap.organizationToPeople,
+				personToPublicationMap
+		);
+
+		if (orgPublications.isEmpty()) {
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				return prepareStandaloneDataErrorResponse();
+			} else {
+				return prepareDataErrorResponse();
+			}
+		} else {
+
+			Map fileData = new HashMap();
+			if (VisConstants.DataVisMode.JSON.equals(visMode)) {
+				Set subEntitiesJson = new HashSet();
+
+				// For each suborganisation
+				for (String subOrg : subOrgPublicationsMap.keySet()) {
+					JsonObject entityJson = new JsonObject(orgLabelMap.get(subOrg));
+
+					if (subOrgPublicationsMap.containsKey(subOrg)) {
+						List> yearPubCounts = CounterUtils.getObjectCountByYear(subOrgPublicationsMap.get(subOrg), publicationToYearMap);
+						entityJson.setYearToActivityCount(yearPubCounts);
+					} else {
+						entityJson.setYearToActivityCount(new ArrayList>());
+					}
+
+					String type = orgMostSpecificLabelMap.get(subOrg);
+					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Organization" : type));
+
+					entityJson.setEntityURI(subOrg);
+					entityJson.setVisMode("ORGANIZATION");
+
+					subEntitiesJson.add(entityJson);
+				}
+
+				// For each person
+				for (String person : orgPublicationsPeople) {
+					JsonObject entityJson = new JsonObject(personLabelMap.get(person));
+
+					if (personToPublicationMap.containsKey(person)) {
+						List> yearPubCounts = CounterUtils.getObjectCountByYear(personToPublicationMap.get(person), publicationToYearMap);
+						entityJson.setYearToActivityCount(yearPubCounts);
+					} else {
+						entityJson.setYearToActivityCount(new ArrayList>());
+					}
+
+					String type = personMostSpecificLabelMap.get(person);
+					entityJson.setOrganizationTypes(Arrays.asList(type == null ? "Person" : type));
+
+					entityJson.setEntityURI(person);
+					entityJson.setVisMode("PERSON");
+
+					subEntitiesJson.add(entityJson);
+				}
+
+				SubjectEntityJSON subjectEntityJSON = new SubjectEntityJSON(
+						orgLabelMap.get(subjectEntityURI),
+						subjectEntityURI,
+						OrgUtils.getParentURIsToLabel(subjectEntityURI, subOrgMap, orgLabelMap));
+
+				subEntitiesJson.add(subjectEntityJSON);
+
+				ObjectMapper mapper = new ObjectMapper();
+
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, mapper.writeValueAsString(subEntitiesJson));
+
+			} else {
+				String entityLabel = orgLabelMap.get(subjectEntityURI);
+				if (StringUtils.isBlank(entityLabel)) {
+					entityLabel = "no-organization";
+				}
+
+				StringBuilder csvFileContent = new StringBuilder();
+
+				csvFileContent.append("Entity Name, Publication Count, Entity Type\n");
+
+				for (String subOrg : subOrgPublicationsMap.keySet()) {
+					csvFileContent.append(StringEscapeUtils.escapeCsv(orgLabelMap.get(subOrg)));
+					csvFileContent.append(", ");
+
+					csvFileContent.append(subOrgPublicationsMap.get(subOrg).size());
+					csvFileContent.append(", ");
+
+					csvFileContent.append("Organization");
+					csvFileContent.append("\n");
+
+				}
+
+				// For each person
+				for (String person : orgPublicationsPeople) {
+					csvFileContent.append(StringEscapeUtils.escapeCsv(personLabelMap.get(person)));
+					csvFileContent.append(", ");
+
+					if (personToPublicationMap.containsKey(person)) {
+						csvFileContent.append(personToPublicationMap.get(person).size());
+						csvFileContent.append(", ");
+					} else {
+						csvFileContent.append("0, ");
+					}
+
+					csvFileContent.append("Person");
+					csvFileContent.append("\n");
+				}
+
+				String outputFileName = UtilityFunctions.slugify(entityLabel) + "_publications-per-year" + ".csv";
+				fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+				fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+				fileData.put(DataVisualizationController.FILE_CONTENT_KEY, csvFileContent.toString());
+			}
+			return fileData;
+		}
+	}
+
+	private Map prepareDataErrorResponse() {
+		String outputFileName = "no-organization_publications-per-year.csv";
+
+		Map fileData = new HashMap();
+		fileData.put(DataVisualizationController.FILE_NAME_KEY, outputFileName);
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,      "");
+		return fileData;
+	}
+
+	private Map prepareStandaloneDataErrorResponse() {
+		Map fileData = new HashMap();
+		fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY, "application/octet-stream");
+		fileData.put(DataVisualizationController.FILE_CONTENT_KEY,      "{\"error\" : \"No Publications for this Organization found in VIVO.\"}");
+		return fileData;
+	}
+
+	@Override
+	public Map generateDataVisualization(VitroRequest vitroRequest, Log log, Dataset dataset)
+            throws MalformedQueryParametersException, JsonProcessingException {
+
+		String entityURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
+
+		VisConstants.DataVisMode currentDataMode = VisConstants.DataVisMode.CSV;
+
+		/*
+		 * This will provide the data in json format mainly used for standalone tmeporal vis.
+		 * */
+		if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
+					.equalsIgnoreCase(vitroRequest.getParameter(
+							VisualizationFrameworkConstants.VIS_MODE_KEY))) {
+
+			currentDataMode = VisConstants.DataVisMode.JSON;
+
+			if (StringUtils.isBlank(entityURI)) {
+
+				entityURI = OrganizationUtilityFunctions
+								.getStaffProvidedOrComputedHighestLevelOrganization(
+										log,
+										dataset,
+										vitroRequest);
+
+			}
+
+		}
+
+		try {
+			return getSubjectEntityAndGenerateDataResponse(
+					vitroRequest,
+					log,
+					dataset,
+					entityURI,
+					currentDataMode);
+		} finally {
+			VisualizationCaches.buildMissing();
+		}
+	}
+
+
+	@Override
+	public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataset) throws MalformedQueryParametersException {
+		throw new UnsupportedOperationException("Entity Pub Count does not provide Ajax Response.");
+	}
+
+	private TemplateResponseValues prepareStandaloneMarkupResponse(VitroRequest vreq, String entityURI) {
+        String standaloneTemplate = "entityComparisonOnPublicationsStandalone.ftl";
+        String organizationLabel = OrganizationUtilityFunctions.getEntityLabelFromDAO(vreq, entityURI);
+
+        Map body = new HashMap();
+        body.put("title", organizationLabel + " - Temporal Graph Visualization");
+        body.put("organizationURI", entityURI);
+        body.put("organizationLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
+        body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
+        body.put("organizationLabel", organizationLabel);
+
+		if (VisualizationCaches.personToPublication.isCached()) {
+			body.put("builtFromCacheTime", VisualizationCaches.personToPublication.cachedWhen());
+		}
+
+        return new TemplateResponseValues(standaloneTemplate, body);
+	}
+
+	@Override
+	public AuthorizationRequest getRequiredPrivileges() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/tools/ToolsRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/tools/ToolsRequestHandler.java
index f0f95bc0..2b5f7113 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/tools/ToolsRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/tools/ToolsRequestHandler.java
@@ -18,7 +18,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
 
 public class ToolsRequestHandler implements VisualizationRequestHandler {
-	
+
 	public static final AuthorizationRequest REQUIRED_ACTIONS = SimplePermission.REFRESH_VISUALIZATION_CACHE.ACTION;
 
 	@Override
@@ -45,7 +45,7 @@ public class ToolsRequestHandler implements VisualizationRequestHandler {
 	public ResponseValues generateVisualizationForShortURLRequests(
 			Map parameters, VitroRequest vitroRequest, Log log,
 			Dataset dataSource) throws MalformedQueryParametersException {
-		
+
 		return renderToolsMenu(vitroRequest, log, dataSource);
 	}
 
@@ -53,7 +53,7 @@ public class ToolsRequestHandler implements VisualizationRequestHandler {
 	public AuthorizationRequest getRequiredPrivileges() {
 		return REQUIRED_ACTIONS;
 	}
-	
+
 	private ResponseValues renderToolsMenu(VitroRequest vitroRequest,
 			Log log, Dataset dataSource) {
 
@@ -63,6 +63,6 @@ public class ToolsRequestHandler implements VisualizationRequestHandler {
 		body.put("title", "Visualization Tools");
 
 		return new TemplateResponseValues(standaloneTemplate, body);
-	} 
+	}
 
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java
index 1496132e..6e3666bd 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java
@@ -42,18 +42,18 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequ
 
 /**
  * This request handler is used when you need helpful information to add more context
- * to the visualization. It does not have any code for generating the visualization, 
+ * to the visualization. It does not have any code for generating the visualization,
  * just fires sparql queries to get info for specific cases like,
  * 		1. thumbnail/image location for a particular individual
  * 		2. profile information for a particular individual like label, moniker etc
  * 		3. person level vis url for a particular individual
- * 		etc.  
+ * 		etc.
  * @author cdtank
  */
 public class UtilitiesRequestHandler implements VisualizationRequestHandler {
-	
+
 	public Object generateAjaxVisualization(VitroRequest vitroRequest,
-											Log log, 
+											Log log,
 											Dataset dataset)
 			throws MalformedQueryParametersException, JsonProcessingException {
 
@@ -62,52 +62,52 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 
         String visMode = vitroRequest.getParameter(
         									VisualizationFrameworkConstants.VIS_MODE_KEY);
-        
+
         /*
 		 * If the info being requested is about a profile which includes the name, moniker
 		 * & image url.
 		 * */
 		if (VisualizationFrameworkConstants.PROFILE_INFO_UTILS_VIS_MODE
 					.equalsIgnoreCase(visMode)) {
-			
-			
+
+
 			String filterRule = "?predicate = public:mainImage "
-									+ " || ?predicate = rdfs:label "   
+									+ " || ?predicate = rdfs:label "
 									+ " || ?predicate =  ";
-			
+
 			AllPropertiesQueryRunner profileQueryHandler =
-					new AllPropertiesQueryRunner(individualURI, 
+					new AllPropertiesQueryRunner(individualURI,
 												  filterRule,
 												  vitroRequest.getRDFService(),
 												  log);
-			
-			GenericQueryMap profilePropertiesToValues = 
+
+			GenericQueryMap profilePropertiesToValues =
 						profileQueryHandler.getQueryResult();
 
 			ObjectMapper mapper = new ObjectMapper();
 
 			return mapper.writeValueAsString(profilePropertiesToValues);
 
-				
+
 		} else if (VisualizationFrameworkConstants.IMAGE_UTILS_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
 			/*
-    		 * If the url being requested is about a standalone image, which is used when we 
+    		 * If the url being requested is about a standalone image, which is used when we
     		 * want to render an image & other info for a co-author OR ego for that matter.
     		 * */
-			
+
 			Map fieldLabelToOutputFieldLabel = new HashMap();
-			fieldLabelToOutputFieldLabel.put("downloadLocation", 
+			fieldLabelToOutputFieldLabel.put("downloadLocation",
 											  QueryFieldLabels.THUMBNAIL_LOCATION_URL);
 			fieldLabelToOutputFieldLabel.put("fileName", QueryFieldLabels.THUMBNAIL_FILENAME);
-			
-			String whereClause = "<" + individualURI 
+
+			String whereClause = "<" + individualURI
 									+ "> public:thumbnailImage ?thumbnailImage .  "
 									+ "?thumbnailImage public:downloadLocation "
 									+ "?downloadLocation ; public:filename ?fileName .";
-			
-			
-			
+
+
+
 			GenericQueryRunner imageQueryHandler =
 					new GenericQueryRunner(fieldLabelToOutputFieldLabel,
 											"",
@@ -121,20 +121,20 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 
 		} else if (VisualizationFrameworkConstants.ARE_PUBLICATIONS_AVAILABLE_UTILS_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
-			
+
 			Map fieldLabelToOutputFieldLabel = new HashMap();
-			
+
 			String aggregationRules = "(count(DISTINCT ?document) AS ?numOfPublications)";
-			
-			String whereClause = 
-				"<" + individualURI + "> rdf:type foaf:Person ;" 
+
+			String whereClause =
+				"<" + individualURI + "> rdf:type foaf:Person ;"
 					+ " core:relatedBy ?authorshipNode . \n"
-				+ "?authorshipNode rdf:type core:Authorship ;" 
+				+ "?authorshipNode rdf:type core:Authorship ;"
 					+ " core:relates ?document . \n"
 				+ "?document rdf:type bibo:Document .";
 
-			String groupOrderClause = "GROUP BY ?" + QueryFieldLabels.AUTHOR_URL + " \n"; 
-			
+			String groupOrderClause = "GROUP BY ?" + QueryFieldLabels.AUTHOR_URL + " \n";
+
 			GenericQueryRunner numberOfPublicationsQueryHandler =
 			new GenericQueryRunner(fieldLabelToOutputFieldLabel,
 									aggregationRules,
@@ -153,27 +153,27 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 						.equalsIgnoreCase(visMode)) {
 
 			Map fieldLabelToOutputFieldLabel = new HashMap();
-			
+
 			String aggregationRules = "(count(DISTINCT ?Grant) AS ?numOfGrants)";
 			String grantType = "http://vivoweb.org/ontology/core#Grant";
 
 			ObjectProperty predicate = ModelUtils.getPropertyForRoleInClass(grantType, vitroRequest.getWebappDaoFactory());
 			String roleToGrantPredicate = "<" + predicate.getURI() + ">";
-			String whereClause = "{ <" + individualURI + "> rdf:type foaf:Person ;" 
+			String whereClause = "{ <" + individualURI + "> rdf:type foaf:Person ;"
 										+ "  ?Role . \n"
 									+ "?Role rdf:type core:PrincipalInvestigatorRole . \n"
 									+ "?Role " + roleToGrantPredicate + " ?Grant . }"
 									+ "UNION \n"
-									+ "{ <" + individualURI + "> rdf:type foaf:Person ;" 
+									+ "{ <" + individualURI + "> rdf:type foaf:Person ;"
 										+ "  ?Role . \n"
 									+ "?Role rdf:type core:CoPrincipalInvestigatorRole . \n"
 									+ "?Role " + roleToGrantPredicate + " ?Grant . }"
 									+ "UNION \n"
-									+ "{ <" + individualURI + "> rdf:type foaf:Person ;" 
+									+ "{ <" + individualURI + "> rdf:type foaf:Person ;"
 										+ "  ?Role . \n"
 									+ "?Role rdf:type core:InvestigatorRole. \n"
     								+ "?Role vitro:mostSpecificType ?subclass . \n"
-									+ "?Role " + roleToGrantPredicate + " ?Grant . \n" 
+									+ "?Role " + roleToGrantPredicate + " ?Grant . \n"
 									+ "FILTER (?subclass != core:PrincipalInvestigatorRole && "
 									+ "?subclass != core:CoPrincipalInvestigatorRole)}";
 
@@ -183,30 +183,30 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 									whereClause,
 									"",
 									dataset);
-			
+
 			NumGrantsForIndividualConsumer consumer = new NumGrantsForIndividualConsumer();
 			numberOfGrantsQueryHandler.sparqlSelectQuery(vitroRequest.getRDFService(), consumer);
 
 			ObjectMapper mapper = new ObjectMapper();
 			return mapper.writeValueAsString(consumer.getMap());
-				
+
 		} else if (VisualizationFrameworkConstants.COAUTHOR_UTILS_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
-			
-			
-			
+
+
+
 			String individualLocalName = UtilityFunctions.getIndividualLocalName(
 					individualURI,
 					vitroRequest);
 
 			if (StringUtils.isNotBlank(individualLocalName)) {
-			
+
 				return UrlBuilder.getUrl(VisualizationFrameworkConstants.SHORT_URL_VISUALIZATION_REQUEST_PREFIX)
-				 			+ "/" + VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL 
+				 			+ "/" + VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL
 				 			+ "/" + individualLocalName;
-				
-			} 
-			
+
+			}
+
 			ParamMap coAuthorProfileURLParams = new ParamMap(
 					VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY,
 					individualURI,
@@ -218,25 +218,25 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 			return UrlBuilder.getUrl(
 						VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX,
 						coAuthorProfileURLParams);
-			
+
 		} else if (VisualizationFrameworkConstants.COPI_UTILS_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
-			
-			
+
+
 			String individualLocalName = UtilityFunctions.getIndividualLocalName(
 					individualURI,
 					vitroRequest);
 
 			if (StringUtils.isNotBlank(individualLocalName)) {
-			
+
 				return UrlBuilder.getUrl(VisualizationFrameworkConstants.SHORT_URL_VISUALIZATION_REQUEST_PREFIX)
 				 			+ "/" + VisualizationFrameworkConstants.COINVESTIGATOR_VIS_SHORT_URL
 				 			+ "/" + individualLocalName;
-				
-			} 
-			
+
+			}
+
 	    	/*
-	    	 * By default we will be generating profile url else some specific url like 
+	    	 * By default we will be generating profile url else some specific url like
 	    	 * coPI vis url for that individual.
 	    	 * */
 			ParamMap coInvestigatorProfileURLParams = new ParamMap(
@@ -246,15 +246,15 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 								VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
 								VisualizationFrameworkConstants.VIS_MODE_KEY,
 								VisualizationFrameworkConstants.COPI_VIS_MODE);
-			
+
 			return UrlBuilder.getUrl(
 							VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX,
 							coInvestigatorProfileURLParams);
-			
+
 		} else if (VisualizationFrameworkConstants.PERSON_LEVEL_UTILS_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
 	    	/*
-	    	 * By default we will be generating profile url else some specific url like 
+	    	 * By default we will be generating profile url else some specific url like
 	    	 * coAuthorShip vis url for that individual.
 	    	 * */
 			ParamMap personLevelURLParams = new ParamMap(
@@ -264,34 +264,34 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 							VisualizationFrameworkConstants.PERSON_LEVEL_VIS,
 							VisualizationFrameworkConstants.RENDER_MODE_KEY,
 							VisualizationFrameworkConstants.STANDALONE_RENDER_MODE);
-			
+
 			return UrlBuilder.getUrl(
 							VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX,
 							personLevelURLParams);
-			
+
 		} else if (VisualizationFrameworkConstants.HIGHEST_LEVEL_ORGANIZATION_VIS_MODE
 						.equalsIgnoreCase(visMode)) {
-			
+
 			String staffProvidedHighestLevelOrganization = ConfigurationProperties
 						.getBean(vitroRequest).getProperty("visualization.topLevelOrg");
-			
+
 			/*
-			 * First checking if the staff has provided highest level organization in 
+			 * First checking if the staff has provided highest level organization in
 			 * deploy.properties if so use to temporal graph vis.
 			 * */
 			if (StringUtils.isNotBlank(staffProvidedHighestLevelOrganization)) {
-				
+
 				/*
 	        	 * To test for the validity of the URI submitted.
 	        	 * */
 	        	IRIFactory iRIFactory = IRIFactory.jenaImplementation();
 	    		IRI iri = iRIFactory.create(staffProvidedHighestLevelOrganization);
-	            
+
 	    		if (iri.hasViolation(false)) {
-	            	
+
 	                String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage();
 	                log.error("Highest Level Organization URI provided is invalid " + errorMsg);
-	                
+
 	            } else {
 
 					ParamMap highestLevelOrganizationTemporalGraphVisURLParams = new ParamMap(
@@ -303,30 +303,30 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 					return UrlBuilder.getUrl(
 							VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX,
 							highestLevelOrganizationTemporalGraphVisURLParams);
-					
+
 	            }
 			}
-			
+
 			Map fieldLabelToOutputFieldLabel = new HashMap();
-			fieldLabelToOutputFieldLabel.put("organization", 
+			fieldLabelToOutputFieldLabel.put("organization",
 											  QueryFieldLabels.ORGANIZATION_URL);
-			fieldLabelToOutputFieldLabel.put("organizationLabel", 
+			fieldLabelToOutputFieldLabel.put("organizationLabel",
 											 QueryFieldLabels.ORGANIZATION_LABEL);
-			
+
 			String aggregationRules = "(count(?organization) AS ?numOfChildren)";
-			
-			String whereClause = "?organization rdf:type foaf:Organization ;" 
-								+ " rdfs:label ?organizationLabel . \n"  
+
+			String whereClause = "?organization rdf:type foaf:Organization ;"
+								+ " rdfs:label ?organizationLabel . \n"
 							    + "OPTIONAL { ?organization core:http://purl.obolibrary.org/obo/BFO_0000051 ?subOrg  . \n"
 						        + "           ?subOrg rdf:type foaf:Organization } . \n"
 							    + "OPTIONAL { ?organization core:http://purl.obolibrary.org/obo/BFO_0000050 ?parent } . \n"
 				                + "           ?parent rdf:type foaf:Organization } . \n"
 							    + "FILTER ( !bound(?parent) ). \n";
-			
-			String groupOrderClause = "GROUP BY ?organization ?organizationLabel \n" 
-										+ "ORDER BY DESC(?numOfChildren)\n" 
+
+			String groupOrderClause = "GROUP BY ?organization ?organizationLabel \n"
+										+ "ORDER BY DESC(?numOfChildren)\n"
 										+ "LIMIT 1\n";
-			
+
 			GenericQueryRunner highestLevelOrganizationQueryHandler =
 					new GenericQueryRunner(fieldLabelToOutputFieldLabel,
 											aggregationRules,
@@ -337,13 +337,13 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 			HighetTopLevelOrgTemporalGraphURLConsumer consumer = new HighetTopLevelOrgTemporalGraphURLConsumer(vitroRequest, fieldLabelToOutputFieldLabel);
 			highestLevelOrganizationQueryHandler.sparqlSelectQuery(vitroRequest.getRDFService(), consumer);
 			return consumer.getTopLevelURL();
-			
+
 		} else {
-			
+
 			ParamMap individualProfileURLParams = new ParamMap(
 							VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY,
 							individualURI);
-			
+
 			return UrlBuilder.getUrl(VisualizationFrameworkConstants.INDIVIDUAL_URL_PREFIX,
 											individualProfileURLParams);
 		}
@@ -467,13 +467,13 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 	private String getThumbnailInformation(ResultSet resultSet,
 										   Map fieldLabelToOutputFieldLabel,
 										   VitroRequest vitroRequest) {
-		
+
 		String finalThumbNailLocation = "";
-		
+
 		while (resultSet.hasNext())  {
 			QuerySolution solution = resultSet.nextSolution();
-			
-			
+
+
 		}
 		return finalThumbNailLocation;
 	}
@@ -491,12 +491,12 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
 			throws MalformedQueryParametersException {
 		throw new UnsupportedOperationException("Utilities does not provide Standard Response.");
 	}
-	
+
 	@Override
 	public ResponseValues generateVisualizationForShortURLRequests(
 			Map parameters, VitroRequest vitroRequest, Log log,
 			Dataset dataSource) throws MalformedQueryParametersException {
-		throw new UnsupportedOperationException("Utilities Visualization does not provide " 
+		throw new UnsupportedOperationException("Utilities Visualization does not provide "
 					+ "Short URL Response.");
 	}
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java
index 4793ec79..96298a78 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java
@@ -6,28 +6,28 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
 
 /**
  * This interface will make sure that VOs conveying any person's academic output like publications,
- * grants etc implement certain methods which will be used to generalize methods which are just 
- * interested in certain common properties like what was the year in which the activity was 
- * published (or started). 
+ * grants etc implement certain methods which will be used to generalize methods which are just
+ * interested in certain common properties like what was the year in which the activity was
+ * published (or started).
  * @author cdtank
  */
 public class Activity extends Individual {
-	
+
 	private String activityDate;
 	private String activityType;
 
 	public Activity(String activityURI) {
 		super(activityURI);
 	}
-	
+
 	public String getActivityURI() {
 		return this.getIndividualURI();
 	}
-	
+
 	public String getActivityLabel() {
 		return this.getIndividualLabel();
 	}
-	
+
 	public void setActivityLabel(String activityLabel) {
 		this.setIndividualLabel(activityLabel);
 	}
@@ -35,21 +35,21 @@ public class Activity extends Individual {
 	public String getActivityType() { return this.activityType; }
 
 	public void setActivityType(String activityType) { this.activityType = activityType; }
-	
+
 	/**
-	 * This method will be called to get the final/inferred year for the publication. 
+	 * This method will be called to get the final/inferred year for the publication.
 	 * The 2 choices, in order, are,
-	 * 		1. parsed year from xs:DateTime object saved in core:dateTimeValue 
-	 * 		2. Default Publication Year 
+	 * 		1. parsed year from xs:DateTime object saved in core:dateTimeValue
+	 * 		2. Default Publication Year
 	 */
 	public String getParsedActivityYear() {
-		
+
 		return UtilityFunctions.getValidYearFromCoreDateTimeString(activityDate,
 				VOConstants.DEFAULT_ACTIVITY_YEAR);
 	}
-	
+
 	/**
-	 * This method should be used to get the raw date & not the parsed publication year. 
+	 * This method should be used to get the raw date & not the parsed publication year.
 	 * For the later use getParsedPublicationYear.
 	 */
 	public String getActivityDate() {
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaboration.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaboration.java
index ebe666bf..bc787352 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaboration.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaboration.java
@@ -1,153 +1,153 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-
-/**
- * 
- * This is stores collaboration information mainly for ego-centric visualizations.
- * 
- * @author cdtank
- *
- */
-public class Collaboration {
-
-	private int collaborationID;
-	private Map yearToActivityCount;
-	private Set activities = new HashSet();
-	private Collaborator sourceCollaborator;
-	private Collaborator targetCollaborator;
-
-	public Collaboration(Collaborator sourceCollaborator, 
-						 Collaborator  targetCollaborator, 
-						 Activity seedActivity,
-						 UniqueIDGenerator uniqueIDGenerator) {
-		collaborationID = uniqueIDGenerator.getNextNumericID();
-		this.sourceCollaborator = sourceCollaborator;
-		this.targetCollaborator = targetCollaborator;
-		this.activities.add(seedActivity);
-	}
-
-	public int getCollaborationID() {
-		return collaborationID;
-	}
-	
-	public Collaborator getSourceCollaborator() {
-		return sourceCollaborator;
-	}
-
-	public Collaborator getTargetCollaborator() {
-		return targetCollaborator;
-	}
-	
-	public Set getCollaborationActivities() {
-		return activities;
-	}
-	
-	public int getNumOfCollaborations() {
-		return activities.size();
-	}
-
-	public void addActivity(Activity activity) {
-		this.activities.add(activity);
-	}
-	
-	public Map getYearToActivityCount() {
-		if (yearToActivityCount == null) {
-			yearToActivityCount = UtilityFunctions.getYearToActivityCount(activities);
-		}
-		return yearToActivityCount;
-	}
-	
-	/*
-	 * getEarliest, Latest & Unknown Activity YearCount should only be used after 
-	 * the parsing of the entire sparql is done. Else it will give results based on
-	 * incomplete dataset.
-	 * */
-	@SuppressWarnings("serial")
-	public Map getEarliestCollaborationYearCount() {
-
-		/*
-		 * We do not want to consider the default Activity year when we are checking 
-		 * for the min or max Activity year. 
-		 * */
-		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
-																	.keySet());
-		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * There can be a case when the only Activity the author has no attached year to it
-		 * so essentially an "Unknown". In that case Collections.max or min will throw an 
-		 * NoSuchElementException.
-		 * 
-		 * If there is no maximum year available then we should imply so by returning a "null".
-		 * */
-		if (yearsToBeConsidered.size() > 0) {
-			final String earliestYear = Collections.min(yearsToBeConsidered);
-			final Integer earliestYearActivityCount = this.getYearToActivityCount()
-															.get(earliestYear);
-			
-			return new HashMap() { {
-				put(earliestYear, earliestYearActivityCount);
-			} };
-		} else {
-			return null;
-		}
-	}
-
-	@SuppressWarnings("serial")
-	public Map getLatestCollaborationYearCount() {
-		
-		/*
-		 * We do not want to consider the default Activity year when we are checking 
-		 * for the min or max Activity year. 
-		 * */
-		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
-																	.keySet());
-		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * There can be a case when the only Activity the collaborator has no attached year to it
-		 * so essentially an "Unknown". In that case Collections.max or min will throw an 
-		 * NoSuchElementException.
-		 * 
-		 * If there is no maximum year available then we should imply so by returning a "null".
-		 * */
-		if (yearsToBeConsidered.size() > 0) {
-			final String latestYear = Collections.max(yearsToBeConsidered);
-			final Integer latestYearActivityCount = this.getYearToActivityCount().get(latestYear);
-			
-			return new HashMap() { {
-				put(latestYear, latestYearActivityCount);
-			} };
-		} else {
-			return null;
-		}
-	}
-	
-	public Integer getUnknownCollaborationYearCount() {
-		
-		Integer unknownYearActivityCount = this.getYearToActivityCount()
-										.get(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * If there is no unknown year available then we should imply so by returning a "null".
-		 * */
-		if (unknownYearActivityCount != null) {
-			return unknownYearActivityCount;
-		} else {
-			return null;
-		}
-	}
-	
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+
+/**
+ *
+ * This is stores collaboration information mainly for ego-centric visualizations.
+ *
+ * @author cdtank
+ *
+ */
+public class Collaboration {
+
+	private int collaborationID;
+	private Map yearToActivityCount;
+	private Set activities = new HashSet();
+	private Collaborator sourceCollaborator;
+	private Collaborator targetCollaborator;
+
+	public Collaboration(Collaborator sourceCollaborator,
+						 Collaborator  targetCollaborator,
+						 Activity seedActivity,
+						 UniqueIDGenerator uniqueIDGenerator) {
+		collaborationID = uniqueIDGenerator.getNextNumericID();
+		this.sourceCollaborator = sourceCollaborator;
+		this.targetCollaborator = targetCollaborator;
+		this.activities.add(seedActivity);
+	}
+
+	public int getCollaborationID() {
+		return collaborationID;
+	}
+
+	public Collaborator getSourceCollaborator() {
+		return sourceCollaborator;
+	}
+
+	public Collaborator getTargetCollaborator() {
+		return targetCollaborator;
+	}
+
+	public Set getCollaborationActivities() {
+		return activities;
+	}
+
+	public int getNumOfCollaborations() {
+		return activities.size();
+	}
+
+	public void addActivity(Activity activity) {
+		this.activities.add(activity);
+	}
+
+	public Map getYearToActivityCount() {
+		if (yearToActivityCount == null) {
+			yearToActivityCount = UtilityFunctions.getYearToActivityCount(activities);
+		}
+		return yearToActivityCount;
+	}
+
+	/*
+	 * getEarliest, Latest & Unknown Activity YearCount should only be used after
+	 * the parsing of the entire sparql is done. Else it will give results based on
+	 * incomplete dataset.
+	 * */
+	@SuppressWarnings("serial")
+	public Map getEarliestCollaborationYearCount() {
+
+		/*
+		 * We do not want to consider the default Activity year when we are checking
+		 * for the min or max Activity year.
+		 * */
+		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
+																	.keySet());
+		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * There can be a case when the only Activity the author has no attached year to it
+		 * so essentially an "Unknown". In that case Collections.max or min will throw an
+		 * NoSuchElementException.
+		 *
+		 * If there is no maximum year available then we should imply so by returning a "null".
+		 * */
+		if (yearsToBeConsidered.size() > 0) {
+			final String earliestYear = Collections.min(yearsToBeConsidered);
+			final Integer earliestYearActivityCount = this.getYearToActivityCount()
+															.get(earliestYear);
+
+			return new HashMap() { {
+				put(earliestYear, earliestYearActivityCount);
+			} };
+		} else {
+			return null;
+		}
+	}
+
+	@SuppressWarnings("serial")
+	public Map getLatestCollaborationYearCount() {
+
+		/*
+		 * We do not want to consider the default Activity year when we are checking
+		 * for the min or max Activity year.
+		 * */
+		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
+																	.keySet());
+		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * There can be a case when the only Activity the collaborator has no attached year to it
+		 * so essentially an "Unknown". In that case Collections.max or min will throw an
+		 * NoSuchElementException.
+		 *
+		 * If there is no maximum year available then we should imply so by returning a "null".
+		 * */
+		if (yearsToBeConsidered.size() > 0) {
+			final String latestYear = Collections.max(yearsToBeConsidered);
+			final Integer latestYearActivityCount = this.getYearToActivityCount().get(latestYear);
+
+			return new HashMap() { {
+				put(latestYear, latestYearActivityCount);
+			} };
+		} else {
+			return null;
+		}
+	}
+
+	public Integer getUnknownCollaborationYearCount() {
+
+		Integer unknownYearActivityCount = this.getYearToActivityCount()
+										.get(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * If there is no unknown year available then we should imply so by returning a "null".
+		 * */
+		if (unknownYearActivityCount != null) {
+			return unknownYearActivityCount;
+		} else {
+			return null;
+		}
+	}
+
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaborator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaborator.java
index d2c5bc40..325fd63f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaborator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Collaborator.java
@@ -1,150 +1,150 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator;
-import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
-
-/**
- * 
- * This stores collbaorator's information involved in ego-centric networks & represents
- * a collaborator's activities.
- * 
- * @author cdtank
- */
-public class Collaborator extends Individual {
-
-	private int collaboratorID;
-	private Map yearToActivityCount;
-
-	private Set activities = new HashSet();
-
-	public Collaborator(String collaboratorURI,
-				UniqueIDGenerator uniqueIDGenerator) {
-		super(collaboratorURI);
-		collaboratorID = uniqueIDGenerator.getNextNumericID();
-	}
-
-	public int getCollaboratorID() {
-		return collaboratorID;
-	}
-	
-	public String getCollaboratorURI() {
-		return this.getIndividualURI();
-	}
-
-	public String getCollaboratorName() {
-		return this.getIndividualLabel();
-	}
-	
-	public void setCollaboratorName(String collaboratorName) {
-		this.setIndividualLabel(collaboratorName);
-	}
-	
-	public Set getCollaboratorActivities() {
-		return activities;
-	}
-	
-	public int getNumOfActivities() {
-		return activities.size();
-	}
-
-	public void addActivity(Activity activity) {
-		this.activities.add(activity);
-	}
-	
-	public Map getYearToActivityCount() {
-		if (yearToActivityCount == null) {
-			yearToActivityCount = UtilityFunctions.getYearToActivityCount(activities);
-		}
-		return yearToActivityCount;
-	}
-	
-	/*
-	 * getEarliest, Latest & Unknown Collaborator YearCount should only be used after 
-	 * the parsing of the entire sparql is done. Else it will give results based on
-	 * incomplete dataset.
-	 * */
-	@SuppressWarnings("serial")
-	public Map getEarliestActivityYearCount() {
-
-		/*
-		 * We do not want to consider the default activity year when we are checking 
-		 * for the min or max activity year. 
-		 * */
-		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
-																	.keySet());
-		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * There can be a case when the only activity the collaborator has no attached year to it
-		 * so essentially an "Unknown". In that case Collections.max or min will throw an 
-		 * NoSuchElementException.
-		 * 
-		 * If there is no maximum year available then we should imply so by returning a "null".
-		 * */
-		if (yearsToBeConsidered.size() > 0) {
-			final String earliestYear = Collections.min(yearsToBeConsidered);
-			final Integer earliestYearActivityCount = this.getYearToActivityCount()
-															.get(earliestYear);
-			
-			return new HashMap() { {
-				put(earliestYear, earliestYearActivityCount);
-			} };
-		} else {
-			return null;
-		}
-	}
-
-	@SuppressWarnings("serial")
-	public Map getLatestActivityYearCount() {
-
-		/*
-		 * We do not want to consider the default Activity year when we are checking 
-		 * for the min or max Activity year. 
-		 * */
-		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
-																	.keySet());
-		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * There can be a case when the only Activity the author has no attached year to it
-		 * so essentially an "Unknown". In that case Collections.max or min will throw an 
-		 * NoSuchElementException.
-		 * 
-		 * If there is no maximum year available then we should imply so by returning a "null".
-		 * */
-		if (yearsToBeConsidered.size() > 0) {
-			final String latestYear = Collections.max(yearsToBeConsidered);
-			final Integer latestYearActivityCount = this.getYearToActivityCount().get(latestYear);
-			
-			return new HashMap() { {
-				put(latestYear, latestYearActivityCount);
-			} };
-		} else {
-			return null;
-		}
-	}
-	
-	public Integer getUnknownActivityYearCount() {
-		
-		Integer unknownYearActivityCount = this.getYearToActivityCount()
-											.get(VOConstants.DEFAULT_ACTIVITY_YEAR);
-		
-		/*
-		 * If there is no unknown year available then we should imply so by returning a "null".
-		 * */
-		if (unknownYearActivityCount != null) {
-			return unknownYearActivityCount;
-		} else {
-			return null;
-		}
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UniqueIDGenerator;
+import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
+
+/**
+ *
+ * This stores collbaorator's information involved in ego-centric networks & represents
+ * a collaborator's activities.
+ *
+ * @author cdtank
+ */
+public class Collaborator extends Individual {
+
+	private int collaboratorID;
+	private Map yearToActivityCount;
+
+	private Set activities = new HashSet();
+
+	public Collaborator(String collaboratorURI,
+				UniqueIDGenerator uniqueIDGenerator) {
+		super(collaboratorURI);
+		collaboratorID = uniqueIDGenerator.getNextNumericID();
+	}
+
+	public int getCollaboratorID() {
+		return collaboratorID;
+	}
+
+	public String getCollaboratorURI() {
+		return this.getIndividualURI();
+	}
+
+	public String getCollaboratorName() {
+		return this.getIndividualLabel();
+	}
+
+	public void setCollaboratorName(String collaboratorName) {
+		this.setIndividualLabel(collaboratorName);
+	}
+
+	public Set getCollaboratorActivities() {
+		return activities;
+	}
+
+	public int getNumOfActivities() {
+		return activities.size();
+	}
+
+	public void addActivity(Activity activity) {
+		this.activities.add(activity);
+	}
+
+	public Map getYearToActivityCount() {
+		if (yearToActivityCount == null) {
+			yearToActivityCount = UtilityFunctions.getYearToActivityCount(activities);
+		}
+		return yearToActivityCount;
+	}
+
+	/*
+	 * getEarliest, Latest & Unknown Collaborator YearCount should only be used after
+	 * the parsing of the entire sparql is done. Else it will give results based on
+	 * incomplete dataset.
+	 * */
+	@SuppressWarnings("serial")
+	public Map getEarliestActivityYearCount() {
+
+		/*
+		 * We do not want to consider the default activity year when we are checking
+		 * for the min or max activity year.
+		 * */
+		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
+																	.keySet());
+		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * There can be a case when the only activity the collaborator has no attached year to it
+		 * so essentially an "Unknown". In that case Collections.max or min will throw an
+		 * NoSuchElementException.
+		 *
+		 * If there is no maximum year available then we should imply so by returning a "null".
+		 * */
+		if (yearsToBeConsidered.size() > 0) {
+			final String earliestYear = Collections.min(yearsToBeConsidered);
+			final Integer earliestYearActivityCount = this.getYearToActivityCount()
+															.get(earliestYear);
+
+			return new HashMap() { {
+				put(earliestYear, earliestYearActivityCount);
+			} };
+		} else {
+			return null;
+		}
+	}
+
+	@SuppressWarnings("serial")
+	public Map getLatestActivityYearCount() {
+
+		/*
+		 * We do not want to consider the default Activity year when we are checking
+		 * for the min or max Activity year.
+		 * */
+		Set yearsToBeConsidered = new HashSet(this.getYearToActivityCount()
+																	.keySet());
+		yearsToBeConsidered.remove(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * There can be a case when the only Activity the author has no attached year to it
+		 * so essentially an "Unknown". In that case Collections.max or min will throw an
+		 * NoSuchElementException.
+		 *
+		 * If there is no maximum year available then we should imply so by returning a "null".
+		 * */
+		if (yearsToBeConsidered.size() > 0) {
+			final String latestYear = Collections.max(yearsToBeConsidered);
+			final Integer latestYearActivityCount = this.getYearToActivityCount().get(latestYear);
+
+			return new HashMap() { {
+				put(latestYear, latestYearActivityCount);
+			} };
+		} else {
+			return null;
+		}
+	}
+
+	public Integer getUnknownActivityYearCount() {
+
+		Integer unknownYearActivityCount = this.getYearToActivityCount()
+											.get(VOConstants.DEFAULT_ACTIVITY_YEAR);
+
+		/*
+		 * If there is no unknown year available then we should imply so by returning a "null".
+		 * */
+		if (unknownYearActivityCount != null) {
+			return unknownYearActivityCount;
+		} else {
+			return null;
+		}
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModel.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModel.java
index 5dfcbf16..cab6a2be 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModel.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModel.java
@@ -5,7 +5,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor.ModelCons
 
 @SuppressWarnings("deprecation")
 public class ConstructedModel {
-	
+
 	private String uri;
 	private String individualLabel;
 	private String type;
@@ -16,7 +16,7 @@ public class ConstructedModel {
 		this.humanReadableType = ModelConstructorUtilities.modelTypeToHumanReadableName.get(type);
 		this.uri = uri == null ? "" : uri;
 	}
-	
+
 	public String getUri() {
 		return uri;
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModelTracker.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModelTracker.java
index da4e5c3b..fb48d38d 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModelTracker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/ConstructedModelTracker.java
@@ -11,38 +11,38 @@ import org.apache.jena.rdf.model.Model;
 import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.IllegalConstructedModelIdentifierException;
 
 public class ConstructedModelTracker {
-	
+
 	private static Map modelIdentifierToConstructedModel = new HashMap();
-	
+
 	public static void trackModel(String identifier, Model model) {
 		modelIdentifierToConstructedModel.put(identifier, model);
 	}
-	
+
 	public static Model getModel(String identifier) {
 		return modelIdentifierToConstructedModel.get(identifier);
 	}
-	
+
 	public static Model removeModel(String uri, String modelType) {
 		return modelIdentifierToConstructedModel.remove(generateModelIdentifier(uri, modelType));
 	}
-	
+
 	public static String generateModelIdentifier(String uri, String modelType) {
-		
+
 		if (uri == null) {
 			uri = "";
 		}
 		return modelType +  "$" + uri;
 	}
-	
+
 	public static Map getAllModels() {
 		return modelIdentifierToConstructedModel;
 	}
-	
-	public static ConstructedModel parseModelIdentifier(String modelIdentifier) 
+
+	public static ConstructedModel parseModelIdentifier(String modelIdentifier)
 			throws IllegalConstructedModelIdentifierException {
-		
+
 		String[] parts = StringUtils.split(modelIdentifier, '$');
-		
+
 		if (parts.length == 0) {
 			throw new IllegalConstructedModelIdentifierException(modelIdentifier + " provided.");
 		} else if (parts.length == 1) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Entity.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Entity.java
index a3ec63aa..3ad97bbd 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Entity.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Entity.java
@@ -7,29 +7,29 @@ import java.util.Set;
 
 /**
  * original @author bkoniden (Deepak Konidena)
- * modified by @author cdtank (Chintan Tank) 
+ * modified by @author cdtank (Chintan Tank)
  */
 public class Entity extends Individual {
-	
+
 	private Set parents = new LinkedHashSet();
 	private Set children = new LinkedHashSet();
-	
+
 	public Entity(String entityURI, String entityLabel) {
 		super(entityURI, entityLabel);
 	}
-	
+
 	public Entity(String entityURI) {
 		super(entityURI);
 	}
-	
+
 	public String getEntityURI() {
 		return this.getIndividualURI();
 	}
-	
+
 	public String getEntityLabel() {
 		return this.getIndividualLabel();
 	}
-	
+
 	public void setEntityLabel(String label) {
 		this.setIndividualLabel(label);
 	}
@@ -37,7 +37,7 @@ public class Entity extends Individual {
 	public Set getSubEntities() {
 		return children;
 	}
-	
+
 	public Set getParents() {
 		return parents;
 	}
@@ -45,13 +45,13 @@ public class Entity extends Individual {
 	public void addSubEntity(SubEntity subEntity) {
 		this.children.add(subEntity);
 	}
-	
+
 	public void addSubEntitities(Collection subEntities) {
 		this.children.addAll(subEntities);
 	}
-	
+
 	public void addParents(Collection parents) {
 		this.parents.addAll(parents);
 	}
-	
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/GenericQueryMap.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/GenericQueryMap.java
index fde0df83..de8f4a99 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/GenericQueryMap.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/GenericQueryMap.java
@@ -1,41 +1,41 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Right now this is just acting as a hashmap but in future we would want to provide
- * more detailed info other than just what properties had what values. E.g. we
- * could parse properties (& its values) to look for what namespaces are used. 
- * 
- * @author cdtank
- */
-@SuppressWarnings("serial")
-public class GenericQueryMap extends HashMap> {
-
-	public GenericQueryMap() {
-		super();
-	}
-	
-	public void addEntry(String property, String value) {
-		
-		Set values;
-		
-		if (this.containsKey(property)) {
-			
-			values = this.get(property);
-			values.add(value);
-			
-		} else {
-			
-			values = new HashSet();
-			values.add(value);
-			this.put(property, values);
-			
-		}
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Right now this is just acting as a hashmap but in future we would want to provide
+ * more detailed info other than just what properties had what values. E.g. we
+ * could parse properties (& its values) to look for what namespaces are used.
+ *
+ * @author cdtank
+ */
+@SuppressWarnings("serial")
+public class GenericQueryMap extends HashMap> {
+
+	public GenericQueryMap() {
+		super();
+	}
+
+	public void addEntry(String property, String value) {
+
+		Set values;
+
+		if (this.containsKey(property)) {
+
+			values = this.get(property);
+			values.add(value);
+
+		} else {
+
+			values = new HashSet();
+			values.add(value);
+			this.put(property, values);
+
+		}
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Individual.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Individual.java
index af8cada7..8bd40c89 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Individual.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Individual.java
@@ -1,32 +1,32 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
-
-public class Individual {
-	
-	private String individualLabel;
-	private String individualURI;
-	
-	public Individual(String individualURI, String individualLabel) {
-		this.individualURI = individualURI;
-		this.individualLabel = individualLabel;
-	}
-	
-	public Individual(String individualURI) {
-		this(individualURI, "");
-	}
-	
-	public String getIndividualLabel() {
-		return individualLabel;
-	}
-	
-	public void setIndividualLabel(String individualLabel) {
-		this.individualLabel = individualLabel;
-	}
-
-	public String getIndividualURI() {
-		return individualURI;
-	}
-	
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
+
+public class Individual {
+
+	private String individualLabel;
+	private String individualURI;
+
+	public Individual(String individualURI, String individualLabel) {
+		this.individualURI = individualURI;
+		this.individualLabel = individualLabel;
+	}
+
+	public Individual(String individualURI) {
+		this(individualURI, "");
+	}
+
+	public String getIndividualLabel() {
+		return individualLabel;
+	}
+
+	public void setIndividualLabel(String individualLabel) {
+		this.individualLabel = individualLabel;
+	}
+
+	public String getIndividualURI() {
+		return individualURI;
+	}
+
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/MapOfScienceActivity.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/MapOfScienceActivity.java
index 3e9fee18..5b0a4e91 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/MapOfScienceActivity.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/MapOfScienceActivity.java
@@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
 public class MapOfScienceActivity extends Activity {
 
 	private String publishedInJournal;
-	
+
 	public MapOfScienceActivity(String activityURI) {
 		super(activityURI);
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SparklineData.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SparklineData.java
index 37685b92..324f8945 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SparklineData.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SparklineData.java
@@ -1,167 +1,167 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
-
-import java.util.List;
-import java.util.Map;
-
-public class SparklineData {
-	
-	private Integer earliestYearConsidered;
-	private Integer earliestRenderedPublicationYear;
-	private Integer latestRenderedPublicationYear;
-	private Integer earliestRenderedGrantYear;
-	private Integer latestRenderedGrantYear;
-	
-	private Integer renderedSparks;
-	private Integer unknownYearPublications;
-	private Integer unknownYearGrants;
-	
-	private Integer totalCollaborationshipCount;
-	
-	private Map yearToActivityCount;
-	
-	private String downloadDataLink = "";
-	private String fullTimelineNetworkLink = "";
-	
-	private String visContainerDivID = "pub_count_vis_container";
-	
-	private boolean isShortVisMode = true;
-	
-	private List yearToEntityCountDataTable;
-	
-	private int numOfYearsToBeRendered;
-
-	public void setTotalCollaborationshipCount(
-			Integer totalCollaborationshipCount) {
-		this.totalCollaborationshipCount = totalCollaborationshipCount;
-	}
-
-	public Integer getTotalCollaborationshipCount() {
-		return totalCollaborationshipCount;
-	}
-
-	public Integer getEarliestRenderedGrantYear() {
-		return earliestRenderedGrantYear;
-	}
-
-	public void setEarliestRenderedGrantYear(Integer earliestRenderedGrantYear) {
-		this.earliestRenderedGrantYear = earliestRenderedGrantYear;
-	}
-
-	public Integer getLatestRenderedGrantYear() {
-		return latestRenderedGrantYear;
-	}
-
-	public void setLatestRenderedGrantYear(Integer latestRenderedGrantYear) {
-		this.latestRenderedGrantYear = latestRenderedGrantYear;
-	}
-
-	public Integer getUnknownYearGrants() {
-		return unknownYearGrants;
-	}
-
-	public void setUnknownYearGrants(Integer unknownYearGrants) {
-		this.unknownYearGrants = unknownYearGrants;
-	}
-
-	public void setNumOfYearsToBeRendered(int numOfYearsToBeRendered) {
-		this.numOfYearsToBeRendered = numOfYearsToBeRendered;
-	}
-
-	public int getNumOfYearsToBeRendered() {
-		return numOfYearsToBeRendered;
-	}
-
-	public void setYearToEntityCountDataTable(
-			List yearToEntityCountDataTable) {
-		this.yearToEntityCountDataTable = yearToEntityCountDataTable;
-	}
-
-	public List getYearToEntityCountDataTable() {
-		return yearToEntityCountDataTable;
-	}
-
-	public void setYearToActivityCount(Map yearToActivityCount) {
-		this.yearToActivityCount = yearToActivityCount;
-	}
-
-	public Map getYearToActivityCount() {
-		return yearToActivityCount;
-	}
-
-	public void setEarliestYearConsidered(Integer earliestYearConsidered) {
-		this.earliestYearConsidered = earliestYearConsidered;
-	}
-
-	public Integer getEarliestYearConsidered() {
-		return earliestYearConsidered;
-	}
-
-	public Integer getEarliestRenderedPublicationYear() {
-		return earliestRenderedPublicationYear;
-	}
-	
-	public void setEarliestRenderedPublicationYear(
-			Integer earliestRenderedPublicationYear) {
-		this.earliestRenderedPublicationYear = earliestRenderedPublicationYear;
-	}
-	
-	public Integer getLatestRenderedPublicationYear() {
-		return latestRenderedPublicationYear;
-	}
-	
-	public void setLatestRenderedPublicationYear(
-			Integer latestRenderedPublicationYear) {
-		this.latestRenderedPublicationYear = latestRenderedPublicationYear;
-	}
-	
-	public void setUnknownYearPublications(Integer unknownYearPublications) {
-		this.unknownYearPublications = unknownYearPublications;
-	}
-
-	public Integer getUnknownYearPublications() {
-		return unknownYearPublications;
-	}
-
-	public void setRenderedSparks(Integer renderedSparks) {
-		this.renderedSparks = renderedSparks;
-	}
-
-	public Integer getRenderedSparks() {
-		return renderedSparks;
-	}
-
-	public String getDownloadDataLink() {
-		return downloadDataLink;
-	}
-	
-	public void setDownloadDataLink(String downloadDataLink) {
-		this.downloadDataLink = downloadDataLink;
-	}
-	
-	public String getFullTimelineNetworkLink() {
-		return fullTimelineNetworkLink;
-	}
-	
-	public void setFullTimelineNetworkLink(String fullTimelineNetworkLink) {
-		this.fullTimelineNetworkLink = fullTimelineNetworkLink;
-	}
-	
-	public void setVisContainerDivID(String visContainerDivID) {
-		this.visContainerDivID = visContainerDivID;
-	}
-
-	public String getVisContainerDivID() {
-		return visContainerDivID;
-	}
-
-	public void setShortVisMode(boolean isShortVisMode) {
-		this.isShortVisMode = isShortVisMode;
-	}
-
-	public boolean isShortVisMode() {
-		return isShortVisMode;
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
+
+import java.util.List;
+import java.util.Map;
+
+public class SparklineData {
+
+	private Integer earliestYearConsidered;
+	private Integer earliestRenderedPublicationYear;
+	private Integer latestRenderedPublicationYear;
+	private Integer earliestRenderedGrantYear;
+	private Integer latestRenderedGrantYear;
+
+	private Integer renderedSparks;
+	private Integer unknownYearPublications;
+	private Integer unknownYearGrants;
+
+	private Integer totalCollaborationshipCount;
+
+	private Map yearToActivityCount;
+
+	private String downloadDataLink = "";
+	private String fullTimelineNetworkLink = "";
+
+	private String visContainerDivID = "pub_count_vis_container";
+
+	private boolean isShortVisMode = true;
+
+	private List yearToEntityCountDataTable;
+
+	private int numOfYearsToBeRendered;
+
+	public void setTotalCollaborationshipCount(
+			Integer totalCollaborationshipCount) {
+		this.totalCollaborationshipCount = totalCollaborationshipCount;
+	}
+
+	public Integer getTotalCollaborationshipCount() {
+		return totalCollaborationshipCount;
+	}
+
+	public Integer getEarliestRenderedGrantYear() {
+		return earliestRenderedGrantYear;
+	}
+
+	public void setEarliestRenderedGrantYear(Integer earliestRenderedGrantYear) {
+		this.earliestRenderedGrantYear = earliestRenderedGrantYear;
+	}
+
+	public Integer getLatestRenderedGrantYear() {
+		return latestRenderedGrantYear;
+	}
+
+	public void setLatestRenderedGrantYear(Integer latestRenderedGrantYear) {
+		this.latestRenderedGrantYear = latestRenderedGrantYear;
+	}
+
+	public Integer getUnknownYearGrants() {
+		return unknownYearGrants;
+	}
+
+	public void setUnknownYearGrants(Integer unknownYearGrants) {
+		this.unknownYearGrants = unknownYearGrants;
+	}
+
+	public void setNumOfYearsToBeRendered(int numOfYearsToBeRendered) {
+		this.numOfYearsToBeRendered = numOfYearsToBeRendered;
+	}
+
+	public int getNumOfYearsToBeRendered() {
+		return numOfYearsToBeRendered;
+	}
+
+	public void setYearToEntityCountDataTable(
+			List yearToEntityCountDataTable) {
+		this.yearToEntityCountDataTable = yearToEntityCountDataTable;
+	}
+
+	public List getYearToEntityCountDataTable() {
+		return yearToEntityCountDataTable;
+	}
+
+	public void setYearToActivityCount(Map yearToActivityCount) {
+		this.yearToActivityCount = yearToActivityCount;
+	}
+
+	public Map getYearToActivityCount() {
+		return yearToActivityCount;
+	}
+
+	public void setEarliestYearConsidered(Integer earliestYearConsidered) {
+		this.earliestYearConsidered = earliestYearConsidered;
+	}
+
+	public Integer getEarliestYearConsidered() {
+		return earliestYearConsidered;
+	}
+
+	public Integer getEarliestRenderedPublicationYear() {
+		return earliestRenderedPublicationYear;
+	}
+
+	public void setEarliestRenderedPublicationYear(
+			Integer earliestRenderedPublicationYear) {
+		this.earliestRenderedPublicationYear = earliestRenderedPublicationYear;
+	}
+
+	public Integer getLatestRenderedPublicationYear() {
+		return latestRenderedPublicationYear;
+	}
+
+	public void setLatestRenderedPublicationYear(
+			Integer latestRenderedPublicationYear) {
+		this.latestRenderedPublicationYear = latestRenderedPublicationYear;
+	}
+
+	public void setUnknownYearPublications(Integer unknownYearPublications) {
+		this.unknownYearPublications = unknownYearPublications;
+	}
+
+	public Integer getUnknownYearPublications() {
+		return unknownYearPublications;
+	}
+
+	public void setRenderedSparks(Integer renderedSparks) {
+		this.renderedSparks = renderedSparks;
+	}
+
+	public Integer getRenderedSparks() {
+		return renderedSparks;
+	}
+
+	public String getDownloadDataLink() {
+		return downloadDataLink;
+	}
+
+	public void setDownloadDataLink(String downloadDataLink) {
+		this.downloadDataLink = downloadDataLink;
+	}
+
+	public String getFullTimelineNetworkLink() {
+		return fullTimelineNetworkLink;
+	}
+
+	public void setFullTimelineNetworkLink(String fullTimelineNetworkLink) {
+		this.fullTimelineNetworkLink = fullTimelineNetworkLink;
+	}
+
+	public void setVisContainerDivID(String visContainerDivID) {
+		this.visContainerDivID = visContainerDivID;
+	}
+
+	public String getVisContainerDivID() {
+		return visContainerDivID;
+	}
+
+	public void setShortVisMode(boolean isShortVisMode) {
+		this.isShortVisMode = isShortVisMode;
+	}
+
+	public boolean isShortVisMode() {
+		return isShortVisMode;
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SubEntity.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SubEntity.java
index c2bdbbbc..d658312b 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SubEntity.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/SubEntity.java
@@ -10,7 +10,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants;
 /**
  * @author bkoniden (Deepak Konidena)
  * modified by @author cdtank (Chintan Tank)
- * last modified at Mar 21, 2011 2:57:20 PM 
+ * last modified at Mar 21, 2011 2:57:20 PM
  */
 public class SubEntity extends Individual {
 
@@ -18,32 +18,32 @@ public class SubEntity extends Individual {
 	private Set entityTypes = new HashSet();
 	private VOConstants.EntityClassType entityClass;
 	private String lastCachedAtDateTime = null;
-	
+
 	public SubEntity(String individualURI) {
 		super(individualURI);
 	}
-	
+
 	public SubEntity(String individualURI, String individualLabel) {
 		super(individualURI, individualLabel);
 	}
-	
+
 	@Override
 	public String toString() {
 		return this.getIndividualLabel();
 	}
-	
+
 	public void addActivity(Activity activity) {
 		this.activities.add(activity);
 	}
-	
+
 	public void addActivities(Collection activities) {
 		this.activities.addAll(activities);
 	}
-	
+
 	public Set getActivities() {
 		return activities;
 	}
-	
+
 	public void addEntityTypeLabel(String typeLabel) {
 		this.entityTypes.add(typeLabel);
 	}
@@ -51,7 +51,7 @@ public class SubEntity extends Individual {
 	public Set getEntityTypeLabels() {
 		return entityTypes;
 	}
-	
+
 	public void setEntityClass(VOConstants.EntityClassType entityClass) {
 		this.entityClass = entityClass;
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/YearToEntityCountDataElement.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/YearToEntityCountDataElement.java
index eb361aeb..d89f82fb 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/YearToEntityCountDataElement.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/YearToEntityCountDataElement.java
@@ -3,7 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
 
 /**
  * This object is used to store information about the yearToEntityCount Map in the format
- * easily expressed to Google Visualization's DataTableAPI. 
+ * easily expressed to Google Visualization's DataTableAPI.
  * @author cdtank
  *
  */
@@ -12,7 +12,7 @@ public class YearToEntityCountDataElement {
 	private int yearToEntityCounter;
 	private String year;
 	private int currentEntitiesCount;
-	
+
 	public YearToEntityCountDataElement(int yearToEntityCounter,
 			String year, int currentEntitiesCount) {
 		this.yearToEntityCounter = yearToEntityCounter;
@@ -31,5 +31,5 @@ public class YearToEntityCountDataElement {
 	public int getCurrentEntitiesCount() {
 		return currentEntitiesCount;
 	}
-	
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/JsonObject.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/JsonObject.java
index 0ae885bf..25650eb6 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/JsonObject.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/JsonObject.java
@@ -9,7 +9,7 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * JsonObject is used for creating data in JSON format, 
+ * JsonObject is used for creating data in JSON format,
  * by just using the fields that are required to be included.
  * @author bkoniden
  * Deepak Konidena
@@ -33,7 +33,7 @@ public class JsonObject {
 
 	@JsonProperty
 	private List organizationType = new ArrayList();
-	
+
 	public List getOrganizationTypes() {
 		return organizationType;
 	}
@@ -41,7 +41,7 @@ public class JsonObject {
 	public void setOrganizationTypes(List organizationType) {
 		this.organizationType = organizationType;
 	}
-	
+
 	public void setOrganizationTypes(Set givenOrganizationType) {
 		this.organizationType.addAll(givenOrganizationType);
 	}
@@ -77,7 +77,7 @@ public class JsonObject {
 	public JsonObject(String label) {
 		this.label = label;
 	}
-	
+
 	public void setYearToActivityCount(List> yearToPublicationCount) {
 		this.data = yearToPublicationCount;
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/MapOfScience.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/MapOfScience.java
index 4904e19b..5e8a20ec 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/MapOfScience.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/MapOfScience.java
@@ -41,7 +41,7 @@ public class MapOfScience {
 	public MapOfScience(String uri) {
 		this.uri = uri;
 	}
-	
+
 	public void setType(String type) {
 		this.type = type;
 	}
@@ -117,7 +117,7 @@ public class MapOfScience {
 
 		@JsonProperty
 		private int pubs;
-		
+
 		public SubEntityInfo(String uri, String label, String type, int pubs) {
 			this.uri = uri;
 			this.label = label;
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/SubjectEntityJSON.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/SubjectEntityJSON.java
index 84ef1aee..dbf82767 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/SubjectEntityJSON.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/json/SubjectEntityJSON.java
@@ -19,12 +19,12 @@ public class SubjectEntityJSON {
 
 	@JsonProperty
 	private Map parentURIToLabel = new HashMap();
-	
+
 	public SubjectEntityJSON(String subjectEntityURI, String label,
 			Set parentOrganizations) {
 		this.subjectEntityURI = subjectEntityURI;
 		this.subjectEntityLabel = label;
-		
+
 		this.setParentURIToLabel(parentOrganizations);
 	}
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java
index e0b5edfe..3865527a 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java
@@ -24,9 +24,9 @@ import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.GenericQueryM
 
 
 /**
- * This query runner is used to execute a sparql query that will fetch all the 
+ * This query runner is used to execute a sparql query that will fetch all the
  * properties  available for the provided individual URI.
- * 
+ *
  * @author cdtank
  */
 public class AllPropertiesQueryRunner implements QueryRunner {
@@ -47,22 +47,22 @@ public class AllPropertiesQueryRunner implements QueryRunner {
 		this.filterRule = filterRule;
 		this.rdfService = rdfService;
 		this.log = log;
-		
+
 	}
 
 	private String generateGenericSparqlQuery(String queryURI, String filterRule) {
 //		Resource uri1 = ResourceFactory.createResource(queryURI);
 		String filterClause;
-		
+
 		if (StringUtils.isNotBlank(filterRule)) {
 			filterClause = "FILTER ( " + filterRule + " ) . ";
 		} else {
-			filterClause = "";			
+			filterClause = "";
 		}
 
 		String sparqlQuery = QueryConstants.getSparqlPrefixQuery()
 							+ "SELECT "
-							+ "		(str(?predicate) as ?" + QueryFieldLabels.PREDICATE + ") " 
+							+ "		(str(?predicate) as ?" + QueryFieldLabels.PREDICATE + ") "
 							+ "		(str(?object) as ?" + QueryFieldLabels.OBJECT + ") "
 							+ "WHERE { {"
 							+ "<" + queryURI + "> ?predicate ?object.  }"
@@ -71,12 +71,12 @@ public class AllPropertiesQueryRunner implements QueryRunner {
 							+ "?vTitle ?predicate ?object . }"
 							+ filterClause
 							+ "}";
-            	
+
         log.debug("sparqlQuery = " + sparqlQuery);
-        
+
 		return sparqlQuery;
 	}
-	
+
 	public GenericQueryMap getQueryResult()
 			throws MalformedQueryParametersException {
 		if (StringUtils.isNotBlank(this.individualURI)) {
@@ -91,7 +91,7 @@ public class AllPropertiesQueryRunner implements QueryRunner {
                 throw new MalformedQueryParametersException(
                 			"URI provided for an individual is malformed.");
             }
-            
+
         } else {
             throw new MalformedQueryParametersException("URI parameter is either null or empty.");
         }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/CachedModelConstructor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/CachedModelConstructor.java
index 53f83811..494baee8 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/CachedModelConstructor.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/CachedModelConstructor.java
@@ -9,7 +9,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 public interface CachedModelConstructor {
 
 	Model getConstructedModel() throws MalformedQueryParametersException;
-	
-	String getModelType(); 
-	
+
+	String getModelType();
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunner.java
index 276823a4..7b7cf18f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunner.java
@@ -24,9 +24,9 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 
 
 /**
- * This query runner is used to run a generic sparql query based on the "select", 
- * "where" & "filter" rules provided to it.  
- * 
+ * This query runner is used to run a generic sparql query based on the "select",
+ * "where" & "filter" rules provided to it.
+ *
  * @author cdtank
  */
 public class GenericQueryRunner implements QueryRunner {
@@ -37,7 +37,7 @@ public class GenericQueryRunner implements QueryRunner {
 	private Dataset dataset;
 
 	private Map fieldLabelToOutputFieldLabel;
-	
+
 	private Log log = LogFactory.getLog(GenericQueryRunner.class.getName());
 
 	private String groupOrderClause;
@@ -45,9 +45,9 @@ public class GenericQueryRunner implements QueryRunner {
 	private String aggregationRules;
 
 	public GenericQueryRunner(Map fieldLabelToOutputFieldLabel,
-							   String aggregationRules, 
+							   String aggregationRules,
 							   String whereClause,
-							   String groupOrderClause, 
+							   String groupOrderClause,
 							   Dataset dataset) {
 
 		this.fieldLabelToOutputFieldLabel = fieldLabelToOutputFieldLabel;
@@ -70,31 +70,31 @@ public class GenericQueryRunner implements QueryRunner {
 
 		StringBuilder sparqlQuery = new StringBuilder();
 		sparqlQuery.append(QueryConstants.getSparqlPrefixQuery());
-		
+
 		sparqlQuery.append("SELECT\n");
-		
-		for (Map.Entry currentfieldLabelToOutputFieldLabel 
+
+		for (Map.Entry currentfieldLabelToOutputFieldLabel
 				: this.fieldLabelToOutputFieldLabel.entrySet()) {
-			
+
 			sparqlQuery.append("\t(str(?").append(currentfieldLabelToOutputFieldLabel.getKey()).append(") as ?").append(currentfieldLabelToOutputFieldLabel.getValue()).append(")\n");
-			
+
 		}
-		
+
 		sparqlQuery.append("\n").append(this.aggregationRules).append("\n");
-		
+
 		sparqlQuery.append("WHERE {\n");
-		
+
 		sparqlQuery.append(this.whereClause);
-		
+
 		sparqlQuery.append("}\n");
-		
+
 		sparqlQuery.append(this.groupOrderClause);
-		
+
 		log.debug("sparqlQuery = " + sparqlQuery.toString());
-		
+
 		return sparqlQuery.toString();
 	}
-	
+
 	public ResultSet getQueryResult()
 			throws MalformedQueryParametersException {
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunnerOnModel.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunnerOnModel.java
index c2ed662d..23373979 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunnerOnModel.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/GenericQueryRunnerOnModel.java
@@ -21,9 +21,9 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 
 
 /**
- * This query runner is used to run a generic sparql query based on the "select", 
- * "where" & "filter" rules provided to it.  
- * 
+ * This query runner is used to run a generic sparql query based on the "select",
+ * "where" & "filter" rules provided to it.
+ *
  * @author cdtank
  */
 public class GenericQueryRunnerOnModel implements QueryRunner {
@@ -34,7 +34,7 @@ public class GenericQueryRunnerOnModel implements QueryRunner {
 	private Model model;
 
 	private Map fieldLabelToOutputFieldLabel;
-	
+
 	private Log log = LogFactory.getLog(GenericQueryRunnerOnModel.class.getName());
 
 	private String groupOrderClause;
@@ -42,9 +42,9 @@ public class GenericQueryRunnerOnModel implements QueryRunner {
 	private String aggregationRules;
 
 	public GenericQueryRunnerOnModel(Map fieldLabelToOutputFieldLabel,
-							   String aggregationRules, 
+							   String aggregationRules,
 							   String whereClause,
-							   String groupOrderClause, 
+							   String groupOrderClause,
 							   Model model) {
 
 		this.fieldLabelToOutputFieldLabel = fieldLabelToOutputFieldLabel;
@@ -67,30 +67,30 @@ public class GenericQueryRunnerOnModel implements QueryRunner {
 
 		StringBuilder sparqlQuery = new StringBuilder();
 		sparqlQuery.append(QueryConstants.getSparqlPrefixQuery());
-		
+
 		sparqlQuery.append("SELECT\n");
-		
-		for (Map.Entry currentfieldLabelToOutputFieldLabel 
+
+		for (Map.Entry currentfieldLabelToOutputFieldLabel
 				: this.fieldLabelToOutputFieldLabel.entrySet()) {
-			
+
 			sparqlQuery.append("\t(str(?").append(currentfieldLabelToOutputFieldLabel.getKey()).append(") as ?").append(currentfieldLabelToOutputFieldLabel.getValue()).append(")\n");
-			
+
 		}
-		
+
 		sparqlQuery.append("\n").append(this.aggregationRules).append("\n");
-		
+
 		sparqlQuery.append("WHERE {\n");
-		
+
 		sparqlQuery.append(this.whereClause);
-		
+
 		sparqlQuery.append("}\n");
-		
+
 		sparqlQuery.append(this.groupOrderClause);
-		
+
 		log.debug("sparqlQuery = " + sparqlQuery.toString());
 		return sparqlQuery.toString();
 	}
-	
+
 	public ResultSet getQueryResult()
 			throws MalformedQueryParametersException {
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/ModelConstructor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/ModelConstructor.java
index 269baaa9..3cae94a1 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/ModelConstructor.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/ModelConstructor.java
@@ -8,6 +8,6 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
 
 public interface ModelConstructor {
 
-	Model getConstructedModel() throws MalformedQueryParametersException; 
-	
+	Model getConstructedModel() throws MalformedQueryParametersException;
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java
index 4ca009ca..f1b52003 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java
@@ -28,14 +28,14 @@ import com.itextpdf.text.pdf.PdfWriter;
 
 public class PDFDocument {
 	public PDFDocument(String authorName,
-					   Map yearToPublicationCount, 
+					   Map yearToPublicationCount,
 					   Document document,
 					   PdfWriter pdfWriter) {
-		
+
 //        setPreferredSize(new Dimension(600,400));
-		
+
 		try {
-			
+
 		document.addTitle("PDF Pipeline iText Prototype");
 		document.addAuthor(authorName);
 		document.addSubject("This example tests text, color, image, transparency & table functionality.");
@@ -43,55 +43,55 @@ public class PDFDocument {
 		document.addCreator("Standalone PDF Renderer using iText");
 
 		Paragraph header = new Paragraph();
-		
+
 		Font pageHeaderStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 15, Font.BOLDITALIC | Font.UNDERLINE);
 		Font featureHeaderStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, BaseColor.RED);
-		
-		header.add(new Chunk("PDF Pipeline Prototype v2 using iText\n", 
+
+		header.add(new Chunk("PDF Pipeline Prototype v2 using iText\n",
 							 pageHeaderStyle));
-		
+
 		header.setSpacingAfter(15f);
-		
-		
+
+
 			document.add(header);
-		
-		
+
+
 		Paragraph content = new Paragraph();
-		
-		content.add(new Chunk("Publication Count - Author Name - " + authorName, 
+
+		content.add(new Chunk("Publication Count - Author Name - " + authorName,
 							 featureHeaderStyle));
-		
+
 		content.setSpacingAfter(15f);
-		
+
 		document.add(content);
 		// step4
-		
+
 		PdfPTable publicationCount = createTable(yearToPublicationCount);
-		
+
 		document.add(publicationCount);
-		
+
 		content = new Paragraph();
-		
-		content.add(new Chunk("Transparency of Shapes", 
+
+		content.add(new Chunk("Transparency of Shapes",
 				 featureHeaderStyle));
 
 		content.setSpacingAfter(15f);
-		
+
 		document.add(content);
-		
+
 		createTransparencyShapes(document, pdfWriter);
-		
-		
+
+
         createImage(document, pdfWriter, featureHeaderStyle);
-		
+
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
-						
+
     }
-	
-	
+
+
 	private void createImage(Document document, PdfWriter writer,
 			Font featureHeaderStyle) throws BadElementException,
 			MalformedURLException, IOException, DocumentException {
@@ -103,17 +103,17 @@ public class PDFDocument {
 		imageSprite.setAlignment(Image.UNDERLYING);
 
 		document.add(imageSprite);
-		
+
 		PdfContentByte cb = writer.getDirectContent();
 		ColumnText ct = new ColumnText(cb);
 		Chunk imageHeader = new Chunk("Images",
 									  featureHeaderStyle);
 		ct.addText(imageHeader);
 		ct.setAlignment(Element.ALIGN_LEFT);
-		ct.setSimpleColumn(imageSpriteX, imageSpriteY - imageSprite.getScaledHeight(), 
+		ct.setSimpleColumn(imageSpriteX, imageSpriteY - imageSprite.getScaledHeight(),
 				   imageSpriteX + imageSprite.getScaledWidth(), imageSpriteY + imageSprite.getScaledHeight() + 20);
 		ct.go();
-		
+
 		ct = new ColumnText(cb);
 		Chunk imageFooter = new Chunk("Footer to be set for a figure. Similar to 'image cpation'.",
 									  FontFactory.getFont(FontFactory.TIMES_ROMAN, 8));
@@ -126,7 +126,7 @@ public class PDFDocument {
 	private void createTransparencyShapes(Document document,
 			PdfWriter writer) throws Exception {
 		PdfContentByte cb = writer.getDirectContent();
-		
+
 		pictureBackdrop(document.leftMargin(), 350, cb);
 		cb.saveState();
 		PdfGState gs1 = new PdfGState();
@@ -134,10 +134,10 @@ public class PDFDocument {
 		cb.setGState(gs1);
 		pictureCircles(document.leftMargin(), 350, cb);
 		cb.restoreState();
-		
+
         cb.resetRGBColorFill();
 	}
-	
+
     /**
      * Prints a square and fills half of it with a gray rectangle.
      * @param x X coordinate
@@ -163,7 +163,7 @@ public class PDFDocument {
      * @throws Exception
      */
     public void pictureCircles(float x, float y, PdfContentByte cb) throws Exception {
-    	
+
 		cb.saveState();
 		PdfGState gs1 = new PdfGState();
 		gs1.setFillOpacity(1.0f);
@@ -182,58 +182,58 @@ public class PDFDocument {
     }
 
 	private PdfPTable createTable(Map yearToPublicationCount) {
-		
+
 		Font normalContentStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 11);
 		Font summaryContentStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 11, Font.BOLDITALIC);
 		BaseColor summaryBackgroundColor = new BaseColor(0xEE, 0xEE, 0xEE);
 		BaseColor headerBackgroundColor = new BaseColor(0xC3, 0xD9, 0xFF);
 		BaseColor bodyBackgroundColor = BaseColor.WHITE;
-		
+
 		PdfPTable table = new PdfPTable(2);
 		table.setWidthPercentage(36.0f);
-		
+
 		table.setHorizontalAlignment(Element.ALIGN_LEFT);
 		table.getDefaultCell().setBorderWidth(0.0f);
 		table.setHeaderRows(2);
-		
+
 		PdfPCell cell;
 		cell = new PdfPCell(new Phrase("Publications per year", normalContentStyle));
 		setTableCaptionStyle(summaryBackgroundColor, cell);
 		table.addCell(cell);
-		
+
 		cell = new PdfPCell(new Phrase("Year", normalContentStyle));
 		setTableHeaderStyle(headerBackgroundColor, cell);
 		table.addCell(cell);
-		
+
 		cell.setPhrase(new Phrase("Publications", normalContentStyle));
 		table.addCell(cell);
-		
-		
-		
+
+
+
 		setTableBodyStyle(bodyBackgroundColor, cell);
 		int totalPublications = 0;
-		
+
 		for (Entry currentEntry : yearToPublicationCount.entrySet()) {
-			
+
 			cell.setPhrase(new Phrase(currentEntry.getKey(), normalContentStyle));
 			table.addCell(cell);
-			
+
 			cell.setPhrase(new Phrase(currentEntry.getValue().toString(), normalContentStyle));
 			table.addCell(cell);
-			
+
 			totalPublications += currentEntry.getValue();
 		}
-		
+
 		setTableFooterStyle(summaryBackgroundColor, cell);
 		cell.setPhrase(new Phrase("Total", summaryContentStyle));
 		table.addCell(cell);
-		
+
 		cell.setPhrase(new Phrase(String.valueOf(totalPublications), summaryContentStyle));
 		table.addCell(cell);
-		
+
 		return table;
 	}
-	
+
 	private void setTableFooterStyle(BaseColor footerBackgroundColor,
 			  PdfPCell cell) {
 		cell.setBorderWidth(0.0f);
@@ -266,7 +266,7 @@ public class PDFDocument {
 		cell.setPaddingBottom(5f);
 		cell.setPaddingLeft(10f);
 	}
-	
+
 	private void setTableCaptionStyle(BaseColor summaryBackgroundColor,
 			PdfPCell cell) {
 		cell.setBorderWidth(0.0f);
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/QueryRunner.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/QueryRunner.java
index 614479b3..36cfe1dc 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/QueryRunner.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/QueryRunner.java
@@ -1,11 +1,11 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
-
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-
-public interface QueryRunner {
-	
-	QueryResult getQueryResult() throws MalformedQueryParametersException; 
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
+
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+
+public interface QueryRunner {
+
+	QueryResult getQueryResult() throws MalformedQueryParametersException;
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UniqueIDGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UniqueIDGenerator.java
index 0f4b93e2..76159a75 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UniqueIDGenerator.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UniqueIDGenerator.java
@@ -1,16 +1,16 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
-
-public class UniqueIDGenerator {
-	
-	private int nextNumericID = 1;
-
-	public int getNextNumericID() {
-		int nextNumericID = this.nextNumericID;
-		this.nextNumericID++;
-
-		return nextNumericID;
-	}
-
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
+
+public class UniqueIDGenerator {
+
+	private int nextNumericID = 1;
+
+	public int getNextNumericID() {
+		int nextNumericID = this.nextNumericID;
+		this.nextNumericID++;
+
+		return nextNumericID;
+	}
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java
index 7afa6110..b5b0d061 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java
@@ -38,7 +38,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Collaborator;
 import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.GenericQueryMap;
 
 public class UtilityFunctions {
-	
+
 	public static Map getYearToActivityCount(
 			Set activities) {
 
@@ -56,7 +56,7 @@ public class UtilityFunctions {
     		 * that particular year.
     		 * */
     		String activityYear = currentActivity.getParsedActivityYear();
-    		
+
 			if (yearToActivityCount.containsKey(activityYear)) {
     			yearToActivityCount.put(activityYear,
     									   yearToActivityCount
@@ -70,122 +70,122 @@ public class UtilityFunctions {
 
 		return yearToActivityCount;
 	}
-	
+
 	public static Map getYearToActivityCount(
 			Collection activities) {
 		return getYearToActivityCount(new HashSet(activities));
 	}
-	
+
 	/**
 	 * This method is used to return a mapping between activity year & all the collaborators
-	 * that published with ego in that year. 
+	 * that published with ego in that year.
 	 * @param collaborationData Collaboration data
 	 */
 	public static Map> getActivityYearToCollaborators(
 										CollaborationData collaborationData) {
 
-		Map> yearToCollaborators = new TreeMap> yearToCollaborators = new TreeMap>();
-		
+
 		Collaborator egoCollaborator = collaborationData.getEgoCollaborator();
-		
+
 		for (Collaborator currNode : collaborationData.getCollaborators()) {
-					
+
 				/*
 				 * We have already printed the Ego Node info.
 				 * */
 				if (currNode != egoCollaborator) {
-					
+
 					for (String year : currNode.getYearToActivityCount().keySet()) {
-						
+
 						Set collaboratorNodes;
-						
+
 						if (yearToCollaborators.containsKey(year)) {
-							
+
 							collaboratorNodes = yearToCollaborators.get(year);
 							collaboratorNodes.add(currNode);
-							
+
 						} else {
-							
+
 							collaboratorNodes = new HashSet();
 							collaboratorNodes.add(currNode);
 							yearToCollaborators.put(year, collaboratorNodes);
 						}
-						
+
 					}
-					
+
 				}
 		}
 		return yearToCollaborators;
 	}
-	
+
 	/**
-	 * Currently the approach for slugifying filenames is naive. In future if there is need, 
+	 * Currently the approach for slugifying filenames is naive. In future if there is need,
 	 * we can write more sophisticated method.
 	 * @param textToBeSlugified Text to process
 	 */
 	public static String slugify(String textToBeSlugified) {
 		String textBlockSeparator = "-";
 		return StringUtils.removeEnd(StringUtils.substring(textToBeSlugified.toLowerCase().trim()
-											.replaceAll("[^a-zA-Z0-9-]+", textBlockSeparator), 
-											0, 
+											.replaceAll("[^a-zA-Z0-9-]+", textBlockSeparator),
+											0,
 											VisConstants.MAX_NAME_TEXT_LENGTH),
 									 textBlockSeparator);
 	}
-	
-	
-    public static ResponseValues handleMalformedParameters(String errorPageTitle, 
-    													   String errorMessage, 
+
+
+    public static ResponseValues handleMalformedParameters(String errorPageTitle,
+    													   String errorMessage,
     													   VitroRequest vitroRequest) {
 
         Map body = new HashMap();
         body.put("error", errorMessage);
         body.put("title", errorPageTitle);
-        
+
         return new TemplateResponseValues(VisualizationFrameworkConstants.ERROR_TEMPLATE, body);
     }
-    
+
     public static void handleMalformedParameters(String errorMessage,
     											 HttpServletResponse response,
 												 Log log)
 		throws IOException {
-		
+
 		GenericQueryMap errorDataResponse = new GenericQueryMap();
 		errorDataResponse.addEntry("error", errorMessage);
-		
+
 		ObjectMapper mapper = new ObjectMapper();
 
     	response.setContentType("application/octet-stream");
     	mapper.writeValue(response.getWriter(), errorDataResponse);
 	}
-    
+
 	public static DateTime getValidParsedDateTimeObject(String unparsedDateTime) {
-		
+
 		for (DateTimeFormatter currentFormatter : VOConstants.POSSIBLE_DATE_TIME_FORMATTERS) {
-			
+
 			try {
-				
+
 				DateTime dateTime = currentFormatter.parseDateTime(unparsedDateTime);
 				return dateTime;
-				
+
 			} catch (Exception e2) {
 				/*
-				 * The current date-time formatter did not pass the muster. 
+				 * The current date-time formatter did not pass the muster.
 				 * */
 			}
 		}
-		
+
 		/*
-		 * This means that none of the date time formatters worked. 
+		 * This means that none of the date time formatters worked.
 		 * */
 		return null;
 	}
-	
+
 	/**
-	 * This method will be called to get the inferred end year for the entity. 
+	 * This method will be called to get the inferred end year for the entity.
 	 * The 2 choices, in order, are,
-	 * 		1. parsed year from core:DateTime object saved in core:dateTimeValue 
-	 * 		2. Default Entity Year 
+	 * 		1. parsed year from core:DateTime object saved in core:dateTimeValue
+	 * 		2. Default Entity Year
 	 */
 	public static String getValidYearFromCoreDateTimeString(String inputDate,
 															String defaultYearInCaseOfError) {
@@ -201,25 +201,25 @@ public class UtilityFunctions {
 
 			if (validParsedDateTimeObject != null) {
 				return String.valueOf(validParsedDateTimeObject.getYear());
-			} 
-		} 
-		
+			}
+		}
+
 		return parsedInputYear;
 	}
-	
+
 	public static String getCSVDownloadURL(String individualURI, String visType, String visMode) {
-		
+
 		ParamMap csvDownloadURLParams = null;
-		
+
 		if (StringUtils.isBlank(visMode)) {
-			
+
 			csvDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY,
 					 individualURI,
 					 VisualizationFrameworkConstants.VIS_TYPE_KEY,
 					 visType);
-			
+
 		} else {
-			
+
 			csvDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY,
 					 individualURI,
 					 VisualizationFrameworkConstants.VIS_TYPE_KEY,
@@ -228,20 +228,20 @@ public class UtilityFunctions {
 					 visMode);
 
 		}
-		
+
 		String csvDownloadLink = UrlBuilder.getUrl(
 										VisualizationFrameworkConstants
 												.DATA_VISUALIZATION_SERVICE_URL_PREFIX,
 										csvDownloadURLParams);
-		
+
 		return csvDownloadLink != null ? csvDownloadLink : "" ;
 
 	}
-	
-	public static String getCollaboratorshipNetworkLink(String individualURI, 
-														String visType, 
+
+	public static String getCollaboratorshipNetworkLink(String individualURI,
+														String visType,
 														String visMode) {
-		
+
 		ParamMap collaboratorshipNetworkURLParams = new ParamMap(
 					VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY,
 					individualURI,
@@ -253,61 +253,61 @@ public class UtilityFunctions {
 		String collaboratorshipNetworkURL = UrlBuilder.getUrl(
 					VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX,
 					collaboratorshipNetworkURLParams);
-		
+
 		return collaboratorshipNetworkURL != null ? collaboratorshipNetworkURL : "" ;
 	}
-	
-	public static boolean isEntityAPerson(VitroRequest vreq, String individualURI) 
+
+	public static boolean isEntityAPerson(VitroRequest vreq, String individualURI)
 		throws MalformedQueryParametersException {
 		Individual individualByURI = vreq.getWebappDaoFactory()
 						.getIndividualDao()
 						.getIndividualByURI(individualURI);
-		
+
 		if (individualByURI != null) {
 
 			return individualByURI
-						.isVClass("http://xmlns.com/foaf/0.1/Person");	
+						.isVClass("http://xmlns.com/foaf/0.1/Person");
 		} else {
 			throw new MalformedQueryParametersException("Individual with " + individualURI + " not found in the system.");
 		}
-		
+
 	}
-	
+
 
 	/**
-	 * 
-	 * This method will test whether the current uri is based off of default namespace. If so, 
-	 * go ahead & provide local name. 
+	 *
+	 * This method will test whether the current uri is based off of default namespace. If so,
+	 * go ahead & provide local name.
 	 * @param givenURI URI
 	 * @param vitroRequest Vitro Request
 	 */
 	public static String getIndividualLocalName(String givenURI, VitroRequest vitroRequest) {
-		
+
 		if (UrlBuilder.isUriInDefaultNamespace(givenURI, vitroRequest)) {
-			
+
 			try {
-				
+
 				Individual individual = vitroRequest.getWebappDaoFactory().getIndividualDao()
 												.getIndividualByURI(givenURI);
-				
+
 				return individual.getLocalName();
-				
+
 			} catch (Exception e) {
-				
+
 			}
 		}
-		
+
 		return "";
 	}
-	
+
 	public static String getIndividualLabelFromDAO(VitroRequest vitroRequest,
 												   String entityURI) {
-		
+
 		IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao();
         Individual ind = iDao.getIndividualByURI(entityURI);
-        
-        String individualLabel = "Unknown Individual"; 
-        
+
+        String individualLabel = "Unknown Individual";
+
         if (ind != null) {
         	individualLabel = ind.getName();
         }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/VisualizationRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/VisualizationRequestHandler.java
index fc95f991..ba28dac3 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/VisualizationRequestHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/VisualizationRequestHandler.java
@@ -1,48 +1,48 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
-
-import java.util.Map;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import org.apache.commons.logging.Log;
-
-import org.apache.jena.query.Dataset;
-
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
-import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
-import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
-
-/**
- * This interface is being implemented by all the visualization request handlers like
- * PersonLevelRequestHandler, PersonPublicationCountRequestHandler, UtilitiesRequestHandler
- * etc. All the future visualizations must implement this because the ability of 
- * a visualization to be served to the users is dependent on it. We have implemented 
- * dependency injection mechanism & one of the conditions that is used to enable a visualization 
- * handler is its implementation of VisualizationRequestHandler.
- * 
- * @author cdtank
- */
-public interface VisualizationRequestHandler {
-	
-	AuthorizationRequest getRequiredPrivileges();
-
-	ResponseValues generateStandardVisualization(VitroRequest vitroRequest,
-							   Log log, 
-							   Dataset dataSource) throws MalformedQueryParametersException;
-	
-	ResponseValues generateVisualizationForShortURLRequests(
-						Map parameters,
-						VitroRequest vitroRequest,
-						Log log,
-						Dataset dataSource) throws MalformedQueryParametersException;
-	
-	Object generateAjaxVisualization(VitroRequest vitroRequest,
-								     Log log, 
-								     Dataset dataSource) throws MalformedQueryParametersException, JsonProcessingException;
-	
-	Map generateDataVisualization(VitroRequest vitroRequest,
-								   	 Log log, 
-								   	 Dataset dataset) throws MalformedQueryParametersException, JsonProcessingException;
-	
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
+
+import java.util.Map;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.commons.logging.Log;
+
+import org.apache.jena.query.Dataset;
+
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
+import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
+
+/**
+ * This interface is being implemented by all the visualization request handlers like
+ * PersonLevelRequestHandler, PersonPublicationCountRequestHandler, UtilitiesRequestHandler
+ * etc. All the future visualizations must implement this because the ability of
+ * a visualization to be served to the users is dependent on it. We have implemented
+ * dependency injection mechanism & one of the conditions that is used to enable a visualization
+ * handler is its implementation of VisualizationRequestHandler.
+ *
+ * @author cdtank
+ */
+public interface VisualizationRequestHandler {
+
+	AuthorizationRequest getRequiredPrivileges();
+
+	ResponseValues generateStandardVisualization(VitroRequest vitroRequest,
+							   Log log,
+							   Dataset dataSource) throws MalformedQueryParametersException;
+
+	ResponseValues generateVisualizationForShortURLRequests(
+						Map parameters,
+						VitroRequest vitroRequest,
+						Log log,
+						Dataset dataSource) throws MalformedQueryParametersException;
+
+	Object generateAjaxVisualization(VitroRequest vitroRequest,
+								     Log log,
+								     Dataset dataSource) throws MalformedQueryParametersException, JsonProcessingException;
+
+	Map generateDataVisualization(VitroRequest vitroRequest,
+								   	 Log log,
+								   	 Dataset dataset) throws MalformedQueryParametersException, JsonProcessingException;
+
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/VIVOIndividualTemplateModel.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/VIVOIndividualTemplateModel.java
index baa08be6..b1ac2579 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/VIVOIndividualTemplateModel.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/VIVOIndividualTemplateModel.java
@@ -15,7 +15,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.visualization.VisualizationFr
 public class VIVOIndividualTemplateModel extends IndividualTemplateModel {
 
     private static final Log log = LogFactory.getLog(VIVOIndividualTemplateModel.class);
-    
+
     private static final String FOAF = "http://xmlns.com/foaf/0.1/";
     private static final String PERSON_CLASS = FOAF + "Person";
     private static final String AWARD_CLASS = "http://vivoweb.org/ontology/core#Award";
@@ -26,9 +26,9 @@ public class VIVOIndividualTemplateModel extends IndividualTemplateModel {
     private static final String ORGANIZATION_CLASS = FOAF + "Organization";
     private static final String EVENT_CLASS = "http://purl.org/NET/c4dm/event.owl#Event";
     private static final String INFO_CONTENT_ENTITY_CLASS = "http://purl.obolibrary.org/obo/IAO_0000030";
-    private static final String BASE_VISUALIZATION_URL = 
+    private static final String BASE_VISUALIZATION_URL =
         UrlBuilder.getUrl(Route.VISUALIZATION_SHORT.path());
-    
+
     VIVOIndividualTemplateModel(Individual individual, VitroRequest vreq) {
         super(individual, vreq);
     }
@@ -38,18 +38,18 @@ public class VIVOIndividualTemplateModel extends IndividualTemplateModel {
         boolean isUsingDefaultNameSpace = UrlBuilder.isUriInDefaultNamespace(
                                                 getUri(),
                                                 vreq);
-        
-        if (isUsingDefaultNameSpace) {          
-            visUrl = visPath + getLocalName();           
-        } else {            
+
+        if (isUsingDefaultNameSpace) {
+            visUrl = visPath + getLocalName();
+        } else {
             visUrl = UrlBuilder.addParams(
-                    visPath, 
-                    new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, getUri())); 
+                    visPath,
+                    new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, getUri()));
         }
-        
+
         return visUrl;
     }
-    
+
     /* Template methods (for efficiency, not pre-computed) */
     public boolean conceptSubclass() {
         return isVClass(AWARD_CLASS) || isVClass(DEGREE_CLASS) || isVClass(CONTACT_CLASS) || isVClass(CREDENTIAL_CLASS) || isVClass(DTP_CLASS);
@@ -58,40 +58,40 @@ public class VIVOIndividualTemplateModel extends IndividualTemplateModel {
     public boolean person() {
         return isVClass(PERSON_CLASS);
     }
-    
+
     public boolean organization() {
-        return isVClass(ORGANIZATION_CLASS);        
+        return isVClass(ORGANIZATION_CLASS);
     }
-    
+
     public boolean event() {
-        return isVClass(EVENT_CLASS);        
+        return isVClass(EVENT_CLASS);
     }
 
     public boolean infoContentEntity() {
-        return isVClass(INFO_CONTENT_ENTITY_CLASS);        
+        return isVClass(INFO_CONTENT_ENTITY_CLASS);
     }
 
-    public String coAuthorVisUrl() {   	
-        String url = BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL + "/";    	
+    public String coAuthorVisUrl() {
+        String url = BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL + "/";
     	return getVisUrl(url);
     }
 
-    public String coInvestigatorVisUrl() {    	
-    	String url = 
-    	    BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.COINVESTIGATOR_VIS_SHORT_URL + "/";    	
+    public String coInvestigatorVisUrl() {
+    	String url =
+    	    BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.COINVESTIGATOR_VIS_SHORT_URL + "/";
     	return getVisUrl(url);
     }
 
-    public String temporalGraphUrl() {  
-        String url = 
-            BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.PUBLICATION_TEMPORAL_VIS_SHORT_URL + "/";    	
+    public String temporalGraphUrl() {
+        String url =
+            BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.PUBLICATION_TEMPORAL_VIS_SHORT_URL + "/";
     	return getVisUrl(url);
     }
 
     public String mapOfScienceUrl() {
-    	String url = 
-    	    BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.MAP_OF_SCIENCE_VIS_SHORT_URL + "/";    	
+    	String url =
+    	    BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.MAP_OF_SCIENCE_VIS_SHORT_URL + "/";
     	return getVisUrl(url);
     }
-    
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/VIVOListedIndividual.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/VIVOListedIndividual.java
index 61d76ea4..9ab3c612 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/VIVOListedIndividual.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/VIVOListedIndividual.java
@@ -27,7 +27,7 @@ public class VIVOListedIndividual extends ListedIndividual {
             + "} "  ;
 
     private final String title;
-    
+
     VIVOListedIndividual(Individual individual, VitroRequest vreq) {
         super(individual, vreq);
         title = findPreferredTitle();
@@ -53,9 +53,9 @@ public class VIVOListedIndividual extends ListedIndividual {
     }
 
     /* Template properties */
-    
+
     public String getPreferredTitle() {
         return title;
     }
-    
+
 }
diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/VIVOIndividualSearchResult.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/VIVOIndividualSearchResult.java
index 3c20552e..e2dca1a3 100644
--- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/VIVOIndividualSearchResult.java
+++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/VIVOIndividualSearchResult.java
@@ -31,16 +31,16 @@ public class VIVOIndividualSearchResult extends IndividualSearchResult {
             + "               ?vTitle vcard:title ?title . \n"
             + "    } \n"
             + "} "  ;
-    
+
     private String email = "";
     private String title = "";
-       
+
     public VIVOIndividualSearchResult(Individual individual, VitroRequest vreq) {
     	super(individual, vreq);
     	log.debug("Called Individual Search Result");
     	findVcardInfo();
     }
-    
+
     private void findVcardInfo() {
         String queryStr = QueryUtils.subUriForQueryVar(VCARD_DATA_QUERY, "subject", individual.getURI());
         log.debug("queryStr = " + queryStr);
@@ -64,11 +64,11 @@ public class VIVOIndividualSearchResult extends IndividualSearchResult {
 
 
     /* Access methods for templates */
-    
+
     public String getPreferredTitle() {
     	return title;
     }
-    
+
     public String getEmail() {
     	return email;
     }
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/AdvisingRelationshipChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/AdvisingRelationshipChecker.java
index abea20e0..ee091d74 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/AdvisingRelationshipChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/AdvisingRelationshipChecker.java
@@ -28,7 +28,7 @@ public class AdvisingRelationshipChecker extends RelationshipChecker {
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to an Advising Relationship, and if the
 	 * self-editor:
-	 * 
+	 *
 	 * 1) is an Advisor in that Relationship
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/CourseChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/CourseChecker.java
index c5706d2c..1510ced0 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/CourseChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/CourseChecker.java
@@ -26,7 +26,7 @@ public class CourseChecker extends RelationshipChecker {
 	/**
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to a Course, and if the self-editor:
-	 * 
+	 *
 	 * 1) is a Teacher of that Course
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/GrantChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/GrantChecker.java
index ac77145b..28d0d48f 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/GrantChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/GrantChecker.java
@@ -29,9 +29,9 @@ public class GrantChecker extends RelationshipChecker {
 	/**
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to a Grant, and if the self-editor:
-	 * 
+	 *
 	 * 1) is a Principal Investigator (PI) of that Grant, or
-	 * 
+	 *
 	 * 2) is a co-Principal Investigator (co-PI) of that Grant
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/InfoContentEntityChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/InfoContentEntityChecker.java
index bf5f6037..1b7dfca7 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/InfoContentEntityChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/InfoContentEntityChecker.java
@@ -29,11 +29,11 @@ public class InfoContentEntityChecker extends RelationshipChecker {
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to an Info Content Entity, and if the
 	 * self-editor:
-	 * 
+	 *
 	 * 1) is an Author of that Info Content Entity,
-	 * 
+	 *
 	 * 2) is an Editor of that Info Content Entity, or
-	 * 
+	 *
 	 * 3) is Featured in that Info Content Entity.
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
@@ -72,7 +72,7 @@ public class InfoContentEntityChecker extends RelationshipChecker {
 	private List getUrisOfAuthors(String resourceUri) {
 		List allRelatedUris = getObjectsThroughLinkingNode(resourceUri,
 				URI_RELATED_BY, URI_AUTHORSHIP_TYPE, URI_RELATES);
-		// The authorship relates to the authors and to the resource itself. 
+		// The authorship relates to the authors and to the resource itself.
 		allRelatedUris.remove(resourceUri);
 		return allRelatedUris;
 	}
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/PresentationChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/PresentationChecker.java
index 5305b455..b3471d32 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/PresentationChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/PresentationChecker.java
@@ -28,7 +28,7 @@ public class PresentationChecker extends RelationshipChecker {
 	/**
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to a Presentation, and if the self-editor:
-	 * 
+	 *
 	 * 1) is a Presenter of that Presentation
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/ProjectOrServiceChecker.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/ProjectOrServiceChecker.java
index 02eb8c09..2f9e7ea3 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/ProjectOrServiceChecker.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/ProjectOrServiceChecker.java
@@ -31,7 +31,7 @@ public class ProjectOrServiceChecker extends RelationshipChecker {
 	 * A self-editor is authorized to add, edit, or delete a statement if the
 	 * subject or object refers to a Project or a Service, and if the
 	 * self-editor:
-	 * 
+	 *
 	 * 1) is a Clinical Agent of that Project or Service
 	 */
 	public PolicyDecision isAuthorized(List userUris) {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicy.java b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicy.java
index 825ae164..a1c12a0c 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicy.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicy.java
@@ -1,143 +1,143 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vivo.auth.policy;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
-import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasAssociatedIndividual;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.ServletPolicyList;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyIface;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.specialrelationships.AbstractRelationshipPolicy;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AbstractPropertyStatementAction;
-
-/**
- * Permit self-editors to edit the properties of classes with which they share a
- * special relationship. So for example:
- * 
- * A self-editor may edit properties of an InformationResource for which he is
- * an author, an editor, or in which he is featured.
- * 
- * A self-editor may edit properties of a Project in which he plays a clinical
- * role.
- * 
- * Etc.
- * 
- * NOTE: properties or resources which are restricted by namespace or by access
- * setting will still not be editable, even if this special relationship
- * applies.
- * 
- * NOTE: This could be further generalized by building a list of authorizing
- * relationships, where each relationship may specify a type of object, a
- * relating property (or chain of properties), and a text message describing the
- * relationship (to be used in the decision).
- */
-public class SelfEditorRelationshipPolicy extends AbstractRelationshipPolicy
-		implements PolicyIface {
-	private static final Log log = LogFactory
-			.getLog(SelfEditorRelationshipPolicy.class);
-
-	public SelfEditorRelationshipPolicy(ServletContext ctx) {
-		super(ctx);
-	}
-
-	@Override
-	public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
-			RequestedAction whatToAuth) {
-		if (whatToAuth == null) {
-			return inconclusiveDecision("whatToAuth was null");
-		}
-
-		if (!(whatToAuth instanceof AbstractPropertyStatementAction)) {
-			return inconclusiveDecision("Does not authorize "
-					+ whatToAuth.getClass().getSimpleName() + " actions");
-		}
-		AbstractPropertyStatementAction action = (AbstractPropertyStatementAction) whatToAuth;
-
-		List userUris = new ArrayList(
-				HasAssociatedIndividual.getIndividualUris(whoToAuth));
-		if (userUris.isEmpty()) {
-			return inconclusiveDecision("Not self-editing.");
-		}
-
-		if (!canModifyPredicate(action.getPredicate())) {
-			return cantModifyPredicate(action.getPredicate().getURI());
-		}
-
-		for (String resourceUri : action.getResourceUris()) {
-			if (!canModifyResource(resourceUri)) {
-				return cantModifyResource(resourceUri);
-			}
-		}
-
-		return checkRelationships(userUris, action);
-	}
-
-	private PolicyDecision checkRelationships(List userUris,
-			AbstractPropertyStatementAction action) {
-
-		PolicyDecision decision = new InfoContentEntityChecker(action)
-				.isAuthorized(userUris);
-		if (decision == null) {
-			decision = new GrantChecker(action).isAuthorized(userUris);
-		}
-		if (decision == null) {
-			decision = new ProjectOrServiceChecker(action)
-					.isAuthorized(userUris);
-		}
-		if (decision == null) {
-			decision = new PresentationChecker(action).isAuthorized(userUris);
-		}
-		if (decision == null) {
-			decision = new CourseChecker(action).isAuthorized(userUris);
-		}
-		if (decision == null) {
-			decision = new AdvisingRelationshipChecker(action).isAuthorized(userUris);
-		}
-		if (decision == null) {
-			decision = userNotAuthorizedToStatement();
-		}
-		return decision;
-	}
-
-	@Override
-	public String toString() {
-		return this.getClass().getSimpleName()
-				+ ": information resources, grants, projects, etc. - "
-				+ hashCode();
-	}
-
-	// ----------------------------------------------------------------------
-	// helper classes
-	// ----------------------------------------------------------------------
-
-	/**
-	 * When the system starts up, install the policy. This class must be a
-	 * listener in web.xml
-	 * 
-	 * The CommonIdentifierBundleFactory already creates the IDs we need.
-	 */
-	public static class Setup implements ServletContextListener {
-		@Override
-		public void contextInitialized(ServletContextEvent sce) {
-			ServletContext ctx = sce.getServletContext();
-
-			ServletPolicyList.addPolicy(ctx, new SelfEditorRelationshipPolicy(
-					ctx));
-		}
-
-		@Override
-		public void contextDestroyed(ServletContextEvent sce) { /* nothing */
-		}
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vivo.auth.policy;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
+import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasAssociatedIndividual;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.ServletPolicyList;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyIface;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.specialrelationships.AbstractRelationshipPolicy;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AbstractPropertyStatementAction;
+
+/**
+ * Permit self-editors to edit the properties of classes with which they share a
+ * special relationship. So for example:
+ *
+ * A self-editor may edit properties of an InformationResource for which he is
+ * an author, an editor, or in which he is featured.
+ *
+ * A self-editor may edit properties of a Project in which he plays a clinical
+ * role.
+ *
+ * Etc.
+ *
+ * NOTE: properties or resources which are restricted by namespace or by access
+ * setting will still not be editable, even if this special relationship
+ * applies.
+ *
+ * NOTE: This could be further generalized by building a list of authorizing
+ * relationships, where each relationship may specify a type of object, a
+ * relating property (or chain of properties), and a text message describing the
+ * relationship (to be used in the decision).
+ */
+public class SelfEditorRelationshipPolicy extends AbstractRelationshipPolicy
+		implements PolicyIface {
+	private static final Log log = LogFactory
+			.getLog(SelfEditorRelationshipPolicy.class);
+
+	public SelfEditorRelationshipPolicy(ServletContext ctx) {
+		super(ctx);
+	}
+
+	@Override
+	public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
+			RequestedAction whatToAuth) {
+		if (whatToAuth == null) {
+			return inconclusiveDecision("whatToAuth was null");
+		}
+
+		if (!(whatToAuth instanceof AbstractPropertyStatementAction)) {
+			return inconclusiveDecision("Does not authorize "
+					+ whatToAuth.getClass().getSimpleName() + " actions");
+		}
+		AbstractPropertyStatementAction action = (AbstractPropertyStatementAction) whatToAuth;
+
+		List userUris = new ArrayList(
+				HasAssociatedIndividual.getIndividualUris(whoToAuth));
+		if (userUris.isEmpty()) {
+			return inconclusiveDecision("Not self-editing.");
+		}
+
+		if (!canModifyPredicate(action.getPredicate())) {
+			return cantModifyPredicate(action.getPredicate().getURI());
+		}
+
+		for (String resourceUri : action.getResourceUris()) {
+			if (!canModifyResource(resourceUri)) {
+				return cantModifyResource(resourceUri);
+			}
+		}
+
+		return checkRelationships(userUris, action);
+	}
+
+	private PolicyDecision checkRelationships(List userUris,
+			AbstractPropertyStatementAction action) {
+
+		PolicyDecision decision = new InfoContentEntityChecker(action)
+				.isAuthorized(userUris);
+		if (decision == null) {
+			decision = new GrantChecker(action).isAuthorized(userUris);
+		}
+		if (decision == null) {
+			decision = new ProjectOrServiceChecker(action)
+					.isAuthorized(userUris);
+		}
+		if (decision == null) {
+			decision = new PresentationChecker(action).isAuthorized(userUris);
+		}
+		if (decision == null) {
+			decision = new CourseChecker(action).isAuthorized(userUris);
+		}
+		if (decision == null) {
+			decision = new AdvisingRelationshipChecker(action).isAuthorized(userUris);
+		}
+		if (decision == null) {
+			decision = userNotAuthorizedToStatement();
+		}
+		return decision;
+	}
+
+	@Override
+	public String toString() {
+		return this.getClass().getSimpleName()
+				+ ": information resources, grants, projects, etc. - "
+				+ hashCode();
+	}
+
+	// ----------------------------------------------------------------------
+	// helper classes
+	// ----------------------------------------------------------------------
+
+	/**
+	 * When the system starts up, install the policy. This class must be a
+	 * listener in web.xml
+	 *
+	 * The CommonIdentifierBundleFactory already creates the IDs we need.
+	 */
+	public static class Setup implements ServletContextListener {
+		@Override
+		public void contextInitialized(ServletContextEvent sce) {
+			ServletContext ctx = sce.getServletContext();
+
+			ServletPolicyList.addPolicy(ctx, new SelfEditorRelationshipPolicy(
+					ctx));
+		}
+
+		@Override
+		public void contextDestroyed(ServletContextEvent sce) { /* nothing */
+		}
+	}
+}
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidContextSetup.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidContextSetup.java
index 5b47e234..32f51646 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidContextSetup.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidContextSetup.java
@@ -25,10 +25,10 @@ import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
 
 /**
  * Setup for the ORCID interface.
- * 
+ *
  * Note that the property for CLIENT_SECRET is "orcid.clientPassword". Since it
  * ends in "password", it will not be displayed on the ShowConfiguration page.
- * 
+ *
  * The CALLBACK_PATH is hardcoded. It is relative to the WEBAPP_BASE_URL, so it
  * won't change.
  */
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidIdDataGetter.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidIdDataGetter.java
index e930e50c..4362fd38 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidIdDataGetter.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/OrcidIdDataGetter.java
@@ -31,13 +31,13 @@ import edu.cornell.mannlib.vivo.orcid.controller.OrcidIntegrationController;
 /**
  * This data getter should be assigned to the template that renders the list
  * view for ORCID IDs.
- * 
+ *
  * Find out whether the user is authorized to confirm the ORCID IDs on this
  * page. Find the list of ORCID IDs, and whether each has already been
  * confirmed.
- * 
+ *
  * The information is stored in the values map like this:
- * 
+ *
  * 
  *    orcidInfo = map {
  *        authorizedToConfirm: boolean
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthAuthenticateHandler.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthAuthenticateHandler.java
index 6ce25b0b..0f8ea804 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthAuthenticateHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthAuthenticateHandler.java
@@ -21,7 +21,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
 /**
  * We offered the confirmation screen, and they decided to go ahead. Get
  * authorization to authenticate them.
- * 
+ *
  * We can't assume that they haven't been here before, so they might already
  * have authorized, or denied authorization.
  */
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthExternalIdsHandler.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthExternalIdsHandler.java
index 48d1dcaf..9d661fa7 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthExternalIdsHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidAuthExternalIdsHandler.java
@@ -21,7 +21,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
 /**
  * We offered to add external IDs and they decided to go ahead. Get
  * authorization.
- * 
+ *
  * We can't assume that they haven't been here before, so they might already
  * have authorized, or denied authorization.
  */
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidCallbackHandler.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidCallbackHandler.java
index 9368dda4..5a29aafd 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidCallbackHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidCallbackHandler.java
@@ -19,14 +19,14 @@ import edu.cornell.mannlib.orcidclient.context.OrcidClientContext;
 
 /**
  * Handle the callbacks during the OAuth dance.
- * 
+ *
  * This is not like other handlers. It is created and invoked from doGet(), not
  * from processRequest().
  */
 public class OrcidCallbackHandler {
 	private static final Log log = LogFactory
 			.getLog(OrcidCallbackHandler.class);
-	
+
 	private final HttpServletRequest req;
 	private final HttpServletResponse resp;
 
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidConfirmationState.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidConfirmationState.java
index b834d6c2..f59234ad 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidConfirmationState.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidConfirmationState.java
@@ -34,8 +34,8 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
 class OrcidConfirmationState {
 	private static final Log log = LogFactory
 			.getLog(OrcidConfirmationState.class);
-	
-	
+
+
 	// ----------------------------------------------------------------------
 	// The factory
 	// ----------------------------------------------------------------------
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidDefaultHandler.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidDefaultHandler.java
index 7a07689f..056d46ce 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidDefaultHandler.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidDefaultHandler.java
@@ -67,10 +67,10 @@ public class OrcidDefaultHandler extends OrcidAbstractHandler {
 			throw new IllegalStateException(
 					"No 'individualUri' parameter on request.");
 		}
-	
+
 		String profilePage = UrlBuilder.getIndividualProfileUrl(uri, vreq);
 		state.reset(uri, profilePage);
-		
+
 		individual = findIndividual();
 		locateExistingOrcids();
 		state.setExistingOrcids(existingOrcids);
@@ -90,7 +90,7 @@ public class OrcidDefaultHandler extends OrcidAbstractHandler {
 		for (ObjectPropertyStatement ops : opss) {
 			existingOrcids.add(ops.getObjectURI());
 		}
-		
+
 	}
 
 	private void initializeAuthorizationCache() {
diff --git a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidIntegrationController.java b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidIntegrationController.java
index 4a93377f..ed6e6f4e 100644
--- a/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidIntegrationController.java
+++ b/api/src/main/java/edu/cornell/mannlib/vivo/orcid/controller/OrcidIntegrationController.java
@@ -26,9 +26,9 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
 
 /**
  * New workflow:
- * 
+ *
  * 
- *    Default: clear status for both readProfile and addExternalIDs 
+ *    Default: clear status for both readProfile and addExternalIDs
  *      show intro screen orcidOffer.ftl
  *    	The click "do it", goes to /getProfileAuth
  *      Or "return to profile"
@@ -36,7 +36,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Res
  *      Else, do the dance, ending with /readProfile callback
  *      Denied? show orcidDenied.ftl
  *      Failed? show orcidFailed.ftl
- *    /readProfile: read the profile, store in status 
+ *    /readProfile: read the profile, store in status
  *    	figure external ID options, show orcidOfferIds.ftl
  *      If they click "do it", goes /authExternalIds
  *      If they click "nah", return to profile
diff --git a/api/src/main/java/org/vivoweb/reasoner/plugin/DCCreatorForDocuments.java b/api/src/main/java/org/vivoweb/reasoner/plugin/DCCreatorForDocuments.java
index 8048d3d7..b7249292 100644
--- a/api/src/main/java/org/vivoweb/reasoner/plugin/DCCreatorForDocuments.java
+++ b/api/src/main/java/org/vivoweb/reasoner/plugin/DCCreatorForDocuments.java
@@ -6,12 +6,12 @@ import edu.cornell.mannlib.vitro.webapp.reasoner.ReasonerPlugin;
 import edu.cornell.mannlib.vitro.webapp.reasoner.plugin.SimpleBridgingRule;
 
 public class DCCreatorForDocuments extends SimpleBridgingRule implements ReasonerPlugin {
-	
+
 	private final static String DCTERMS = "http://purl.org/dc/terms/";
 	private final static String VIVOCORE = "http://vivoweb.org/ontology/core#";
-	
+
 	public DCCreatorForDocuments() {
-		super(VIVOCORE + "informationResourceInAuthorship", 
+		super(VIVOCORE + "informationResourceInAuthorship",
 			  VIVOCORE + "linkedAuthor",
 			  DCTERMS + "creator");
 	}
diff --git a/api/src/main/java/org/vivoweb/reasoner/plugin/DCTitleForDocuments.java b/api/src/main/java/org/vivoweb/reasoner/plugin/DCTitleForDocuments.java
index f2036c58..93d7c30c 100644
--- a/api/src/main/java/org/vivoweb/reasoner/plugin/DCTitleForDocuments.java
+++ b/api/src/main/java/org/vivoweb/reasoner/plugin/DCTitleForDocuments.java
@@ -10,9 +10,9 @@ import edu.cornell.mannlib.vitro.webapp.reasoner.plugin.SimplePropertyAndTypeRul
 public class DCTitleForDocuments extends SimplePropertyAndTypeRule implements ReasonerPlugin {
 
 	public DCTitleForDocuments() {
-		super(RDFS.label.getURI(), 
-		      "http://purl.org/ontology/bibo/Document", 
+		super(RDFS.label.getURI(),
+		      "http://purl.org/ontology/bibo/Document",
 		      "http://purl.org/dc/terms/title");
 	}
-			   
+
 }
diff --git a/api/src/main/java/org/vivoweb/webapp/util/ModelUtils.java b/api/src/main/java/org/vivoweb/webapp/util/ModelUtils.java
index ac49cd53..aec79928 100644
--- a/api/src/main/java/org/vivoweb/webapp/util/ModelUtils.java
+++ b/api/src/main/java/org/vivoweb/webapp/util/ModelUtils.java
@@ -17,16 +17,16 @@ import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
 
 
 public class ModelUtils {
-	
+
 	private static final Log log = LogFactory.getLog(ModelUtils.class.getName());
-		
+
     private static final String processPropertyURI = "http://purl.obolibrary.org/obo/BFO_0000054";
     private static final String processPropertyInverseURI = "http://purl.obolibrary.org/obo/BFO_0000055";
     private static final String nonProcessPropertyURI = "http://vivoweb.org/ontology/core#roleContributesTo";
 	private static final String nonProcessPropertyInverseURI = "http://vivoweb.org/ontology/core#contributingRole";
     private static final String grantPropertyURI = "http://vivoweb.org/ontology/core#relatedBy";
 	private static final String grantPropertyInverseURI = "http://vivoweb.org/ontology/core#relates";
-	
+
 	private static Set processClass = new HashSet();
 	static {
 		processClass.add("http://vivoweb.org/ontology/core#Project");
@@ -49,29 +49,29 @@ public class ModelUtils {
 	 * a warning if so.
 	 */
 	public static ObjectProperty getPropertyForRoleInClass(String classURI, WebappDaoFactory wadf) {
-		
+
 		if (classURI == null) {
 			log.error("input classURI is null");
 			return null;
 		}
-		
+
 		if (wadf == null) {
 			log.error("input WebappDaoFactory is null");
 			return null;
 		}
-		
+
 		VClassDao vcd = wadf.getVClassDao();
 		List superClassURIs = vcd.getSuperClassURIs(classURI, false);
 		superClassURIs.add(classURI);
 		Iterator iter = superClassURIs.iterator();
-		
+
 		ObjectProperty op = new ObjectProperty();
 		boolean isBFOProcess = false;
 		boolean isGrantClass = false;
 
 	    while (iter.hasNext()) {
 	    	String superClassURI = iter.next();
-	    	
+
 	    	if (processClass.contains(superClassURI)) {
 	    		isBFOProcess = true;
 	    		break;
@@ -81,23 +81,23 @@ public class ModelUtils {
 	    		break;
 	    	}
 	    }
-		
+
 	    if (isBFOProcess) {
 			op.setURI(processPropertyURI);
-			op.setURIInverse(processPropertyInverseURI);    	
-	    } 
+			op.setURIInverse(processPropertyInverseURI);
+	    }
 	    else if (isGrantClass){
 			op.setURI(grantPropertyURI);
-			op.setURIInverse(grantPropertyInverseURI);    	
+			op.setURIInverse(grantPropertyInverseURI);
 	    }
 	    else {
 			op.setURI(nonProcessPropertyURI);
-			op.setURIInverse(nonProcessPropertyInverseURI);    		    	
+			op.setURIInverse(nonProcessPropertyInverseURI);
 	    }
-	    
+
 		return op;
-	}	
-	
+	}
+
 	//Return list of all possible predicates
 	public static List getPossiblePropertiesForRole() {
 		List properties = new ArrayList();
@@ -106,7 +106,7 @@ public class ModelUtils {
 		properties.add(grantPropertyURI);
 		return properties;
 	}
-	
+
 	public static List getPossibleInversePropertiesForRole() {
 		List properties = new ArrayList();
 		properties.add(processPropertyInverseURI);
diff --git a/api/src/test/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodesTest.java b/api/src/test/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodesTest.java
index 44ed7f8c..042a9552 100644
--- a/api/src/test/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodesTest.java
+++ b/api/src/test/java/edu/cornell/mannlib/vitro/webapp/searchindex/extensions/LabelsAcrossContextNodesTest.java
@@ -92,7 +92,7 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 	/**
 	 * Create these relationships (where "r/r" denotes "relatedBy/relates"
 	 * combination.
-	 * 
+	 *
 	 * 
 	 * Person1 r/r Position1 r/r Organization1
 	 * Person1 r/r AdvisingRelationship1 r/r Person2
@@ -138,12 +138,12 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 	/*
 	 * If there is a type restriction and the individual does not meet it, no
 	 * change.
-	 * 
+	 *
 	 * If contextNodeClasses are not specified, get labels from all context
 	 * nodes. note that a partner without a label should just be a no-op.
-	 * 
+	 *
 	 * If contextNodeClasses are specified, accept some and ignore others.
-	 * 
+	 *
 	 * Confirm that the expected data is written to the text fields.
 	 */
 
@@ -202,11 +202,11 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 	/**
 	 * 
 	 * If neither a label nor a relates, ignore it.
-	 * 
+	 *
 	 * If label, test if no partners, if some partners, if some partners restricted by type.
 	 *   test with both contextNodeClasses and not.
 	 * Test with typeRestrictions or without.
-	 * 
+	 *
 	 * If relates, and fails contextNodeClasses, ignore it.
 	 * Test with contextNodeClasses and without.
 	 * Find partners, both with typeRestrictions and without.
@@ -292,7 +292,7 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 		exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATED_BY, URI_PERSON1));
 		assertExpectedUris(URI_ORGANIZATION1);
 	}
-	
+
 	@Test
 	public void relatedBy_exclusiveTypeRestriction_returnsNothing() {
 		setTypeRestrictions(CORE_ADVISING_RELATIONSHIP);
@@ -300,7 +300,7 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 		exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATED_BY, URI_PERSON1));
 		assertExpectedUris();
 	}
-	
+
 	@Test
 	public void relatedBy_inclusiveContextType_returnsPartner() {
 		setTypeRestrictions();
@@ -308,7 +308,7 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 		exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATED_BY, URI_PERSON1));
 		assertExpectedUris(URI_ORGANIZATION1);
 	}
-	
+
 	@Test
 	public void relatedBy_exclusiveContextType_returnsNothing() {
 		setTypeRestrictions();
@@ -316,7 +316,7 @@ public class LabelsAcrossContextNodesTest extends AbstractTestClass {
 		exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATED_BY, URI_PERSON1));
 		assertExpectedUris();
 	}
-	
+
 	// ----------------------------------------------------------------------
 	// Helper methods
 	// ----------------------------------------------------------------------
diff --git a/api/src/test/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.java b/api/src/test/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.java
index ba437f61..4c4f1144 100644
--- a/api/src/test/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.java
+++ b/api/src/test/java/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.java
@@ -1,448 +1,448 @@
-/* $This file is distributed under the terms of the license in LICENSE$ */
-
-package edu.cornell.mannlib.vivo.auth.policy;
-
-import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.AUTHORIZED;
-import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.INCONCLUSIVE;
-import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_LITERAL;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import stubs.edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBeanStub;
-import stubs.javax.servlet.ServletContextStub;
-
-import org.apache.jena.ontology.OntModel;
-import org.apache.jena.ontology.OntModelSpec;
-import org.apache.jena.rdf.model.Model;
-import org.apache.jena.rdf.model.ModelFactory;
-import org.apache.jena.rdf.model.Statement;
-import org.apache.jena.rdf.model.StmtIterator;
-
-import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
-import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
-import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
-import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasProfile;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization;
-import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.ServerStatus;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
-import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.resource.AddResource;
-import edu.cornell.mannlib.vitro.webapp.beans.Property;
-import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
-
-/**
- * Check the relationships in the SelfEditorRelationshipPolicy.
- * 
- * This only checks the relationships that deal with InfoContentEntitys. Testing
- * the others seems too redundant. If we generalize this to use configurable
- * relationships, then we'll be able to make more general tests as well.
- */
-public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
-	private static final Log log = LogFactory
-			.getLog(SelfEditorRelationshipPolicyTest.class);
-
-	/** Can edit properties or resources in this namespace. */
-	private static final String NS_PERMITTED = "http://vivo.mydomain.edu/individual/";
-
-	/** Can't edit properties or resources in this namespace. */
-	private static final String NS_RESTRICTED = VitroVocabulary.vitroURI;
-
-	/** The resource type is not checked by the admin restrictor. */
-	private static final String RESOURCE_TYPE = NS_RESTRICTED + "funkyType";
-
-	private static final String URI_PERMITTED_RESOURCE = NS_PERMITTED
-			+ "permittedResource";
-	private static final String URI_RESTRICTED_RESOURCE = NS_RESTRICTED
-			+ "restrictedResource";
-
-	private static final String URI_PERMITTED_PREDICATE = NS_PERMITTED
-			+ "permittedPredicate";
-	private static final Property PERMITTED_PREDICATE = new Property(
-			URI_PERMITTED_PREDICATE);
-	private static final String URI_RESTRICTED_PREDICATE = NS_RESTRICTED
-			+ "restrictedPredicate";
-	private static final Property RESTRICTED_PREDICATE = new Property(
-			URI_RESTRICTED_PREDICATE);
-
-	/**
-	 * Where the model statements are stored for this test.
-	 */
-	private static final String N3_DATA_FILENAME = "SelfEditorRelationship"
-			+ "PolicyTest.n3";
-
-	/**
-	 * These URIs must match the data in the N3 file.
-	 */
-	private static final String URI_BOZO = NS_PERMITTED + "bozo";
-	private static final String URI_JOE = NS_PERMITTED + "joe";
-	private static final String URI_NOBODY_WROTE_IT = NS_PERMITTED
-			+ "nobodyWroteIt";
-	private static final String URI_BOZO_WROTE_IT = NS_PERMITTED
-			+ "bozoWroteIt";
-	private static final String URI_BOZO_EDITED_IT = NS_PERMITTED
-			+ "bozoEditedIt";
-	private static final String URI_BOZO_FEATURED_IN_IT = NS_PERMITTED
-			+ "bozoFeaturedInIt";
-	private static final String URI_JOE_WROTE_IT = NS_PERMITTED + "joeWroteIt";
-	private static final String URI_JOE_EDITED_IT = NS_PERMITTED
-			+ "joeEditedIt";
-	private static final String URI_JOE_FEATURED_IN_IT = NS_PERMITTED
-			+ "joeFeaturedInIt";
-
-	private static OntModel ontModel;
-
-	@BeforeClass
-	public static void setupModel() throws IOException {
-		InputStream stream = SelfEditorRelationshipPolicyTest.class
-				.getResourceAsStream(N3_DATA_FILENAME);
-		Model model = ModelFactory.createDefaultModel();
-		model.read(stream, null, "N3");
-		stream.close();
-
-		ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,
-				model);
-		ontModel.prepare();
-		dumpModel();
-	}
-
-	private SelfEditorRelationshipPolicy policy;
-	private RequestedAction action;
-
-	@Before
-	public void setupPolicy() {
-		ServletContextStub ctx = new ServletContextStub();
-		PropertyRestrictionBeanStub.getInstance(new String[] { NS_RESTRICTED });
-
-		policy = new SelfEditorRelationshipPolicy(ctx);
-	}
-
-	private IdentifierBundle idNobody;
-	private IdentifierBundle idBozo;
-	private IdentifierBundle idJoe;
-	private IdentifierBundle idBozoAndJoe;
-
-	@Before
-	public void setupIdBundles() {
-		idNobody = new ArrayIdentifierBundle();
-
-		idBozo = new ArrayIdentifierBundle();
-		idBozo.add(makeSelfEditingId(URI_BOZO));
-
-		idJoe = new ArrayIdentifierBundle();
-		idJoe.add(makeSelfEditingId(URI_JOE));
-
-		idBozoAndJoe = new ArrayIdentifierBundle();
-		idBozoAndJoe.add(makeSelfEditingId(URI_BOZO));
-		idBozoAndJoe.add(makeSelfEditingId(URI_JOE));
-	}
-
-	@Before
-	public void setLogging() {
-		// setLoggerLevel(this.getClass(), Level.DEBUG);
-	}
-
-	// ----------------------------------------------------------------------
-	// boilerplate tests
-	// ----------------------------------------------------------------------
-
-	@Test
-	public void whoIsNull() {
-		action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(null, action));
-	}
-
-	@Test
-	public void whatIsNull() {
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, null));
-	}
-
-	@Test
-	public void notSelfEditing() {
-		action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
-	}
-
-	@Test
-	public void requestedActionOutOfScope() {
-		action = new ServerStatus();
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsRestricted() {
-		action = new AddDataPropertyStatement(ontModel,
-				URI_RESTRICTED_RESOURCE, URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void dataPropPredicateIsRestricted() {
-		action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
-				URI_RESTRICTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsRestricted() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_RESTRICTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropPredicateIsRestricted() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, RESTRICTED_PREDICATE, URI_JOE_EDITED_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsRestricted() {
-		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
-				PERMITTED_PREDICATE, URI_RESTRICTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	// ----------------------------------------------------------------------
-	// InfoContentEntity tests
-	// ----------------------------------------------------------------------
-
-	@Test
-	public void dataPropSubjectIsIceButNobodyIsSelfEditing() {
-		action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceButNoAuthorsOrEditorsOrFeatured() {
-		action = new AddDataPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceButWrongAuthor() {
-		action = new AddDataPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceButWrongEditor() {
-		action = new AddDataPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceButWrongFeatured() {
-		action = new AddDataPropertyStatement(ontModel,
-				URI_BOZO_FEATURED_IN_IT, URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceWithSelfEditingAuthor() {
-		action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceWithSelfEditingEditor() {
-		action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void dataPropSubjectIsIceWithSelfEditingFeatured() {
-		action = new AddDataPropertyStatement(ontModel, URI_JOE_FEATURED_IN_IT,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceButNobodyIsSelfEditing() {
-		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceButNoAuthorsOrEditorsOrFeatured() {
-		action = new AddObjectPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceButWrongAuthor() {
-		action = new AddObjectPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceButWrongEditor() {
-		action = new AddObjectPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceButWrongFeatured() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_BOZO_FEATURED_IN_IT, PERMITTED_PREDICATE,
-				URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceWithSelfEditingAuthor() {
-		action = new AddObjectPropertyStatement(ontModel, URI_JOE_WROTE_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceWithSelfEditingEditor() {
-		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
-				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropSubjectIsIceWithSelfEditingFeatured() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_JOE_FEATURED_IN_IT, PERMITTED_PREDICATE,
-				URI_PERMITTED_RESOURCE);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIcebutNobodyIsSelfEditing() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceButNoAuthorsOrEditors() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
-				URI_NOBODY_WROTE_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceButWrongAuthor() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_BOZO_WROTE_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceButWrongEditor() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_BOZO_EDITED_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceButWrongFeatured() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
-				URI_BOZO_FEATURED_IN_IT);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceWithSelfEditingAuthor() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_WROTE_IT);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceWithSelfEditingEditor() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	@Test
-	public void objectPropObjectIsIceWithSelfEditingFeatured() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
-				URI_JOE_FEATURED_IN_IT);
-		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
-		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
-	}
-
-	// ----------------------------------------------------------------------
-	// Other tests
-	// ----------------------------------------------------------------------
-
-	@Test
-	public void dataPropSubjectIsNotIce() {
-		action = new AddDataPropertyStatement(ontModel, URI_PERMITTED_RESOURCE,
-				URI_PERMITTED_PREDICATE, SOME_LITERAL);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	@Test
-	public void objectPropNeitherSubjectOrObjectIsIce() {
-		action = new AddObjectPropertyStatement(ontModel,
-				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
-				URI_PERMITTED_RESOURCE);
-		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
-	}
-
-	// ----------------------------------------------------------------------
-	// helper methods
-	// ----------------------------------------------------------------------
-
-	private HasProfile makeSelfEditingId(String uri) {
-		return new HasProfile(uri);
-	}
-
-	private void assertDecision(Authorization expected, PolicyDecision decision) {
-		log.debug("Decision is: " + decision);
-		assertNotNull("decision exists", decision);
-		assertEquals("authorization", expected, decision.getAuthorized());
-	}
-
-	private static void dumpModel() {
-		if (log.isDebugEnabled()) {
-			StmtIterator stmtIt = ontModel.listStatements();
-			while (stmtIt.hasNext()) {
-				Statement stmt = stmtIt.next();
-				log.debug("stmt: " + stmt);
-			}
-		}
-	}
-}
+/* $This file is distributed under the terms of the license in LICENSE$ */
+
+package edu.cornell.mannlib.vivo.auth.policy;
+
+import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.AUTHORIZED;
+import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.INCONCLUSIVE;
+import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_LITERAL;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import stubs.edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBeanStub;
+import stubs.javax.servlet.ServletContextStub;
+
+import org.apache.jena.ontology.OntModel;
+import org.apache.jena.ontology.OntModelSpec;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.Statement;
+import org.apache.jena.rdf.model.StmtIterator;
+
+import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
+import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
+import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
+import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasProfile;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization;
+import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.ServerStatus;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.resource.AddResource;
+import edu.cornell.mannlib.vitro.webapp.beans.Property;
+import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
+
+/**
+ * Check the relationships in the SelfEditorRelationshipPolicy.
+ *
+ * This only checks the relationships that deal with InfoContentEntitys. Testing
+ * the others seems too redundant. If we generalize this to use configurable
+ * relationships, then we'll be able to make more general tests as well.
+ */
+public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
+	private static final Log log = LogFactory
+			.getLog(SelfEditorRelationshipPolicyTest.class);
+
+	/** Can edit properties or resources in this namespace. */
+	private static final String NS_PERMITTED = "http://vivo.mydomain.edu/individual/";
+
+	/** Can't edit properties or resources in this namespace. */
+	private static final String NS_RESTRICTED = VitroVocabulary.vitroURI;
+
+	/** The resource type is not checked by the admin restrictor. */
+	private static final String RESOURCE_TYPE = NS_RESTRICTED + "funkyType";
+
+	private static final String URI_PERMITTED_RESOURCE = NS_PERMITTED
+			+ "permittedResource";
+	private static final String URI_RESTRICTED_RESOURCE = NS_RESTRICTED
+			+ "restrictedResource";
+
+	private static final String URI_PERMITTED_PREDICATE = NS_PERMITTED
+			+ "permittedPredicate";
+	private static final Property PERMITTED_PREDICATE = new Property(
+			URI_PERMITTED_PREDICATE);
+	private static final String URI_RESTRICTED_PREDICATE = NS_RESTRICTED
+			+ "restrictedPredicate";
+	private static final Property RESTRICTED_PREDICATE = new Property(
+			URI_RESTRICTED_PREDICATE);
+
+	/**
+	 * Where the model statements are stored for this test.
+	 */
+	private static final String N3_DATA_FILENAME = "SelfEditorRelationship"
+			+ "PolicyTest.n3";
+
+	/**
+	 * These URIs must match the data in the N3 file.
+	 */
+	private static final String URI_BOZO = NS_PERMITTED + "bozo";
+	private static final String URI_JOE = NS_PERMITTED + "joe";
+	private static final String URI_NOBODY_WROTE_IT = NS_PERMITTED
+			+ "nobodyWroteIt";
+	private static final String URI_BOZO_WROTE_IT = NS_PERMITTED
+			+ "bozoWroteIt";
+	private static final String URI_BOZO_EDITED_IT = NS_PERMITTED
+			+ "bozoEditedIt";
+	private static final String URI_BOZO_FEATURED_IN_IT = NS_PERMITTED
+			+ "bozoFeaturedInIt";
+	private static final String URI_JOE_WROTE_IT = NS_PERMITTED + "joeWroteIt";
+	private static final String URI_JOE_EDITED_IT = NS_PERMITTED
+			+ "joeEditedIt";
+	private static final String URI_JOE_FEATURED_IN_IT = NS_PERMITTED
+			+ "joeFeaturedInIt";
+
+	private static OntModel ontModel;
+
+	@BeforeClass
+	public static void setupModel() throws IOException {
+		InputStream stream = SelfEditorRelationshipPolicyTest.class
+				.getResourceAsStream(N3_DATA_FILENAME);
+		Model model = ModelFactory.createDefaultModel();
+		model.read(stream, null, "N3");
+		stream.close();
+
+		ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,
+				model);
+		ontModel.prepare();
+		dumpModel();
+	}
+
+	private SelfEditorRelationshipPolicy policy;
+	private RequestedAction action;
+
+	@Before
+	public void setupPolicy() {
+		ServletContextStub ctx = new ServletContextStub();
+		PropertyRestrictionBeanStub.getInstance(new String[] { NS_RESTRICTED });
+
+		policy = new SelfEditorRelationshipPolicy(ctx);
+	}
+
+	private IdentifierBundle idNobody;
+	private IdentifierBundle idBozo;
+	private IdentifierBundle idJoe;
+	private IdentifierBundle idBozoAndJoe;
+
+	@Before
+	public void setupIdBundles() {
+		idNobody = new ArrayIdentifierBundle();
+
+		idBozo = new ArrayIdentifierBundle();
+		idBozo.add(makeSelfEditingId(URI_BOZO));
+
+		idJoe = new ArrayIdentifierBundle();
+		idJoe.add(makeSelfEditingId(URI_JOE));
+
+		idBozoAndJoe = new ArrayIdentifierBundle();
+		idBozoAndJoe.add(makeSelfEditingId(URI_BOZO));
+		idBozoAndJoe.add(makeSelfEditingId(URI_JOE));
+	}
+
+	@Before
+	public void setLogging() {
+		// setLoggerLevel(this.getClass(), Level.DEBUG);
+	}
+
+	// ----------------------------------------------------------------------
+	// boilerplate tests
+	// ----------------------------------------------------------------------
+
+	@Test
+	public void whoIsNull() {
+		action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(null, action));
+	}
+
+	@Test
+	public void whatIsNull() {
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, null));
+	}
+
+	@Test
+	public void notSelfEditing() {
+		action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
+	}
+
+	@Test
+	public void requestedActionOutOfScope() {
+		action = new ServerStatus();
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsRestricted() {
+		action = new AddDataPropertyStatement(ontModel,
+				URI_RESTRICTED_RESOURCE, URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void dataPropPredicateIsRestricted() {
+		action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
+				URI_RESTRICTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsRestricted() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_RESTRICTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropPredicateIsRestricted() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, RESTRICTED_PREDICATE, URI_JOE_EDITED_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsRestricted() {
+		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
+				PERMITTED_PREDICATE, URI_RESTRICTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	// ----------------------------------------------------------------------
+	// InfoContentEntity tests
+	// ----------------------------------------------------------------------
+
+	@Test
+	public void dataPropSubjectIsIceButNobodyIsSelfEditing() {
+		action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceButNoAuthorsOrEditorsOrFeatured() {
+		action = new AddDataPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceButWrongAuthor() {
+		action = new AddDataPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceButWrongEditor() {
+		action = new AddDataPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceButWrongFeatured() {
+		action = new AddDataPropertyStatement(ontModel,
+				URI_BOZO_FEATURED_IN_IT, URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceWithSelfEditingAuthor() {
+		action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceWithSelfEditingEditor() {
+		action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void dataPropSubjectIsIceWithSelfEditingFeatured() {
+		action = new AddDataPropertyStatement(ontModel, URI_JOE_FEATURED_IN_IT,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceButNobodyIsSelfEditing() {
+		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceButNoAuthorsOrEditorsOrFeatured() {
+		action = new AddObjectPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceButWrongAuthor() {
+		action = new AddObjectPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceButWrongEditor() {
+		action = new AddObjectPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceButWrongFeatured() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_BOZO_FEATURED_IN_IT, PERMITTED_PREDICATE,
+				URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceWithSelfEditingAuthor() {
+		action = new AddObjectPropertyStatement(ontModel, URI_JOE_WROTE_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceWithSelfEditingEditor() {
+		action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
+				PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropSubjectIsIceWithSelfEditingFeatured() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_JOE_FEATURED_IN_IT, PERMITTED_PREDICATE,
+				URI_PERMITTED_RESOURCE);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIcebutNobodyIsSelfEditing() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceButNoAuthorsOrEditors() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
+				URI_NOBODY_WROTE_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceButWrongAuthor() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_BOZO_WROTE_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceButWrongEditor() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_BOZO_EDITED_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceButWrongFeatured() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
+				URI_BOZO_FEATURED_IN_IT);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceWithSelfEditingAuthor() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_WROTE_IT);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceWithSelfEditingEditor() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	@Test
+	public void objectPropObjectIsIceWithSelfEditingFeatured() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
+				URI_JOE_FEATURED_IN_IT);
+		assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
+		assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
+	}
+
+	// ----------------------------------------------------------------------
+	// Other tests
+	// ----------------------------------------------------------------------
+
+	@Test
+	public void dataPropSubjectIsNotIce() {
+		action = new AddDataPropertyStatement(ontModel, URI_PERMITTED_RESOURCE,
+				URI_PERMITTED_PREDICATE, SOME_LITERAL);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	@Test
+	public void objectPropNeitherSubjectOrObjectIsIce() {
+		action = new AddObjectPropertyStatement(ontModel,
+				URI_PERMITTED_RESOURCE, PERMITTED_PREDICATE,
+				URI_PERMITTED_RESOURCE);
+		assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
+	}
+
+	// ----------------------------------------------------------------------
+	// helper methods
+	// ----------------------------------------------------------------------
+
+	private HasProfile makeSelfEditingId(String uri) {
+		return new HasProfile(uri);
+	}
+
+	private void assertDecision(Authorization expected, PolicyDecision decision) {
+		log.debug("Decision is: " + decision);
+		assertNotNull("decision exists", decision);
+		assertEquals("authorization", expected, decision.getAuthorized());
+	}
+
+	private static void dumpModel() {
+		if (log.isDebugEnabled()) {
+			StmtIterator stmtIt = ontModel.listStatements();
+			while (stmtIt.hasNext()) {
+				Statement stmt = stmtIt.next();
+				log.debug("stmt: " + stmt);
+			}
+		}
+	}
+}
diff --git a/api/src/test/resources/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.n3 b/api/src/test/resources/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.n3
index c2c53caa..198bb775 100644
--- a/api/src/test/resources/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.n3
+++ b/api/src/test/resources/edu/cornell/mannlib/vivo/auth/policy/SelfEditorRelationshipPolicyTest.n3
@@ -1,165 +1,165 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
-
-@prefix rdf:  .
-@prefix rdfs:  .
-@prefix owl:  .
-@prefix foaf:  .
-@prefix bib:  .
-@prefix core:  .
-@prefix obo:  .
-@prefix mydomain:  .
-
-
-### This file contains data for SelfEditorRelationshipPolicyTest.java.
-
-#
-# Bozo
-#
-mydomain:bozo
-	a foaf:Agent ;
-	a foaf:Person ;
-	a owl:Thing ;
-	a core:EmeritusProfessor ;
-	rdfs:label "Person, Bozo" ;
-	foaf:firstName "Bozo" ;
-	foaf:lastName "Person" ;
-	core:relatedBy mydomain:authorshipBozo ;
-	core:relatedBy mydomain:editorshipBozo ;
-	.
-
-#
-# Joe
-#
-mydomain:joe
-	a foaf:Agent ;
-	a foaf:Person ;
-	a owl:Thing ;
-	a core:EmeritusProfessor ;
-	rdfs:label "Person, Joe" ;
-	foaf:firstName "Joe" ;
-	foaf:lastName "Person" ;
-	core:relatedBy mydomain:authorshipJoe ;
-	core:relatedBy mydomain:editorshipJoe ;
-	.
-
-#
-# info content entity with no author or editor
-#
-mydomain:nobodyWroteIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "No author or editor" ;
-	.
-
-#
-# info content entity with Bozo as author
-#
-mydomain:bozoWroteIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Bozo is author" ;
-	core:relatedBy mydomain:authorshipBozo ;
-	.
-
-mydomain:authorshipBozo
-	a core:Authorship ;
-	a core:Relationship ;
-	a owl:Thing ;
-	core:relates mydomain:bozoWroteIt ;
-	core:relates mydomain:bozo ;
-	.
-
-#
-# info content entity with Bozo as editor 
-#
-mydomain:bozoEditedIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Bozo is editor" ;
-	core:relatedBy mydomain:editorshipBozo ;
-	.
-
-mydomain:editorshipBozo
-	a core:Editorship ;
-	a core:Relationship ;
-	a owl:Thing ;
-	core:relates mydomain:bozoEditedIt ;
-	core:relates mydomain:bozo ;
-	.
-
-#
-# info content entity with Bozo featured 
-#
-mydomain:bozoFeaturedInIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Bozo is featured" ;
-	core:features mydomain:bozo ;
-	.
-
-#
-# info content entity with Joe as author
-#
-mydomain:joeWroteIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Joe is author" ;
-	core:relatedBy mydomain:authorshipJoe ;
-	.
-
-mydomain:authorshipJoe
-	a core:Authorship ;
-	a core:Relationship ;
-	a owl:Thing ;
-	core:relates mydomain:joeWroteIt ;
-	core:relates mydomain:joe ;
-	.
-
-#
-# info content entity with Joe as editor 
-#
-mydomain:joeEditedIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Joe is editor" ;
-	core:relatedBy mydomain:editorshipJoe ;
-	.
-
-mydomain:editorshipJoe
-	a core:Editorship ;
-	a core:Relationship ;
-	a owl:Thing ;
-	core:relates mydomain:joeEditedIt ;
-	core:relates mydomain:joe ;
-	.
-
-#
-# info content entity with Joe featured 
-#
-mydomain:joeFeaturedInIt
-	a core:BlogPosting ;
-	a obo:IAO_0000030 ;
-	a bib:Article ;
-	a bib:Document ;
-	a owl:Thing ;
-	rdfs:label "Joe is featured" ;
-	core:features mydomain:joe ;
-	.
+# $This file is distributed under the terms of the license in LICENSE$
+
+@prefix rdf:  .
+@prefix rdfs:  .
+@prefix owl:  .
+@prefix foaf:  .
+@prefix bib:  .
+@prefix core:  .
+@prefix obo:  .
+@prefix mydomain:  .
+
+
+### This file contains data for SelfEditorRelationshipPolicyTest.java.
+
+#
+# Bozo
+#
+mydomain:bozo
+	a foaf:Agent ;
+	a foaf:Person ;
+	a owl:Thing ;
+	a core:EmeritusProfessor ;
+	rdfs:label "Person, Bozo" ;
+	foaf:firstName "Bozo" ;
+	foaf:lastName "Person" ;
+	core:relatedBy mydomain:authorshipBozo ;
+	core:relatedBy mydomain:editorshipBozo ;
+	.
+
+#
+# Joe
+#
+mydomain:joe
+	a foaf:Agent ;
+	a foaf:Person ;
+	a owl:Thing ;
+	a core:EmeritusProfessor ;
+	rdfs:label "Person, Joe" ;
+	foaf:firstName "Joe" ;
+	foaf:lastName "Person" ;
+	core:relatedBy mydomain:authorshipJoe ;
+	core:relatedBy mydomain:editorshipJoe ;
+	.
+
+#
+# info content entity with no author or editor
+#
+mydomain:nobodyWroteIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "No author or editor" ;
+	.
+
+#
+# info content entity with Bozo as author
+#
+mydomain:bozoWroteIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Bozo is author" ;
+	core:relatedBy mydomain:authorshipBozo ;
+	.
+
+mydomain:authorshipBozo
+	a core:Authorship ;
+	a core:Relationship ;
+	a owl:Thing ;
+	core:relates mydomain:bozoWroteIt ;
+	core:relates mydomain:bozo ;
+	.
+
+#
+# info content entity with Bozo as editor
+#
+mydomain:bozoEditedIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Bozo is editor" ;
+	core:relatedBy mydomain:editorshipBozo ;
+	.
+
+mydomain:editorshipBozo
+	a core:Editorship ;
+	a core:Relationship ;
+	a owl:Thing ;
+	core:relates mydomain:bozoEditedIt ;
+	core:relates mydomain:bozo ;
+	.
+
+#
+# info content entity with Bozo featured
+#
+mydomain:bozoFeaturedInIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Bozo is featured" ;
+	core:features mydomain:bozo ;
+	.
+
+#
+# info content entity with Joe as author
+#
+mydomain:joeWroteIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Joe is author" ;
+	core:relatedBy mydomain:authorshipJoe ;
+	.
+
+mydomain:authorshipJoe
+	a core:Authorship ;
+	a core:Relationship ;
+	a owl:Thing ;
+	core:relates mydomain:joeWroteIt ;
+	core:relates mydomain:joe ;
+	.
+
+#
+# info content entity with Joe as editor
+#
+mydomain:joeEditedIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Joe is editor" ;
+	core:relatedBy mydomain:editorshipJoe ;
+	.
+
+mydomain:editorshipJoe
+	a core:Editorship ;
+	a core:Relationship ;
+	a owl:Thing ;
+	core:relates mydomain:joeEditedIt ;
+	core:relates mydomain:joe ;
+	.
+
+#
+# info content entity with Joe featured
+#
+mydomain:joeFeaturedInIt
+	a core:BlogPosting ;
+	a obo:IAO_0000030 ;
+	a bib:Article ;
+	a bib:Document ;
+	a owl:Thing ;
+	rdfs:label "Joe is featured" ;
+	core:features mydomain:joe ;
+	.
diff --git a/api/src/test/resources/log4j.properties b/api/src/test/resources/log4j.properties
index 689d1db8..efa92dd0 100644
--- a/api/src/test/resources/log4j.properties
+++ b/api/src/test/resources/log4j.properties
@@ -1,10 +1,10 @@
-#
-# A simple Log4J configuration for unit tests. 
-#
-# It's not very important, because the tests themselves will override this 
-# configuration in AbstractTestClass.initializeLogging().
-#
-log4j.rootLogger=WARN, AllAppender
-log4j.appender.AllAppender=org.apache.log4j.ConsoleAppender
-log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.AllAppender.layout.ConversionPattern=%p %t %c - %m%n
+#
+# A simple Log4J configuration for unit tests.
+#
+# It's not very important, because the tests themselves will override this
+# configuration in AbstractTestClass.initializeLogging().
+#
+log4j.rootLogger=WARN, AllAppender
+log4j.appender.AllAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.AllAppender.layout.ConversionPattern=%p %t %c - %m%n
diff --git a/home/src/main/resources/config/example.applicationSetup.n3 b/home/src/main/resources/config/example.applicationSetup.n3
index 0d079ad5..d5622c2f 100644
--- a/home/src/main/resources/config/example.applicationSetup.n3
+++ b/home/src/main/resources/config/example.applicationSetup.n3
@@ -3,7 +3,7 @@
 # This file specifies the structure of the Vitro application: which modules
 # are used, and what parameters they require.
 #
-# Most Vitro installations will not need to modify this file. 
+# Most Vitro installations will not need to modify this file.
 #
 # For most installations, only the settings in the runtime.properties file will
 # be changed.
@@ -15,11 +15,11 @@
 
 # ----------------------------
 #
-# Describe the application by its implementing class and by references to the 
+# Describe the application by its implementing class and by references to the
 # modules it uses.
-# 
+#
 
-:application 
+:application
     a   vitroWebapp:application.ApplicationImpl ,
         vitroWebapp:modules.Application ;
     :hasSearchEngine              :instrumentedSearchEngineWrapper ;
@@ -32,7 +32,7 @@
 
 # ----------------------------
 #
-# Image processor module: 
+# Image processor module:
 #
 
 :iioImageProcessor
@@ -41,25 +41,25 @@
 
 # ----------------------------
 #
-# File storage module: 
+# File storage module:
 #    The PairTree-inspired implementation is the only standard option.
 #    It requires no parameters.
 #
 
-:ptiFileStorage 
+:ptiFileStorage
     a   vitroWebapp:filestorage.impl.FileStorageImplWrapper ,
         vitroWebapp:modules.fileStorage.FileStorage .
-               
+
 # ----------------------------
 #
-# Search engine module: 
+# Search engine module:
 #    The Solr-based implementation is the only standard option, but it can be
-#    wrapped in an "instrumented" wrapper, which provides additional logging 
+#    wrapped in an "instrumented" wrapper, which provides additional logging
 #    and more rigorous life-cycle checking.
 #
 
-:instrumentedSearchEngineWrapper 
-    a   vitroWebapp:searchengine.InstrumentedSearchEngineWrapper , 
+:instrumentedSearchEngineWrapper
+    a   vitroWebapp:searchengine.InstrumentedSearchEngineWrapper ,
         vitroWebapp:modules.searchEngine.SearchEngine ;
     :wraps :solrSearchEngine .
 
@@ -69,8 +69,8 @@
 
 # ----------------------------
 #
-# Search indexer module: 
-#    There is only one standard implementation. You must specify the number of 
+# Search indexer module:
+#    There is only one standard implementation. You must specify the number of
 #    worker threads in the thread pool.
 #
 
@@ -78,14 +78,14 @@
     a   vitroWebapp:searchindex.SearchIndexerImpl ,
         vitroWebapp:modules.searchIndexer.SearchIndexer ;
     :threadPoolSize "10" .
-    
+
 # ----------------------------
 #
 # Content triples source module: holds data contents
 #    The SDB-based implementation is the default option. It reads its parameters
 #    from the runtime.properties file, for backward compatibility.
 #
-#    Other implementations are based on a local TDB instance, a "standard" SPARQL 
+#    Other implementations are based on a local TDB instance, a "standard" SPARQL
 #    endpoint, or a Virtuoso endpoint, with parameters as shown.
 #
 
@@ -104,7 +104,7 @@
 #        vitroWebapp:modules.tripleSource.ContentTripleSource ;
 #    # The URI of the SPARQL endpoint for your triple-store.
 #    :hasEndpointURI "PUT_YOUR_SPARQL_ENDPOINT_URI_HERE" ;
-#    # The URI to use for SPARQL UPDATE calls against your triple-store. 
+#    # The URI to use for SPARQL UPDATE calls against your triple-store.
 #    :hasUpdateEndpointURI "PUT_THE UPDATE_URI_HERE" .
 
 #:virtuosoContentTripleSource
@@ -127,10 +127,10 @@
 :tdbConfigurationTripleSource
     a   vitroWebapp:triplesource.impl.tdb.ConfigurationTripleSourceTDB ,
         vitroWebapp:modules.tripleSource.ConfigurationTripleSource .
-        
+
 # ----------------------------
 #
-# TBox reasoner module: 
+# TBox reasoner module:
 #    The JFact-based implementation is the only standard option.
 #    It requires no parameters.
 #
diff --git a/home/src/main/resources/config/example.runtime.properties b/home/src/main/resources/config/example.runtime.properties
index f665b0fc..03561d66 100644
--- a/home/src/main/resources/config/example.runtime.properties
+++ b/home/src/main/resources/config/example.runtime.properties
@@ -4,13 +4,13 @@
 #
 # This file is provided as example.runtime.properties.
 #
-# Save a copy of this file as runtime.properties in your VIVO home directory, 
+# Save a copy of this file as runtime.properties in your VIVO home directory,
 # and edit the properties as needed for your installation.
 #
 # For more information on specific properties, see the configuration reference
 # or installation options section of the technical documentation for the
 # version of VIVO you are running:
-# https://wiki.duraspace.org/display/VIVO/VIVO+Technical+Documentation 
+# https://wiki.duraspace.org/display/VIVO/VIVO+Technical+Documentation
 #
 # -----------------------------------------------------------------------------
 
@@ -19,13 +19,13 @@
 # BASIC PROPERTIES
 # -----------------------------------------------------------------------------
 
-  # 
-  # This namespace will be used when generating URIs for objects created in the 
-  # editor. In order to serve linked data, the default namespace must be composed 
-  # as follows (optional elements in parentheses): 
+  #
+  # This namespace will be used when generating URIs for objects created in the
+  # editor. In order to serve linked data, the default namespace must be composed
+  # as follows (optional elements in parentheses):
   #
   # scheme + server_name (+ port) (+ servlet_context) + "/individual/"
-  # 
+  #
   # For example, Cornell's default namespace is:
   #
   # http://vivo.cornell.edu/individual/
@@ -33,9 +33,9 @@
 Vitro.defaultNamespace = http://vivo.mydomain.edu/individual/
 
   #
-  # The email address of the root user for the VIVO application. The password 
-  # for this user is initially set to "rootPassword", but you will be asked to 
-  # change the password the first time you log in. 
+  # The email address of the root user for the VIVO application. The password
+  # for this user is initially set to "rootPassword", but you will be asked to
+  # change the password the first time you log in.
   #
 rootUser.emailAddress = vivo_root@mydomain.edu
 
@@ -57,8 +57,8 @@ argon2.memory = 1024
 argon2.time = 1000
 
   #
-  # The basic parameters for a database connection. Change the end of the 
-  # URL to reflect your database name (if it is not "vitrodb"). Change the username 
+  # The basic parameters for a database connection. Change the end of the
+  # URL to reflect your database name (if it is not "vitrodb"). Change the username
   # and password to match the authorized database user you created.
   #
 VitroConnection.DataSource.url = jdbc:mysql://localhost/vitrodb
@@ -66,14 +66,14 @@ VitroConnection.DataSource.username = vitrodbUsername
 VitroConnection.DataSource.password = vitrodbPassword
 
   #
-  # Email parameters which VIVO can use to send mail. If these are left empty, 
+  # Email parameters which VIVO can use to send mail. If these are left empty,
   # the "Contact Us" form will be disabled and users will not be notified of
   # changes to their accounts.
   #
 email.smtpHost = smtp.mydomain.edu
 email.replyTo = vivoAdmin@mydomain.edu
 
-  # 
+  #
   # URL of Solr context used in local VIVO search. This will usually consist of:
   #     scheme + server_name + port + vivo_webapp_name + "solr"
   # In the standard installation, the Solr context will be on the same server as VIVO,
@@ -90,7 +90,7 @@ vitro.local.solr.url = http://localhost:8080/vivosolr
 # -----------------------------------------------------------------------------
 
   #
-  # How is a logged-in user associated with a particular Individual? One way is 
+  # How is a logged-in user associated with a particular Individual? One way is
   # for the Individual to have a property whose value is the username of the user.
   # This value should be the URI for that property.
   #
@@ -103,11 +103,11 @@ selfEditing.idMatchingProperty = http://vivo.mydomain.edu/ns#networkId
 
   #
   # If an external authentication system like Shibboleth or CUWebAuth is to be
-  # used, this property says which HTTP header will contain the user ID from 
-  # the authentication system. If such a system is not to be used, leave this 
-  # commented out. Consult the installation instructions for more details. 
+  # used, this property says which HTTP header will contain the user ID from
+  # the authentication system. If such a system is not to be used, leave this
+  # commented out. Consult the installation instructions for more details.
   #
-#externalAuth.netIdHeaderName = remote_userID 
+#externalAuth.netIdHeaderName = remote_userID
 
 
 # -----------------------------------------------------------------------------
@@ -133,16 +133,16 @@ VitroConnection.DataSource.pool.maxIdle = 10
 # -----------------------------------------------------------------------------
 
   #
-  # Parameters to change in order to use VIVO with a database other than 
+  # Parameters to change in order to use VIVO with a database other than
   # MySQL.
   #
 VitroConnection.DataSource.dbtype = MySQL
 VitroConnection.DataSource.driver = com.mysql.jdbc.Driver
 VitroConnection.DataSource.validationQuery = SELECT 1
 
-  # Note: the above parameters allow you to change the relational database that 
-  # is used as the back end for Jena SDB. If you want to use a triple store 
-  # other than SDB, you will need to edit applicationSetup.n3. See the 
+  # Note: the above parameters allow you to change the relational database that
+  # is used as the back end for Jena SDB. If you want to use a triple store
+  # other than SDB, you will need to edit applicationSetup.n3. See the
   # installation instructions for more details.
 
 
@@ -155,19 +155,19 @@ VitroConnection.DataSource.validationQuery = SELECT 1
   # The base URL of the ORNG Shindig server. Usually, this is the same host and port
   # number as VIVO itself, with a context path of "shindigorng".
   #
-#OpenSocial.shindigURL = http://localhost:8080/shindigorng 
+#OpenSocial.shindigURL = http://localhost:8080/shindigorng
 
   #
   # For OpenSocial integration
   # The host name and port number of the service that provides security tokens for VIVO and
   # Shindig to share. For now, the host name must be the actual host, not "localhost" or "127.0.0.1"
-  # The port number must be 8777 
+  # The port number must be 8777
   #
 #OpenSocial.tokenService = myhost.mydomain.edu:8777
 
   #
   # For OpenSocial integration
-  # The path to the key file that will be used when generating security tokens for VIVO and 
+  # The path to the key file that will be used when generating security tokens for VIVO and
   # shindig to share.
   #
 #OpenSocial.tokenKeyFile = /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt
@@ -184,26 +184,26 @@ VitroConnection.DataSource.validationQuery = SELECT 1
 # -----------------------------------------------------------------------------
 
   #
-  # Show only the most appropriate data values based on the Accept-Language 
+  # Show only the most appropriate data values based on the Accept-Language
   # header supplied by the browser.  Default is false if not set.
   #
 # RDFService.languageFilter = false
 
   #
-  # Force VIVO to use a specific language or Locale instead of those 
-  # specified by the browser. This affects RDF data retrieved from the model, 
+  # Force VIVO to use a specific language or Locale instead of those
+  # specified by the browser. This affects RDF data retrieved from the model,
   # if RDFService.languageFilter is true. This also affects the text of pages
-  # that have been modified to support multiple languages. 
+  # that have been modified to support multiple languages.
   #
 # languages.forceLocale = en_US
 
   #
   # A list of supported languages or Locales that the user may choose to
   # use instead of the one specified by the browser. Selection images must
-  # be available in the i18n/images directory of the theme. This affects 
-  # RDF data retrieved from the model, if RDFService.languageFilter is true.  
-  # This also affects the text of pages that have been modified to support 
-  # multiple languages. 
+  # be available in the i18n/images directory of the theme. This affects
+  # RDF data retrieved from the model, if RDFService.languageFilter is true.
+  # This also affects the text of pages that have been modified to support
+  # multiple languages.
   #
   # This should not be used with languages.forceLocale, which will override it.
   #
@@ -216,7 +216,7 @@ VitroConnection.DataSource.validationQuery = SELECT 1
 
 # orcid.clientId = 0000-0000-0000-000X
 # orcid.clientPassword = 00000000-0000-0000-0000-000000000000
-  
+
    #
    # The orcid.webappBaseUrl must end in a front slash (/)
    # if it includes a path past the domain and (if required) port.
@@ -297,28 +297,28 @@ VitroConnection.DataSource.validationQuery = SELECT 1
     # Options: tiny, small, medium, large
 #resource.plum-print.size=medium
 
-  #  
-  # When the following flag is set to enabled, the VIVO home page displays a 
-  # global map highlighting the geographical focus of foaf:person individuals. 
+  #
+  # When the following flag is set to enabled, the VIVO home page displays a
+  # global map highlighting the geographical focus of foaf:person individuals.
   #
 #homePage.geoFocusMaps=enabled
 
 
-  #  
-  # VIVO supports the simultaneous use of a full foaf:Person profile page view 
-  # and a "quick" page view that emphasizes the individual's webpage presence. 
+  #
+  # VIVO supports the simultaneous use of a full foaf:Person profile page view
+  # and a "quick" page view that emphasizes the individual's webpage presence.
   # Implementing this feature requires an installation to develop a web service
-  # that captures images of web pages or to use an existing service outside of VIVO. 
+  # that captures images of web pages or to use an existing service outside of VIVO.
   #
 #multiViews.profilePageTypes=enabled
 
 
   #
-  # Tell VIVO to generate HTTP headers on its responses to facilitate caching the 
-  # profile pages that it creates. 
+  # Tell VIVO to generate HTTP headers on its responses to facilitate caching the
+  # profile pages that it creates.
   #
   # Developers will likely want to leave caching disabled, since a change to a
-  # Freemarker template or to a Java class would not cause the page to be 
+  # Freemarker template or to a Java class would not cause the page to be
   # considered stale.
   #
 http.createCacheHeaders = true
@@ -345,12 +345,12 @@ http.createCacheHeaders = true
   #
 # visualization.topLevelOrg = http://vivo.mydomain.edu/individual/topLevelOrgURI
 
-  #  
+  #
   # The temporal graph visualization can require extensive machine resources.
   # This can have a particularly noticeable impact on memory usage if
   # - The organization tree is deep,
   # - The number of grants and publications is large.
-  # VIVO 1.3 release mitigates this problem by the way of a caching mechanism & 
+  # VIVO 1.3 release mitigates this problem by the way of a caching mechanism &
   # hence we can safely set this to be enabled by default.
   #
 visualization.temporal = enabled
@@ -366,7 +366,7 @@ proxy.eligibleTypeList = http://xmlns.com/foaf/0.1/Person, http://xmlns.com/foaf
   # The format for this property is id, name; id1, name1; id2, name2 etc.
   # For more information, see Service Metadata from this page:
   # https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-Api
-  # 
+  #
 Vitro.reconcile.defaultTypeList = http://vivoweb.org/ontology/core#Role, core:Role; \
     http://vivoweb.org/ontology/core#AcademicDegree, core:Academic Degree; \
     http://purl.org/NET/c4dm/event.owl#Event, event:Event; \
diff --git a/home/src/main/resources/rdf/abox/filegraph/academicDegree.rdf b/home/src/main/resources/rdf/abox/filegraph/academicDegree.rdf
index b36d4c4e..1ef12657 100644
--- a/home/src/main/resources/rdf/abox/filegraph/academicDegree.rdf
+++ b/home/src/main/resources/rdf/abox/filegraph/academicDegree.rdf
@@ -15,7 +15,7 @@
     xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:swrl="http://www.w3.org/2003/11/swrl#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
   
     A.M.T.
     
@@ -640,7 +640,7 @@
     M.Ch.E.
     M.Ch.E. Master of Chemical Engineering
     
-   
+  
   
     Th.B.
     Th.B. Bachelor of Theology
@@ -772,5 +772,5 @@
     H.S.C. Higher School Certificate
     
   
-  
+
 
diff --git a/home/src/main/resources/rdf/abox/filegraph/us-states.rdf b/home/src/main/resources/rdf/abox/filegraph/us-states.rdf
index 49f7f1be..2e869213 100644
--- a/home/src/main/resources/rdf/abox/filegraph/us-states.rdf
+++ b/home/src/main/resources/rdf/abox/filegraph/us-states.rdf
@@ -348,4 +348,4 @@
       
       
    
-
\ No newline at end of file
+
diff --git a/home/src/main/resources/rdf/abox/filegraph/validation.n3 b/home/src/main/resources/rdf/abox/filegraph/validation.n3
index 4e4d08c9..24b4cc75 100644
--- a/home/src/main/resources/rdf/abox/filegraph/validation.n3
+++ b/home/src/main/resources/rdf/abox/filegraph/validation.n3
@@ -1,2 +1,2 @@
- 
+
        .
diff --git a/home/src/main/resources/rdf/applicationMetadata/firsttime/classgroups.rdf b/home/src/main/resources/rdf/applicationMetadata/firsttime/classgroups.rdf
index ea7e2480..976b218f 100644
--- a/home/src/main/resources/rdf/applicationMetadata/firsttime/classgroups.rdf
+++ b/home/src/main/resources/rdf/applicationMetadata/firsttime/classgroups.rdf
@@ -15,7 +15,7 @@
     xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:swrl="http://www.w3.org/2003/11/swrl#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
   
     
     research
diff --git a/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf b/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
index c2c92da6..5e716aad 100644
--- a/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
+++ b/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
@@ -3,7 +3,7 @@
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:j.0="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
     
         
         VIVO
diff --git a/home/src/main/resources/rdf/applicationMetadata/firsttime/propertygroups.rdf b/home/src/main/resources/rdf/applicationMetadata/firsttime/propertygroups.rdf
index f977ce2a..797cc4f2 100644
--- a/home/src/main/resources/rdf/applicationMetadata/firsttime/propertygroups.rdf
+++ b/home/src/main/resources/rdf/applicationMetadata/firsttime/propertygroups.rdf
@@ -11,7 +11,7 @@
     xmlns:j.6="http://www.w3.org/2003/06/sw-vocab-status/ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
   
     2009-12-28T09:47:01
     affiliation
diff --git a/home/src/main/resources/rdf/display/everytime/homePageDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/homePageDataGetters.n3
index d536d389..be3db725 100644
--- a/home/src/main/resources/rdf/display/everytime/homePageDataGetters.n3
+++ b/home/src/main/resources/rdf/display/everytime/homePageDataGetters.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix display:  .
@@ -7,8 +7,8 @@
 @prefix core:  .
 @prefix vivoweb:  .
 @prefix foaf:  .
- 
-# academic departments datagetter 
+
+# academic departments datagetter
 
  display:hasDataGetter display:academicDeptsDataGetter .
 
@@ -23,8 +23,8 @@ display:academicDeptsDataGetter
     WHERE
     {
           ?theURI a vivo:AcademicDepartment .
-          ?theURI rdfs:label ?label 
+          ?theURI rdfs:label ?label
     }
-    
+
     """ .
 
diff --git a/home/src/main/resources/rdf/display/everytime/localeSelectionGUI.n3 b/home/src/main/resources/rdf/display/everytime/localeSelectionGUI.n3
index fea3c673..3062d28f 100644
--- a/home/src/main/resources/rdf/display/everytime/localeSelectionGUI.n3
+++ b/home/src/main/resources/rdf/display/everytime/localeSelectionGUI.n3
@@ -1,12 +1,12 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 #
 # Associate the LocaleSelectionDataGetter with the languageSelector.ftl Freemarker template.
 #
 
 @prefix display:  .
- 
+
  display:hasDataGetter display:localeSelectorDataGetter .
- 
+
 display:localeSelectorDataGetter
     a  .
diff --git a/home/src/main/resources/rdf/display/everytime/n3ModelChangePreprocessors.n3 b/home/src/main/resources/rdf/display/everytime/n3ModelChangePreprocessors.n3
index 2f76ba96..917d2372 100644
--- a/home/src/main/resources/rdf/display/everytime/n3ModelChangePreprocessors.n3
+++ b/home/src/main/resources/rdf/display/everytime/n3ModelChangePreprocessors.n3
@@ -1,5 +1,5 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
-	
+# $This file is distributed under the terms of the license in LICENSE$
+
 @prefix owl:  .
 @prefix display:  .
 @prefix rdf:  .
@@ -7,12 +7,12 @@
 
 ## The example below demonstrates how you can associate particular ModelChangePreprocessors
 ## with the application as a whole.  These preprocessors will be run with
-## every edit/addition in N3EditUtils.preprocessModels(changes, configuration, vreq);	
+## every edit/addition in N3EditUtils.preprocessModels(changes, configuration, vreq);
 
-## Defines the preprocessor class 
+## Defines the preprocessor class
 ## Can extend this to define what the constructor arguments should be if required, and then N3EditUtils.java should be modified
 ## to know it can pull out parameters based on what is defined in the display  model
 
 # Testing to see if this will be read in BECAUSE this has changed and should be read in
-#    
-# a   .  
+# 
+# a   .
diff --git a/home/src/main/resources/rdf/display/everytime/orcidInterfaceDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/orcidInterfaceDataGetters.n3
index 53939167..46e0ef31 100644
--- a/home/src/main/resources/rdf/display/everytime/orcidInterfaceDataGetters.n3
+++ b/home/src/main/resources/rdf/display/everytime/orcidInterfaceDataGetters.n3
@@ -1,10 +1,10 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix foaf:  .
 @prefix display:  .
 
-# 
-# datagetter to fetch ORCID info for the person. 
+#
+# datagetter to fetch ORCID info for the person.
 #
 
  display:hasDataGetter display:orcidIdDataGetter .
diff --git a/home/src/main/resources/rdf/display/everytime/searchIndexerConfigurationVivo.n3 b/home/src/main/resources/rdf/display/everytime/searchIndexerConfigurationVivo.n3
index 90d360bd..c29361c8 100644
--- a/home/src/main/resources/rdf/display/everytime/searchIndexerConfigurationVivo.n3
+++ b/home/src/main/resources/rdf/display/everytime/searchIndexerConfigurationVivo.n3
@@ -1,10 +1,10 @@
 @prefix :  .
-@prefix rdfs:   . 
+@prefix rdfs:   .
 @prefix searchIndex:  .
 
 
 #
-# Specify the SearchIndexExcluders, DocumentModifiers and IndexingUriFinders for VIVO. 
+# Specify the SearchIndexExcluders, DocumentModifiers and IndexingUriFinders for VIVO.
 # These are in addition to the ones specified for VIVO.
 #
 
@@ -28,7 +28,7 @@
     :hasOutgoingProperty "http://vivoweb.org/ontology/core#relates" .
 
 # Some roles look like this:  bearerOf ==> role ==> roleContributesTo
-#                            inheresIn <== role <== contributingRole        
+#                            inheresIn <== role <== contributingRole
 :extension_forContextNodes_role_contributes_1
     a   searchIndex:indexing.IndexingUriFinder ,
         searchIndex:documentBuilding.DocumentModifier ,
@@ -36,7 +36,7 @@
     rdfs:label "Labels across bearerOf/contributesTo" ;
     :hasIncomingProperty "http://purl.obolibrary.org/obo/RO_0000053" ;
     :hasOutgoingProperty "http://vivoweb.org/ontology/core#roleContributesTo" .
-        
+
 :extension_forContextNodes_role_contributes_2
     a   searchIndex:indexing.IndexingUriFinder ,
         searchIndex:documentBuilding.DocumentModifier ,
@@ -44,9 +44,9 @@
     rdfs:label "Labels across contributor/inheresIn" ;
     :hasIncomingProperty "http://vivoweb.org/ontology/core#contributingRole" ;
     :hasOutgoingProperty "http://purl.obolibrary.org/obo/RO_0000052" .
-        
+
 # Other roles look like this:  bearerOf ==> role ==> realizedIn
-#                             inheresIn <== role <== realizes        
+#                             inheresIn <== role <== realizes
 :extension_forContextNodes_role_realizedIn_1
     a   searchIndex:indexing.IndexingUriFinder ,
         searchIndex:documentBuilding.DocumentModifier ,
@@ -54,7 +54,7 @@
     rdfs:label "Labels across bearerOf/realizedIn" ;
     :hasIncomingProperty "http://purl.obolibrary.org/obo/RO_0000053" ;
     :hasOutgoingProperty "http://purl.obolibrary.org/obo/BFO_0000054" .
-        
+
 :extension_forContextNodes_role_realizedIn_2
     a   searchIndex:indexing.IndexingUriFinder ,
         searchIndex:documentBuilding.DocumentModifier ,
@@ -62,7 +62,7 @@
     rdfs:label "Labels across realizes/inheresIn" ;
     :hasIncomingProperty "http://purl.obolibrary.org/obo/BFO_0000055" ;
     :hasOutgoingProperty "http://purl.obolibrary.org/obo/RO_0000052" .
-        
+
 # Roles on grants look like this:  bearerOf ==> role ==> relatedBy
 #                                 inheresIn <== role <== relates
 :extension_forContextNodes_roles_on_grants_1
@@ -72,7 +72,7 @@
     rdfs:label "Labels across bearerOf/relates" ;
     :hasIncomingProperty "http://purl.obolibrary.org/obo/RO_0000053" ;
     :hasOutgoingProperty "http://vivoweb.org/ontology/core#relatedBy" .
-        
+
 :extension_forContextNodes_roles_on_grants_2
     a   searchIndex:indexing.IndexingUriFinder ,
         searchIndex:documentBuilding.DocumentModifier ,
@@ -80,7 +80,7 @@
     rdfs:label "Labels across contributor/relatedBy" ;
     :hasIncomingProperty "http://vivoweb.org/ontology/core#relates" ;
     :hasOutgoingProperty "http://purl.obolibrary.org/obo/RO_0000052" .
-        
+
 
 # ------------------------------------
 
@@ -127,7 +127,7 @@
     :hasSelectQuery """
         PREFIX vcard: 
         PREFIX obo: 
-		SELECT ?title 
+		SELECT ?title
 		WHERE {
 			?uri obo:ARG_2000028 ?card .
 			?card a vcard:Individual .
@@ -135,7 +135,7 @@
 			?titleHolder vcard:title ?title .
 		}
         """ .
-    
+
 :vivodocumentModifier_EmailAddress
     a   searchIndex:documentBuilding.SelectQueryDocumentModifier ,
         searchIndex:documentBuilding.DocumentModifier ;
@@ -143,7 +143,7 @@
     :hasSelectQuery """
         PREFIX vcard: 
         PREFIX obo: 
-		SELECT ?email 
+		SELECT ?email
 		WHERE {
 			?uri obo:ARG_2000028 ?card .
 			?card a vcard:Individual .
diff --git a/home/src/main/resources/rdf/display/everytime/vivoConceptDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/vivoConceptDataGetters.n3
index ab2419a0..9499da51 100644
--- a/home/src/main/resources/rdf/display/everytime/vivoConceptDataGetters.n3
+++ b/home/src/main/resources/rdf/display/everytime/vivoConceptDataGetters.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix display:  .
@@ -7,7 +7,7 @@
 @prefix core:  .
 @prefix vivoweb:  .
 
- 
+
 #### n3 for research areas ####
 
 ## associate the classes with the datagetter ##
@@ -20,7 +20,7 @@
 display:getDepartmentDataGetter
     a ;
     display:saveToVar "departmentsResults";
-    display:query 
+    display:query
         """
         PREFIX rdfs: 
         PREFIX vivo: 
@@ -33,12 +33,12 @@ display:getDepartmentDataGetter
             ?posn  vivo:relates ?dept .
             ?dept a foaf:Organization .
             ?dept rdfs:label ?departmentLabel
-            OPTIONAL { ?posn vivo:dateTimeInterval ?dti 
+            OPTIONAL { ?posn vivo:dateTimeInterval ?dti
                      OPTIONAL { ?dti vivo:end ?end .
                                 ?end vivo:dateTime ?endDate
                      }
             }
-            FILTER ( !bound(?endDate) ||                        
+            FILTER ( !bound(?endDate) ||
                       substr(str(?endDate), 1, 4) >= substr(str(now()), 1, 4) )
         }
         ORDER BY ?deptLabel
@@ -47,11 +47,11 @@ display:getDepartmentDataGetter
 		display:getVocabServiceDataGetter
 		    a ;
 		    display:saveToVar "vocabularyService";
-		    display:query 
+		    display:query
 		        """
 		        PREFIX rdfs: 
 		        PREFIX vivo: 
-		        SELECT DISTINCT (str(?vocabularySourceName) AS ?vocabService) 
+		        SELECT DISTINCT (str(?vocabularySourceName) AS ?vocabService)
 		        WHERE {
 		            ?individualURI rdfs:isDefinedBy ?vocabularySource .
 		            ?vocabularySource rdfs:label ?vocabularySourceName .
@@ -74,10 +74,10 @@ display:getDepartmentDataGetter
         PREFIX rdfs: 
         PREFIX vivo: 
         PREFIX foaf: 
-        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) 
-                        ?person 
-                        (Str(?researchAreaLabel) AS ?raLabel) 
-                        (str(?departmentLabel) AS ?orgLabel) 
+        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel)
+                        ?person
+                        (Str(?researchAreaLabel) AS ?raLabel)
+                        (str(?departmentLabel) AS ?orgLabel)
                         ?ra
                         ?org
         WHERE {
diff --git a/home/src/main/resources/rdf/display/everytime/vivoListViewConfig.rdf b/home/src/main/resources/rdf/display/everytime/vivoListViewConfig.rdf
index 68cfd957..18323aec 100644
--- a/home/src/main/resources/rdf/display/everytime/vivoListViewConfig.rdf
+++ b/home/src/main/resources/rdf/display/everytime/vivoListViewConfig.rdf
@@ -53,23 +53,23 @@
     
         listViewConfig-dateTimeValue.xml
     
-    
+
     
         listViewConfig-webpage.xml
-        
-  
+    
+
     
         listViewConfig-hasAssociatedConcept.xml
     
-    
+
     
         listViewConfig-hasAssociatedConcept.xml
     
-    
+
     
         listViewConfig-hasAssociatedConcept.xml
     
- 
+
    
         listViewConfig-publisherOf.xml
     
@@ -119,9 +119,9 @@
     
-        
+
     
         listViewConfig-scopusId.xml
     
@@ -129,5 +129,5 @@
     
         listViewConfig-doi.xml
     
-        
+
 
diff --git a/home/src/main/resources/rdf/display/everytime/vivoOrganizationDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/vivoOrganizationDataGetters.n3
index 33dc66e0..f46eed58 100644
--- a/home/src/main/resources/rdf/display/everytime/vivoOrganizationDataGetters.n3
+++ b/home/src/main/resources/rdf/display/everytime/vivoOrganizationDataGetters.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix display:  .
@@ -7,7 +7,7 @@
 @prefix core:  .
 @prefix vivoweb:  .
 
- 
+
 #### n3 for research areas ####
 
 ## associate the classes with the datagetter ##
@@ -19,14 +19,14 @@
  display:hasDataGetter display:getResearchAreaDataGetter .
  display:hasDataGetter display:getResearchAreaDataGetter .
  display:hasDataGetter display:getResearchAreaDataGetter .
- 
- 
+
+
 ## define the datagetter ##
 
 display:getResearchAreaDataGetter
     a ;
     display:saveToVar "researchAreaResults";
-    display:query 
+    display:query
         """
         PREFIX rdfs: 
         PREFIX vivo: 
@@ -39,12 +39,12 @@ display:getResearchAreaDataGetter
             ?person a foaf:Person .
             ?person vivo:hasResearchArea ?ra .
             ?ra rdfs:label ?researchAreaLabel
-            OPTIONAL { ?posn vivo:dateTimeInterval ?dti 
+            OPTIONAL { ?posn vivo:dateTimeInterval ?dti
                      OPTIONAL { ?dti vivo:end ?end .
                                 ?end vivo:dateTime ?endDate
                      }
             }
-            FILTER ( !bound(?endDate) ||                        
+            FILTER ( !bound(?endDate) ||
                       substr(str(?endDate), 1, 4) >= substr(str(now()), 1, 4) )
         }
         ORDER BY ?raLabel
@@ -66,10 +66,10 @@ display:getResearchAreaDataGetter
         PREFIX rdfs: 
         PREFIX vivo: 
         PREFIX foaf: 
-        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) 
-                        ?person 
-                        (str(?researchAreaLabel) AS ?raLabel) 
-                        (str(?organizationLabel) AS ?orgLabel) 
+        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel)
+                        ?person
+                        (str(?researchAreaLabel) AS ?raLabel)
+                        (str(?organizationLabel) AS ?orgLabel)
                         ?ra
                         ?org
         WHERE {
@@ -104,10 +104,10 @@ display:getResearchAreaDataGetter
         PREFIX rdfs: 
         PREFIX vivo: 
         PREFIX foaf: 
-        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) 
-                        ?person 
-                        (Str(?researchAreaLabel) AS ?raLabel) 
-                        (str(?organizationLabel) AS ?orgLabel) 
+        SELECT DISTINCT (str (?prsnLabel) AS ?personLabel)
+                        ?person
+                        (Str(?researchAreaLabel) AS ?raLabel)
+                        (str(?organizationLabel) AS ?orgLabel)
                         ?ra
         WHERE {
             ?orgURI vivo:relatedBy ?posn .
@@ -138,7 +138,7 @@ display:getResearchAreaDataGetter
 display:getGrantsDataGetter
     a ;
     display:saveToVar "getGrantResults";
-    display:query 
+    display:query
         """
         PREFIX rdfs: 
         PREFIX vivo: 
diff --git a/home/src/main/resources/rdf/display/everytime/vivoQrCodeDataGetter.n3 b/home/src/main/resources/rdf/display/everytime/vivoQrCodeDataGetter.n3
index aaf16516..50bcf030 100644
--- a/home/src/main/resources/rdf/display/everytime/vivoQrCodeDataGetter.n3
+++ b/home/src/main/resources/rdf/display/everytime/vivoQrCodeDataGetter.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix display:  .
@@ -8,28 +8,28 @@
 @prefix vivoweb:  .
 @prefix afn:   .
 
- 
+
 #### Check to see if the person being viewed has a first and last name. ####
 #### If so, the page will display the QR code icon link.                ####
 
 ## associate the classes with the datagetter (COUNT(?vIndividual) AS ?theCount)##
 
  display:hasDataGetter display:checkNamesForQrCodeDG .
- 
- 
+
+
 ## define the datagetter ##
 
 display:checkNamesForQrCodeDG
     a ;
     display:saveToVar "checkNamesResult";
-    display:query 
+    display:query
         """
-        PREFIX obo:  
+        PREFIX obo: 
         PREFIX vcard: 
         SELECT DISTINCT ?vIndividual
         WHERE {
             ?individualURI obo:ARG_2000028 ?vIndividual .
-            ?vIndividual vcard:hasName ?vName . 
+            ?vIndividual vcard:hasName ?vName .
             ?vName vcard:givenName ?firstName .
             ?vName vcard:familyName ?lastName .
         }
diff --git a/home/src/main/resources/rdf/display/everytime/vivoSearchProhibited.n3 b/home/src/main/resources/rdf/display/everytime/vivoSearchProhibited.n3
index 2061d7ef..37c6895f 100644
--- a/home/src/main/resources/rdf/display/everytime/vivoSearchProhibited.n3
+++ b/home/src/main/resources/rdf/display/everytime/vivoSearchProhibited.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix vitroDisplay:  .
@@ -11,17 +11,17 @@
 
 # See vitroSearchProhibited.n3 for more information about files in this directory.
 
- vitroDisplay:SearchIndex 
-	rdf:type owl:Thing ; 
+ vitroDisplay:SearchIndex
+	rdf:type owl:Thing ;
 	vitroDisplay:excludeClass obo:BFO_0000023  ;
 	vitroDisplay:excludeClass core:AdvisingRelationship ;
 	vitroDisplay:excludeClass core:Editorship ;
 	vitroDisplay:excludeClass core:Authorship ;
-	vitroDisplay:excludeClass core:Position ; 
+	vitroDisplay:excludeClass core:Position ;
 	vitroDisplay:excludeClass core:AwardReceipt ;
 	vitroDisplay:excludeClass core:AwardedDegree ;
 	vitroDisplay:excludeClass core:ResearchActivity ;
-	vitroDisplay:excludeClass core:EducationalProcess ;	
+	vitroDisplay:excludeClass core:EducationalProcess ;
 	vitroDisplay:excludeClass bibo:DocumentStatus ;
 	vitroDisplay:excludeClass core:DateTimeValue ;
     vitroDisplay:excludeClass core:DateTimeValuePrecision ;
diff --git a/home/src/main/resources/rdf/display/firsttime/PropertyConfig.n3 b/home/src/main/resources/rdf/display/firsttime/PropertyConfig.n3
index 0e5d0449..6297d5a4 100644
--- a/home/src/main/resources/rdf/display/firsttime/PropertyConfig.n3
+++ b/home/src/main/resources/rdf/display/firsttime/PropertyConfig.n3
@@ -8,7 +8,7 @@
 @prefix vitro:  .
 @prefix role:   .
 @prefix local:  .
-@prefix vivo:  . 
+@prefix vivo:  .
 @prefix obo:  .
 
 @base  .
@@ -67,7 +67,7 @@ local:authorInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
     vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
     vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
     vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPublicationToPersonGenerator"^^xsd:string ;
-    :propertyGroup  . 
+    :propertyGroup  .
 
 local:orgInAuthorshipContext a :ConfigContext ;
     :hasConfiguration local:orgInAuthorshipConfig ;
@@ -85,7 +85,7 @@ local:orgInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
     vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
     vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
     vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPublicationToPersonGenerator"^^xsd:string ;
-    :propertyGroup  . 
+    :propertyGroup  .
 
 #### role contexts and configurations ###
 
@@ -94,7 +94,7 @@ local:hasServiceProviderRoleContext a :ConfigContext ;
     :configContextFor  ;
     :qualifiedByDomain    ;
     :qualifiedBy       .
-    
+
 local:hasServiceProviderRoleConfig a :ObjectPropertyDisplayConfig ;
    :listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
    rdfs:label "hasServiceProviderRole"@en-US;
@@ -105,7 +105,7 @@ local:hasServiceProviderRoleConfig a :ObjectPropertyDisplayConfig ;
    vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ;
    vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddServiceProviderRoleToPersonGenerator"^^ ;
    :propertyGroup  .
-  
+
 local:hasClinicalRoleContext a :ConfigContext ;
     :hasConfiguration local:hasClinicalRoleConfig ;
     :configContextFor  ;
@@ -478,7 +478,7 @@ local:orgHasPresenterRoleConfig a :ObjectPropertyDisplayConfig ;
     vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
     vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddPresenterRoleToPersonGenerator"^^ ;
     :propertyGroup  .
-    
+
 ### awards and educational training ###
 
 local:awardOrHonorContext a :ConfigContext ;
@@ -744,11 +744,11 @@ local:orgAdministersGrantConfig a :ObjectPropertyDisplayConfig ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.OrganizationAdministersGrantGenerator"^^ ;
     :propertyGroup  .
-    
+
 ### collaborator properties ###
 
 # formerly defined in common for all Agents in initialTBoxAnnotations.n3 where allows cross-linking people and orgs
-    
+
 local:hasCollaboratorContext a :ConfigContext ; # persons
     :hasConfiguration local:hasCollaboratorConfig ;
     :configContextFor  ;
@@ -775,7 +775,7 @@ local:hasCollaboratorConfig a :ObjectPropertyDisplayConfig ;
      vitro:publicDescriptionAnnot
          "Use for a simple assertion that another person is an ongoing collaborator; to describe the relationship in more detail enter a role for each collaborator in some common endeavor."^^xsd:string ;
     :propertyGroup  .
-    
+
 local:orgHasCollaboratorContext a :ConfigContext ;
     :hasConfiguration local:orgHasCollaboratorConfig ;
     :configContextFor  ;
@@ -1013,7 +1013,7 @@ local:webpageInfoConfig a :ObjectPropertyDisplayConfig ;
 local:webpageSoftwareContext a :ConfigContext ;
     :hasConfiguration local:webpageSoftwareConfig ;
     :configContextFor  ;
-    :qualifiedByDomain       ; 
+    :qualifiedByDomain       ;
     :qualifiedByRoot  ;
     :qualifiedBy       .
 
@@ -1029,7 +1029,7 @@ local:webpageSoftwareConfig a :ObjectPropertyDisplayConfig ;
 local:webpageFacilityContext a :ConfigContext ;
     :hasConfiguration local:webpageFacilityConfig ;
     :configContextFor  ;
-    :qualifiedByDomain       ; 
+    :qualifiedByDomain       ;
     :qualifiedByRoot  ;
     :qualifiedBy       .
 
@@ -1045,7 +1045,7 @@ local:webpageFacilityConfig a :ObjectPropertyDisplayConfig ;
 local:webpageProjectContext a :ConfigContext ;
     :hasConfiguration local:webpageProjectConfig ;
     :configContextFor  ;
-    :qualifiedByDomain       ; 
+    :qualifiedByDomain       ;
     :qualifiedByRoot  ;
     :qualifiedBy       .
 
@@ -1143,7 +1143,7 @@ local:outputOfConfig a :ObjectPropertyDisplayConfig ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     :propertyGroup  .
-    
+
 local:hasOutputContext a :ConfigContext ;
     :hasConfiguration local:hasOutputConfig ;
     :configContextFor obo:RO_0002234 ;
@@ -1210,7 +1210,7 @@ local:documentPartOfConfig a :ObjectPropertyDisplayConfig ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     :propertyGroup  .
-    
+
 local:geographicLocationContainsLocationContext a :ConfigContext ;
     :hasConfiguration local:geographicLocationContainsLocationConfig ;
     :configContextFor   ;
@@ -1227,13 +1227,13 @@ local:geographicLocationContainsLocationConfig a :ObjectPropertyDisplayConfig ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     :propertyGroup  .
-        
+
 local:geographicLocationWithinLocationContext a :ConfigContext ;
     :hasConfiguration local:geographicLocationWithinLocationConfig ;
     :configContextFor  ;
     :qualifiedByDomain vivo:GeographicLocation ;
     :qualifiedBy       vivo:GeographicLocation .
-            
+
 local:geographicLocationWithinLocationConfig a :ObjectPropertyDisplayConfig ;
     :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
     rdfs:label "geographicLocationWithinLocation"@en-US;
@@ -1329,13 +1329,13 @@ local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
     vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
     vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
     :propertyGroup  .
-    
+
 local:eventsForSeriesContext a :ConfigContext ;
     :hasConfiguration  local:eventsForSeriesConfig ;
     :configContextFor   ;
     :qualifiedByDomain  ;
     :qualifiedBy        .
- 
+
 local:eventsForSeriesConfig a :ObjectPropertyDisplayConfig ;
     :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
     rdfs:label "eventsForSeries"@en-US;
@@ -1363,7 +1363,7 @@ local:eventLocationConfig a :ObjectPropertyDisplayConfig ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     :propertyGroup  .
-    
+
 local:eventInFacilityContext a :ConfigContext ;
     :hasConfiguration local:eventInFacilityConfig ;
     :configContextFor  ; ## located in
@@ -1448,7 +1448,7 @@ local:hasRoomConfig a :ObjectPropertyDisplayConfig ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     :propertyGroup  .
-    
+
 local:roomWithinBuildingContext a :ConfigContext ;
     :hasConfiguration local:roomWithinBuildingConfig ;
     :configContextFor  ;
@@ -1517,7 +1517,7 @@ local:facilitySiteOfEventConfig a :ObjectPropertyDisplayConfig ;
     vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     :propertyGroup  .
-    
+
 local:facilitySiteOfAgentContext a :ConfigContext ;
     :hasConfiguration local:facilitySiteOfAgentConfig ;
     :configContextFor  ; ## location of
@@ -1535,10 +1535,10 @@ local:facilitySiteOfAgentConfig a :ObjectPropertyDisplayConfig ;
     vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
     :propertyGroup  .
 
-# uses and used by need work -- apply to continuants and occurrents, and material entities as well as information content entities   
+# uses and used by need work -- apply to continuants and occurrents, and material entities as well as information content entities
 #local:projectUsesMaterialEntityContext a :ConfigContext ;
 #    :hasConfiguration local:projectUsesMaterialEntityConfig ;
-#    :configContextFor   ; 
+#    :configContextFor   ;
 #    :qualifiedByDomain vivo:Project  ;
 #    :qualifiedBy        . ## Material Entity
 
@@ -1552,10 +1552,10 @@ local:facilitySiteOfAgentConfig a :ObjectPropertyDisplayConfig ;
 #    vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ;
 #    vitro:selectFromExistingAnnot   "true"^^xsd:boolean ;
 #    :propertyGroup  .
-    
+
 #local:materialEntityUsedByProjectContext a :ConfigContext ;
 #    :hasConfiguration local:MaterialEntityUsedByProjectConfig ;
-#    :configContextFor   ; 
+#    :configContextFor   ;
 #    :qualifiedByDomain  ; ## Material Entity
 #    :qualifiedBy       vivo:Project .
 
diff --git a/home/src/main/resources/rdf/display/firsttime/PropertyConfigSupp.n3 b/home/src/main/resources/rdf/display/firsttime/PropertyConfigSupp.n3
index 7a3c5dc1..e59129d4 100644
--- a/home/src/main/resources/rdf/display/firsttime/PropertyConfigSupp.n3
+++ b/home/src/main/resources/rdf/display/firsttime/PropertyConfigSupp.n3
@@ -8,7 +8,7 @@
 @prefix vitro:  .
 @prefix role:   .
 @prefix local:  .
-@prefix vivo:  . 
+@prefix vivo:  .
 
 @base  .
 
diff --git a/home/src/main/resources/rdf/display/firsttime/aboutPage.n3 b/home/src/main/resources/rdf/display/firsttime/aboutPage.n3
index 9aa2ceaa..d2a7c2f7 100644
--- a/home/src/main/resources/rdf/display/firsttime/aboutPage.n3
+++ b/home/src/main/resources/rdf/display/firsttime/aboutPage.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix about:  .
 
diff --git a/home/src/main/resources/rdf/display/firsttime/menu.n3 b/home/src/main/resources/rdf/display/firsttime/menu.n3
index e6abb201..3d6aa54e 100644
--- a/home/src/main/resources/rdf/display/firsttime/menu.n3
+++ b/home/src/main/resources/rdf/display/firsttime/menu.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix owl:  .
 @prefix display:  .
@@ -12,7 +12,7 @@
 
 #### Default Menu ####
 
-display:DefaultMenu 
+display:DefaultMenu
     a  display:MainMenu ;
     rdfs:label "Default Menu" ;
     display:hasElement display:EventsMenuItem ;
@@ -24,36 +24,36 @@ display:DefaultMenu
 
 #### Menu Items for Default Menu ####
 
-display:HomeMenuItem 
+display:HomeMenuItem
     a display:NavigationElement ;
     display:menuPosition 1;
     display:linkText "Home";
     display:toPage display:Home .
 
-display:PeopleMenuItem 
+display:PeopleMenuItem
     a display:NavigationElement ;
     display:menuPosition 2;
     display:linkText "People";
     display:toPage display:People .
 
-display:OrganizationsMenuItem 
+display:OrganizationsMenuItem
     a display:NavigationElement ;
     display:menuPosition 3;
     display:linkText "Organizations";
     display:toPage display:Organizations .
 
-display:ResearchMenuItem     
+display:ResearchMenuItem
     a display:NavigationElement ;
     display:menuPosition 4;
     display:linkText "Research";
     display:toPage display:Research .
 
-display:EventsMenuItem 
+display:EventsMenuItem
     a display:NavigationElement ;
     display:menuPosition 5;
     display:linkText "Events";
-    display:toPage display:Events .        
-    
+    display:toPage display:Events .
+
 display:CapabilityMapMenuItem
     a display:NavigationElement ;
     display:menuPosition 6;
@@ -61,22 +61,22 @@ display:CapabilityMapMenuItem
     display:toPage display:CapabilityMap .
 
 display:Home
-    a display:HomePage ;    
+    a display:HomePage ;
     a display:Page ;
-    display:title "Home" ;    
+    display:title "Home" ;
     display:urlMapping "/" ;
     display:hasDataGetter display:homeDataGetter;
     display:cannotDeletePage "true" .
 
-display:Events 
-    a display:Page ;    
+display:Events
+    a display:Page ;
     a display:ClassGroupPage;
     display:forClassGroup vivoweb:vitroClassGroupevents ;
     display:title "Events" ;
-    display:urlMapping "/events" ; 
+    display:urlMapping "/events" ;
     display:hasDataGetter display:eventsDataGetter .
 
-display:Organizations 
+display:Organizations
     a display:Page ;
     a display:ClassGroupPage;
     display:forClassGroup vivoweb:vitroClassGrouporganizations ;
@@ -84,16 +84,16 @@ display:Organizations
     display:urlMapping "/organizations";
     display:hasDataGetter display:organizationsDataGetter .
 
-display:People 
-    a display:Page ;    
+display:People
+    a display:Page ;
     a display:ClassGroupPage;
     display:forClassGroup vivoweb:vitroClassGrouppeople ;
     display:title "People" ;
     display:urlMapping "/people" ;
    	display:hasDataGetter display:peopleDataGetter .
 
-display:Research 
-    a display:Page ;        
+display:Research
+    a display:Page ;
     a display:ClassGroupPage;
     display:forClassGroup vivoweb:vitroClassGrouppublications ;
     display:title "Research" ;
@@ -121,12 +121,12 @@ display:organizationsDataGetter
       a ;
       display:forClassGroup
               vivoweb:vitroClassGrouporganizations .
-                            
+
 display:eventsDataGetter
       a ;
       display:forClassGroup
               vivoweb:vitroClassGroupevents .
-              
+
 display:homeDataGetter
       a  .
 
diff --git a/home/src/main/resources/rdf/tbox/filegraph/ontologies.owl b/home/src/main/resources/rdf/tbox/filegraph/ontologies.owl
index 5308bc27..9ed67996 100644
--- a/home/src/main/resources/rdf/tbox/filegraph/ontologies.owl
+++ b/home/src/main/resources/rdf/tbox/filegraph/ontologies.owl
@@ -12,7 +12,7 @@
     
     
     
-       
+    
     
     
     
@@ -27,5 +27,5 @@
     
     
     
-    
- 
+
+
diff --git a/home/src/main/resources/rdf/tbox/filegraph/vivo.owl b/home/src/main/resources/rdf/tbox/filegraph/vivo.owl
index cffee159..669d8b70 100644
--- a/home/src/main/resources/rdf/tbox/filegraph/vivo.owl
+++ b/home/src/main/resources/rdf/tbox/filegraph/vivo.owl
@@ -15,12 +15,12 @@
      xmlns:terms="http://purl.org/dc/terms/"
      xmlns:obo="http://purl.obolibrary.org/obo/"
      xmlns:statistics="http://purl.org/net/OCRe/statistics.owl#">
-     
+
     
         VIVO Core Ontology
     
 
-    
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -193,52 +193,52 @@
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
 
 
-    
 
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
 
 
-    
 
-    
+
 
 
     
@@ -311,7 +311,7 @@
         United Nations cartographic maps http://www.un.org/Depts/Cartographic/map/profile/world00.pdf
         http://www.un.org/Depts/Cartographic/map/profile/world00.pdf
     
-    
+
 
 
     
@@ -322,7 +322,7 @@
         
         
     
-    
+
 
 
     
@@ -334,7 +334,7 @@
         United Nations cartographic maps http://www.un.org/Depts/Cartographic/map/profile/world00.pdf
         http://www.un.org/Depts/Cartographic/map/profile/world00.pdf
     
-    
+
 
 
     
@@ -344,7 +344,7 @@
         
         
     
-    
+
 
 
     
@@ -360,7 +360,7 @@
         
         
     
-    
+
 
 
     
@@ -375,13 +375,13 @@
         
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -391,7 +391,7 @@
         
         
     
-    
+
 
 
     
@@ -400,7 +400,7 @@
         contact info for
         
     
-    
+
 
 
     
@@ -409,7 +409,7 @@
         context for
         
     
-    
+
 
 
     
@@ -417,7 +417,7 @@
     
         has context
     
-    
+
 
 
     
@@ -425,7 +425,7 @@
     
         has contact agent
     
-    
+
 
 
     
@@ -435,7 +435,7 @@
         part of
         
     
-    
+
 
 
     
@@ -444,7 +444,7 @@
         
         has part
     
-    
+
 
 
     
@@ -461,7 +461,7 @@
         
         
     
-    
+
 
 
     
@@ -476,7 +476,7 @@
         
         
     
-    
+
 
 
     
@@ -502,7 +502,7 @@
             
         
     
-    
+
 
 
     
@@ -528,7 +528,7 @@
             
         
     
-    
+
 
 
     
@@ -544,7 +544,7 @@
         
         
     
-    
+
 
 
     
@@ -569,7 +569,7 @@
             
         
     
-    
+
 
 
     
@@ -593,7 +593,7 @@
             
         
     
-    
+
 
 
     
@@ -618,7 +618,7 @@
             
         
     
-    
+
 
 
     
@@ -642,7 +642,7 @@
             
         
     
-    
+
 
 
     
@@ -665,7 +665,7 @@
             
         
     
-    
+
 
 
     
@@ -688,7 +688,7 @@
             
         
     
-    
+
 
 
     
@@ -711,7 +711,7 @@
             
         
     
-    
+
 
 
     
@@ -741,7 +741,7 @@
             
         
     
-    
+
 
 
     
@@ -766,7 +766,7 @@
             
         
     
-    
+
 
 
     
@@ -785,7 +785,7 @@
         
         
     
-    
+
 
 
     
@@ -800,7 +800,7 @@
         
         
     
-    
+
 
 
     
@@ -814,7 +814,7 @@
         used to study
         
     
-    
+
 
 
     
@@ -830,7 +830,7 @@
         
         
     
-    
+
 
 
     
@@ -847,7 +847,7 @@
         
         
     
-    
+
 
 
     
@@ -863,7 +863,7 @@
         
         
     
-    
+
 
 
     
@@ -879,7 +879,7 @@
         
         
     
-    
+
 
 
     
@@ -896,7 +896,7 @@
         
         
     
-    
+
 
 
     
@@ -913,7 +913,7 @@
         
         
     
-    
+
 
 
     
@@ -924,14 +924,14 @@
         
         
     
-    
+
 
 
     
 
     
         is about
-        7/6/2009 Alan Ruttenberg. Following discussion with Jonathan Rees, and introduction of "mentions" relation. Weaken the is_about relationship to be primitive. 
+        7/6/2009 Alan Ruttenberg. Following discussion with Jonathan Rees, and introduction of "mentions" relation. Weaken the is_about relationship to be primitive.
 
 We will try to build it back up by elaborating the various subproperties that are more precisely defined.
 
@@ -943,7 +943,7 @@ Some currently missing phenomena that should be considered "about" are
         
         
     
-    
+
 
 
     
@@ -952,7 +952,7 @@ Some currently missing phenomena that should be considered "about" are
         mentions
         
     
-    
+
 
 
     
@@ -990,21 +990,21 @@ An attempt at defining assay using Barry's "reliability" wording
 
 assay:
 process and has_input some material entity
-and has_output some information content entity 
-and which is such that instances of this process type reliably generate 
+and has_output some information content entity
+and which is such that instances of this process type reliably generate
 outputs that describes the input.
         This one is the one we are struggling with at the moment. The issue is what a measurement measures. On the one hand saying that it measures the quality would include it "measuring" the bearer = referring to the bearer in the measurement. However this makes comparisons of two different things not possible. On the other hand not having it inhere in the bearer, on the face of it, breaks the audit trail.
 
 Werner suggests a solution based on "Magnitudes" a proposal for which we are awaiting details.
         m is a quality measurement of q at t when
-q is a quality 
+q is a quality
 there is a measurement process p that has specified output m, a measurement datum, that is about q
         
         
         
         
     
-    
+
 
 
     
@@ -1016,7 +1016,7 @@ there is a measurement process p that has specified output m, a measurement datu
         inverse of the relation of is quality measurement of
         
     
-    
+
 
 
     
@@ -1034,7 +1034,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1051,7 +1051,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1068,7 +1068,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1082,7 +1082,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1098,7 +1098,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1113,7 +1113,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1125,7 +1125,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1139,7 +1139,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1149,7 +1149,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1160,7 +1160,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1170,7 +1170,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1178,7 +1178,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         derives from
     
-    
+
 
 
     
@@ -1187,7 +1187,7 @@ there is a measurement process p that has specified output m, a measurement datu
         location of
         
     
-    
+
 
 
     
@@ -1196,7 +1196,7 @@ there is a measurement process p that has specified output m, a measurement datu
         contained in
         
     
-    
+
 
 
     
@@ -1204,7 +1204,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         contains
     
-    
+
 
 
     
@@ -1212,7 +1212,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         located in
     
-    
+
 
 
     
@@ -1220,7 +1220,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         adjacent to
     
-    
+
 
 
     
@@ -1229,7 +1229,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has input
         
     
-    
+
 
 
     
@@ -1239,7 +1239,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1248,7 +1248,7 @@ there is a measurement process p that has specified output m, a measurement datu
         member of
         
     
-    
+
 
 
     
@@ -1256,7 +1256,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has member
     
-    
+
 
 
     
@@ -1265,7 +1265,7 @@ there is a measurement process p that has specified output m, a measurement datu
         output of
         
     
-    
+
 
 
     
@@ -1279,7 +1279,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1289,7 +1289,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1297,7 +1297,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         contributor
     
-    
+
 
 
     
@@ -1308,7 +1308,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://purl.org/ontology/bibo/
         A legal decision that affirms a ruling.
     
-    
+
 
 
     
@@ -1320,7 +1320,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Critical or explanatory note for a Document.
         stable
     
-    
+
 
 
     
@@ -1331,7 +1331,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1341,7 +1341,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1353,7 +1353,7 @@ there is a measurement process p that has specified output m, a measurement datu
         A court associated with a legal document; for example, that which issues a decision.
         unstable
     
-    
+
 
 
     
@@ -1367,7 +1367,7 @@ there is a measurement process p that has specified output m, a measurement datu
         We are not defining, using an enumeration, the range of the bibo:degree to the defined list of bibo:ThesisDegree. We won't do it because we want people to be able to define new degress if needed by some special usecases. Creating such an enumeration would restrict this to happen.
         
     
-    
+
 
 
     
@@ -1379,7 +1379,7 @@ there is a measurement process p that has specified output m, a measurement datu
         A Film director.
         stable
     
-    
+
 
 
     
@@ -1389,7 +1389,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Public Description for bibo:distributor taken from here:  http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html .
         
     
-    
+
 
 
     
@@ -1400,7 +1400,7 @@ there is a measurement process p that has specified output m, a measurement datu
         stable
         An agent that is interviewed by another agent.
     
-    
+
 
 
     
@@ -1411,7 +1411,7 @@ there is a measurement process p that has specified output m, a measurement datu
         An agent that interview another agent.
         stable
     
-    
+
 
 
     
@@ -1424,7 +1424,7 @@ there is a measurement process p that has specified output m, a measurement datu
         unstable
         
     
-    
+
 
 
     
@@ -1435,7 +1435,7 @@ there is a measurement process p that has specified output m, a measurement datu
         stable
         
     
-    
+
 
 
     
@@ -1450,7 +1450,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1462,7 +1462,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Relates an event to associated documents; for example, conference to a paper.
         unstable
     
-    
+
 
 
     
@@ -1473,7 +1473,7 @@ there is a measurement process p that has specified output m, a measurement datu
         An agent that receives a communication document.
         stable
     
-    
+
 
 
     
@@ -1485,7 +1485,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1496,7 +1496,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://purl.org/ontology/bibo/
         A legal decision that reverses a ruling.
     
-    
+
 
 
     
@@ -1506,7 +1506,7 @@ there is a measurement process p that has specified output m, a measurement datu
         The bibo:reviewOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html .  As of 26 May 2010, bibo:reviewOf is used with the class Review, but core:reviewIn doesn't seem to be being used.
         
     
-    
+
 
 
     
@@ -1517,7 +1517,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1528,7 +1528,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://purl.org/ontology/bibo/
         A legal decision on appeal that takes action on a case (affirming it, reversing it, etc.).
     
-    
+
 
 
     
@@ -1540,7 +1540,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Relates a document to some transcribed original.
         unstable
     
-    
+
 
 
     
@@ -1555,7 +1555,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1574,7 +1574,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -1585,7 +1585,7 @@ there is a measurement process p that has specified output m, a measurement datu
         A property linking a publication entity to the property c40:GlobalCitationCount that specify how many times a work has been cited by others, according to a particular information source on a particular date.
         
     
-    
+
 
 
     
@@ -1597,7 +1597,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1607,7 +1607,7 @@ there is a measurement process p that has specified output m, a measurement datu
         The citing entity cites the cited entity as source of data.
         
     
-    
+
 
 
     
@@ -1616,7 +1616,7 @@ there is a measurement process p that has specified output m, a measurement datu
         is cited as data source by
         The cited entity is cited as a data source by the citing entity.
     
-    
+
 
 
     
@@ -1626,7 +1626,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1636,7 +1636,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Relates a Relationship (as a predicate or n-ary relation over one or more Thing) to an Agent that defined or instantiated the predicate instance. 
         
     
-    
+
 
 
     
@@ -1647,7 +1647,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1657,7 +1657,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1665,7 +1665,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         assigns
     
-    
+
 
 
     
@@ -1674,7 +1674,7 @@ there is a measurement process p that has specified output m, a measurement datu
         concept for
         
     
-    
+
 
 
     
@@ -1684,7 +1684,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Indicates that the Orcid ID has been confirmed by this Person
         
     
-    
+
 
 
     
@@ -1694,7 +1694,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1705,7 +1705,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1715,7 +1715,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1724,7 +1724,7 @@ there is a measurement process p that has specified output m, a measurement datu
         date/time interval
         
     
-    
+
 
 
     
@@ -1734,7 +1734,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1743,7 +1743,7 @@ there is a measurement process p that has specified output m, a measurement datu
         date/time value
         
     
-    
+
 
 
     
@@ -1753,7 +1753,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1762,7 +1762,7 @@ there is a measurement process p that has specified output m, a measurement datu
         distributes
         Public Description for bibo:distributor taken from here:  http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html .
     
-    
+
 
 
     
@@ -1774,7 +1774,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1783,7 +1783,7 @@ there is a measurement process p that has specified output m, a measurement datu
         credential eligibility attained
         
     
-    
+
 
 
     
@@ -1794,7 +1794,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1806,7 +1806,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1815,7 +1815,7 @@ there is a measurement process p that has specified output m, a measurement datu
         expiration date
         
     
-    
+
 
 
     
@@ -1824,7 +1824,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1835,7 +1835,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1846,7 +1846,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1857,7 +1857,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1867,7 +1867,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1876,7 +1876,7 @@ there is a measurement process p that has specified output m, a measurement datu
         geographic focus of
         
     
-    
+
 
 
     
@@ -1886,7 +1886,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1897,7 +1897,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1905,7 +1905,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         associated concept
     
-    
+
 
 
     
@@ -1929,7 +1929,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1938,7 +1938,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has facility
         
     
-    
+
 
 
     
@@ -1954,7 +1954,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -1963,7 +1963,7 @@ there is a measurement process p that has specified output m, a measurement datu
         governing authority
         
     
-    
+
 
 
     
@@ -1974,7 +1974,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1985,7 +1985,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -1997,7 +1997,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2006,7 +2006,7 @@ there is a measurement process p that has specified output m, a measurement datu
         published in
         
     
-    
+
 
 
     
@@ -2016,7 +2016,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2026,7 +2026,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2036,7 +2036,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2047,7 +2047,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2059,7 +2059,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2068,7 +2068,7 @@ there is a measurement process p that has specified output m, a measurement datu
         offered by
         
     
-    
+
 
 
     
@@ -2076,7 +2076,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         offers
     
-    
+
 
 
     
@@ -2087,7 +2087,7 @@ there is a measurement process p that has specified output m, a measurement datu
         true
         
     
-    
+
 
 
     
@@ -2097,7 +2097,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2108,7 +2108,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2119,7 +2119,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2127,7 +2127,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         publication venue for
     
-    
+
 
 
     
@@ -2138,7 +2138,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2149,7 +2149,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2159,7 +2159,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Relates a Thing to a Relationship as a Thing that is somehow related to other Thing in the same Relationship instance. A Relationship instnace is a predicate over Thing and is created by an Agent.
         
     
-    
+
 
 
     
@@ -2168,7 +2168,7 @@ there is a measurement process p that has specified output m, a measurement datu
         relates
         Relates a Relationship instance to the one or more Thing of the Relationship. There is a separate property (assigned by) to relate to the Agent that defines the Relationship.
     
-    
+
 
 
     
@@ -2179,7 +2179,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2188,7 +2188,7 @@ there is a measurement process p that has specified output m, a measurement datu
         research area of
         
     
-    
+
 
 
     
@@ -2198,7 +2198,7 @@ there is a measurement process p that has specified output m, a measurement datu
         The bibo:reviewOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html .  As of 26 May 2010, bibo:reviewOf is used with the class Review, but core:reviewIn doesn't seem to be being used.
         
     
-    
+
 
 
     
@@ -2207,7 +2207,7 @@ there is a measurement process p that has specified output m, a measurement datu
         contributes to
         
     
-    
+
 
 
     
@@ -2218,7 +2218,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2228,7 +2228,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2239,7 +2239,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2249,7 +2249,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2258,7 +2258,7 @@ there is a measurement process p that has specified output m, a measurement datu
         subject area of
         
     
-    
+
 
 
     
@@ -2268,7 +2268,7 @@ there is a measurement process p that has specified output m, a measurement datu
         general relationship of support
         
     
-    
+
 
 
     
@@ -2279,7 +2279,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2288,7 +2288,7 @@ there is a measurement process p that has specified output m, a measurement datu
         supports
         general relationship of support
     
-    
+
 
 
     
@@ -2305,7 +2305,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -2314,7 +2314,7 @@ there is a measurement process p that has specified output m, a measurement datu
         valid in
         
     
-    
+
 
 
     
@@ -2323,7 +2323,7 @@ there is a measurement process p that has specified output m, a measurement datu
         access provided by
         
     
-    
+
 
 
     
@@ -2345,7 +2345,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -2362,7 +2362,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -2370,7 +2370,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         implements
     
-    
+
 
 
     
@@ -2386,7 +2386,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -2394,7 +2394,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has agent
     
-    
+
 
 
     
@@ -2402,7 +2402,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         deprecated property
     
-    
+
 
 
     
@@ -2413,13 +2413,13 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -2432,7 +2432,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2444,7 +2444,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2455,7 +2455,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -2464,7 +2464,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has address
         
     
-    
+
 
 
     
@@ -2473,7 +2473,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has calendar link
         
     
-    
+
 
 
     
@@ -2482,7 +2482,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has calendar request
         
     
-    
+
 
 
     
@@ -2491,7 +2491,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has calendar busy
         
     
-    
+
 
 
     
@@ -2500,7 +2500,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has category
         
     
-    
+
 
 
     
@@ -2509,7 +2509,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has email
         
     
-    
+
 
 
     
@@ -2518,7 +2518,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has formatted name
         
     
-    
+
 
 
     
@@ -2527,7 +2527,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has geo
         
     
-    
+
 
 
     
@@ -2536,7 +2536,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has messaging
         
     
-    
+
 
 
     
@@ -2545,7 +2545,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has key
         
     
-    
+
 
 
     
@@ -2554,7 +2554,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has language
         
     
-    
+
 
 
     
@@ -2563,7 +2563,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has logo
         
     
-    
+
 
 
     
@@ -2582,7 +2582,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -2591,7 +2591,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has name
         
     
-    
+
 
 
     
@@ -2600,7 +2600,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has nickname
         
     
-    
+
 
 
     
@@ -2609,7 +2609,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has note
         
     
-    
+
 
 
     
@@ -2618,7 +2618,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has organization name
         
     
-    
+
 
 
     
@@ -2627,7 +2627,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has organizational unit name
         
     
-    
+
 
 
     
@@ -2636,7 +2636,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has photo
         
     
-    
+
 
 
     
@@ -2645,7 +2645,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has related
         
     
-    
+
 
 
     
@@ -2654,7 +2654,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has sound
         
     
-    
+
 
 
     
@@ -2663,7 +2663,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has telephone
         
     
-    
+
 
 
     
@@ -2672,7 +2672,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has time zone
         
     
-    
+
 
 
     
@@ -2681,7 +2681,7 @@ there is a measurement process p that has specified output m, a measurement datu
         has title
         
     
-    
+
 
 
     
@@ -2690,10 +2690,10 @@ there is a measurement process p that has specified output m, a measurement datu
         has URL
         
     
-    
 
 
-    
 
-    
+
 
 
     
@@ -2718,7 +2718,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://datos.bancomundial.org/indicador/NY.GDP.MKTP.CD
         http://donnees.banquemondiale.org/indicateur/NY.GDP.MKTP.CD
     
-    
+
 
 
     
@@ -2726,7 +2726,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         GDP notes
     
-    
+
 
 
     
@@ -2734,7 +2734,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         GDP total in current prices
     
-    
+
 
 
     
@@ -2742,7 +2742,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         GDP unit
     
-    
+
 
 
     
@@ -2750,7 +2750,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         GDPYear
     
-    
+
 
 
     
@@ -2766,31 +2766,31 @@ there is a measurement process p that has specified output m, a measurement datu
         http://hdrstats.undp.org/es/indicadores/49806.html
         http://hdrstats.undp.org/fr/indicateurs/49806.html
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -2806,7 +2806,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=es#ancor
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=fr#ancor
     
-    
+
 
 
     
@@ -2814,7 +2814,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         agricultural area notes
     
-    
+
 
 
     
@@ -2822,7 +2822,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         agriculturalAreaTotal
     
-    
+
 
 
     
@@ -2830,7 +2830,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         agricultural area unit
     
-    
+
 
 
     
@@ -2838,7 +2838,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         agriculturalAreaYear
     
-    
+
 
 
     
@@ -2853,7 +2853,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://aims.fao.org/fr/website/Search-AGROVOC/sub
         http://aims.fao.org/zh-hans/website/Search-AGROVOC/sub
     
-    
+
 
 
     
@@ -2870,7 +2870,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -2882,7 +2882,7 @@ there is a measurement process p that has specified output m, a measurement datu
         DBpedia http://dbpedia.org/About
         http://dbpedia.org/About
     
-    
+
 
 
     
@@ -2895,7 +2895,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://faostat.fao.org/default.aspx?lang=es
         http://faostat.fao.org/default.aspx?lang=fr
     
-    
+
 
 
     
@@ -2912,7 +2912,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -2924,7 +2924,7 @@ there is a measurement process p that has specified output m, a measurement datu
         Global Administrative Unit Layers http://www.fao.org/geonetwork/srv/en/metadata.show?id=12691
         http://www.fao.org/geonetwork/srv/en/metadata.show?id=12691
     
-    
+
 
 
     
@@ -2935,7 +2935,7 @@ there is a measurement process p that has specified output m, a measurement datu
         ISO 3166-1 http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
         http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
     
-    
+
 
 
     
@@ -2948,7 +2948,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://unstats.un.org/unsd/methods/m49/m49alpha.htm
         http://unstats.un.org/unsd/methods/m49/m49alphaf.htm
     
-    
+
 
 
     
@@ -2961,7 +2961,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://unstats.un.org/unsd/methods/m49/m49alpha.htm
         http://unstats.un.org/unsd/methods/m49/m49alphaf.htm
     
-    
+
 
 
     
@@ -2969,7 +2969,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         codeUNDP
     
-    
+
 
 
     
@@ -2985,7 +2985,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=es#ancor
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=fr#ancor
     
-    
+
 
 
     
@@ -2993,7 +2993,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         country area notes
     
-    
+
 
 
     
@@ -3001,7 +3001,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         total country area
     
-    
+
 
 
     
@@ -3009,7 +3009,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         country area unit
     
-    
+
 
 
     
@@ -3017,7 +3017,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         countryAreaYear
     
-    
+
 
 
     
@@ -3025,7 +3025,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has code
     
-    
+
 
 
     
@@ -3033,7 +3033,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has coordinate
     
-    
+
 
 
     
@@ -3041,7 +3041,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has currency
     
-    
+
 
 
     
@@ -3049,7 +3049,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has list name
     
-    
+
 
 
     
@@ -3057,7 +3057,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has maximum latitude
     
-    
+
 
 
     
@@ -3065,7 +3065,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has maximum longitude
     
-    
+
 
 
     
@@ -3073,7 +3073,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has minimum latitude
     
-    
+
 
 
     
@@ -3081,7 +3081,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has minimum longitude
     
-    
+
 
 
     
@@ -3089,7 +3089,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has nationality
     
-    
+
 
 
     
@@ -3097,7 +3097,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has official name
     
-    
+
 
 
     
@@ -3105,7 +3105,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has short name
     
-    
+
 
 
     
@@ -3113,7 +3113,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         has statistics
     
-    
+
 
 
     
@@ -3129,7 +3129,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=es#ancor
         http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=fr#ancor
     
-    
+
 
 
     
@@ -3137,7 +3137,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         land area notes
     
-    
+
 
 
     
@@ -3145,7 +3145,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         total land area
     
-    
+
 
 
     
@@ -3153,7 +3153,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         land area unit
     
-    
+
 
 
     
@@ -3161,7 +3161,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         landAreaYear
     
-    
+
 
 
     
@@ -3178,7 +3178,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3195,7 +3195,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3212,7 +3212,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3229,7 +3229,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3246,7 +3246,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3263,7 +3263,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3280,7 +3280,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3297,7 +3297,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3314,7 +3314,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3331,7 +3331,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3348,7 +3348,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3365,7 +3365,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3382,7 +3382,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3399,7 +3399,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3416,7 +3416,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3433,7 +3433,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3450,7 +3450,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3467,7 +3467,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3484,7 +3484,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3501,7 +3501,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3518,7 +3518,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3535,7 +3535,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3552,7 +3552,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3569,7 +3569,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3586,7 +3586,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3603,7 +3603,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3620,7 +3620,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3637,7 +3637,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3654,7 +3654,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3671,7 +3671,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3688,7 +3688,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3705,7 +3705,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3722,7 +3722,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3739,7 +3739,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3756,7 +3756,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://www.fao.org/termportal/contr/fr/
         http://www.fao.org/termportal/contr/zh/
     
-    
+
 
 
     
@@ -3772,7 +3772,7 @@ there is a measurement process p that has specified output m, a measurement datu
         http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=es#ancor
         http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=fr#ancor
     
-    
+
 
 
     
@@ -3780,7 +3780,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         population notes
     
-    
+
 
 
     
@@ -3788,7 +3788,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         total population
     
-    
+
 
 
     
@@ -3796,7 +3796,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         population unit
     
-    
+
 
 
     
@@ -3804,7 +3804,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         populationYear
     
-    
+
 
 
     
@@ -3813,7 +3813,7 @@ there is a measurement process p that has specified output m, a measurement datu
         valid since
         The value of the datatype property *validSince* associated to a particular area (territory or group) indicates the area's  first year of validity.  The geopolitical ontology traces back historic changes only until 1985, therefore, if an area has a validSince = 1985, this indicates that the area is/was valid since 1985 or before.       
     
-    
+
 
 
     
@@ -3823,7 +3823,7 @@ there is a measurement process p that has specified output m, a measurement datu
         The value of the datatype property *validUntil* associated to a particular area (territory or group) indicates the area's last year of validity. In case the area is currently valid, this value is set by default to 9999.
       
     
-    
+
 
 
     
@@ -3834,7 +3834,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -3844,7 +3844,7 @@ there is a measurement process p that has specified output m, a measurement datu
         A free text field for recording topics which relate to the resource. 
         
     
-    
+
 
 
     
@@ -3855,7 +3855,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -3866,7 +3866,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -3874,7 +3874,7 @@ there is a measurement process p that has specified output m, a measurement datu
     
         Measurement Label
     
-    
+
 
 
     
@@ -3898,7 +3898,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -3929,7 +3929,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -3946,7 +3946,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -3962,7 +3962,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -3985,7 +3985,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -4007,7 +4007,7 @@ there is a measurement process p that has specified output m, a measurement datu
             
         
     
-    
+
 
 
     
@@ -4023,7 +4023,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -4039,7 +4039,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -4052,7 +4052,7 @@ there is a measurement process p that has specified output m, a measurement datu
         A summary of the resource.
         
     
-    
+
 
 
     
@@ -4066,7 +4066,7 @@ there is a measurement process p that has specified output m, a measurement datu
         stable
         
     
-    
+
 
 
     
@@ -4079,7 +4079,7 @@ there is a measurement process p that has specified output m, a measurement datu
         
         
     
-    
+
 
 
     
@@ -4093,7 +4093,7 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik
         stable
         
     
-    
+
 
 
     
@@ -4106,7 +4106,7 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik
         
         
     
-    
+
 
 
     
@@ -4120,7 +4120,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         stable
         
     
-    
+
 
 
     
@@ -4131,7 +4131,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         stable
         The name defining a special edition of a document. Normally its a literal value composed of a version number and words.
     
-    
+
 
 
     
@@ -4144,7 +4144,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         stable
         
     
-    
+
 
 
     
@@ -4157,7 +4157,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         Global Trade Item Number 14
         
     
-    
+
 
 
     
@@ -4166,7 +4166,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         identifier
         
     
-    
+
 
 
     
@@ -4177,7 +4177,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         
         
     
-    
+
 
 
     
@@ -4188,7 +4188,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         
         
     
-    
+
 
 
     
@@ -4201,7 +4201,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         International Standard Serial Number
         
     
-    
+
 
 
     
@@ -4212,7 +4212,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         
         
     
-    
+
 
 
     
@@ -4225,7 +4225,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         Library of Congress Control Number
         
     
-    
+
 
 
     
@@ -4237,7 +4237,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         A description (often numeric) that locates an item within a containing document or collection.
         stable
     
-    
+
 
 
     
@@ -4246,7 +4246,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         number of pages
         
     
-    
+
 
 
     
@@ -4255,14 +4255,14 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi
         number
         Definition from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html
     
-    
+
 
 
     
 
     
         Online Computer Library Center (OCLC) number
-        http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:oclcnum/. 
+        http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:oclcnum/.
 
 
 bibo has the domain of this property set to the union of Collection and Document.
@@ -4271,7 +4271,7 @@ bibo has the domain of this property set to the union of Collection and Document
         stable
         
     
-    
+
 
 
     
@@ -4283,7 +4283,7 @@ bibo has the domain of this property set to the union of Collection and Document
         Ending page number within a continuous page range.
         
     
-    
+
 
 
     
@@ -4295,7 +4295,7 @@ bibo has the domain of this property set to the union of Collection and Document
         Starting page number within a continuous page range.
         
     
-    
+
 
 
     
@@ -4309,7 +4309,7 @@ bibo has the domain of this property set to the union of Collection and Document
         
         
     
-    
+
 
 
     
@@ -4322,7 +4322,7 @@ bibo has the domain of this property set to the union of Collection and Document
         The prefix of a name
         stable
     
-    
+
 
 
     
@@ -4337,7 +4337,7 @@ modern society using the world of Star trek. Los Angeles Times, March
 15, sec. A, p. 3.
         
     
-    
+
 
 
     
@@ -4349,7 +4349,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         unstable
         The idea here is that while dcterms:description may involve length descriptions, this for short (two or three word) descriptions that could go in a bibliographic entry.
     
-    
+
 
 
     
@@ -4362,7 +4362,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         Serial Item and Contribution Identifier
         
     
-    
+
 
 
     
@@ -4375,7 +4375,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         Universal Product Code
         
     
-    
+
 
 
     
@@ -4385,7 +4385,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         Definition from: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html
         
     
-    
+
 
 
     
@@ -4395,7 +4395,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         
     
-    
+
 
 
     
@@ -4406,7 +4406,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         
     
-    
+
 
 
     
@@ -4418,7 +4418,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         
     
-    
+
 
 
     
@@ -4426,7 +4426,7 @@ modern society using the world of Star trek. Los Angeles Times, March
     
         preferred namespace URI
     
-    
+
 
 
     
@@ -4437,7 +4437,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         A short form for an longer title or name.
         B.A.
     
-    
+
 
 
     
@@ -4446,7 +4446,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         published US Classification Class/subclass (CCL) code
         
     
-    
+
 
 
     
@@ -4454,7 +4454,7 @@ modern society using the world of Star trek. Los Angeles Times, March
     
         contact information
     
-    
+
 
 
     
@@ -4463,7 +4463,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         credits
     
-    
+
 
 
     
@@ -4473,7 +4473,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         
     
-    
+
 
 
     
@@ -4483,7 +4483,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         Not intended to be an institution name.
         
     
-    
+
 
 
     
@@ -4491,7 +4491,7 @@ modern society using the world of Star trek. Los Angeles Times, March
     
         description
     
-    
+
 
 
     
@@ -4501,7 +4501,7 @@ modern society using the world of Star trek. Los Angeles Times, March
         
         
     
-    
+
 
 
     
@@ -4509,7 +4509,7 @@ modern society using the world of Star trek. Los Angeles Times, March
     
         entry term
     
-    
+
 
 
     
@@ -4521,7 +4521,7 @@ modern society using the world of Star trek. Los Angeles Times, March
 use one freetextKeyword assertion for each keyword or phrase.
         one keyword or phrase per freetextKeyword assertion
     
-    
+
 
 
     
@@ -4538,7 +4538,7 @@ use one freetextKeyword assertion for each keyword or phrase.
             
         
     
-    
+
 
 
     
@@ -4546,7 +4546,7 @@ use one freetextKeyword assertion for each keyword or phrase.
     
         has monetary amount
     
-    
+
 
 
     
@@ -4554,7 +4554,7 @@ use one freetextKeyword assertion for each keyword or phrase.
     
         has value
     
-    
+
 
 
     
@@ -4564,7 +4564,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         hide from display
         
     
-    
+
 
 
     
@@ -4575,7 +4575,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         administrative secretary
         
     
-    
+
 
 
     
@@ -4586,7 +4586,7 @@ use one freetextKeyword assertion for each keyword or phrase.
 
         
     
-    
+
 
 
     
@@ -4594,7 +4594,7 @@ use one freetextKeyword assertion for each keyword or phrase.
     
         identifier
     
-    
+
 
 
     
@@ -4606,7 +4606,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         
     
-    
+
 
 
     
@@ -4615,7 +4615,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         license number
         
     
-    
+
 
 
     
@@ -4633,7 +4633,7 @@ use one freetextKeyword assertion for each keyword or phrase.
             
         
     
-    
+
 
 
     
@@ -4643,7 +4643,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         Information Science; Computer Science; Anthropology
         
     
-    
+
 
 
     
@@ -4651,7 +4651,7 @@ use one freetextKeyword assertion for each keyword or phrase.
     
         middle name or initial
     
-    
+
 
 
     
@@ -4661,7 +4661,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         
     
-    
+
 
 
     
@@ -4673,7 +4673,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         Used for a single narrative summary of outreach, typically covering a wide range of activities and time periods; use Outreach Provider Role for information on individual activities
         
     
-    
+
 
 
     
@@ -4685,7 +4685,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         Short text for presentation describing the agent's purpose, activities, and/or accomplishments.
         
     
-    
+
 
 
     
@@ -4697,7 +4697,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         
     
-    
+
 
 
     
@@ -4706,7 +4706,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         place of publication
     
-    
+
 
 
     
@@ -4717,7 +4717,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         
     
-    
+
 
 
     
@@ -4725,7 +4725,7 @@ use one freetextKeyword assertion for each keyword or phrase.
     
         preferred display order
     
-    
+
 
 
     
@@ -4735,7 +4735,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         this number indicates a position in a list
         
     
-    
+
 
 
     
@@ -4746,7 +4746,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         
         
     
-    
+
 
 
     
@@ -4757,7 +4757,7 @@ use one freetextKeyword assertion for each keyword or phrase.
         Used for a single narrative summary of research, typically covering a wide range of activities and time periods; use Researcher Role for information on individual activities
         
     
-    
+
 
 
     
@@ -4769,7 +4769,7 @@ Definition source: http://isiwebofknowledge.com/researcherid/
         
         
     
-    
+
 
 
     
@@ -4780,7 +4780,7 @@ Definition source: http://isiwebofknowledge.com/researcherid/
         
         
     
-    
+
 
 
     
@@ -4793,7 +4793,7 @@ Definition source: http://isiwebofknowledge.com/researcherid/
         
         
     
-    
+
 
 
     
@@ -4816,7 +4816,7 @@ See also core:localAwardId.
             
         
     
-    
+
 
 
     
@@ -4824,7 +4824,7 @@ See also core:localAwardId.
     
         supplemental information
     
-    
+
 
 
     
@@ -4835,7 +4835,7 @@ See also core:localAwardId.
         Used for a single narrative summary of teaching, typically covering a wide range of courses including for credit and non-credit teaching over multiple semesters; the "teaches" property links a person directly with an instance of a Semester Class, typically from an institutional database of record; then use Teacher Role for information about a person's role in non-credit teaching or their specific contribution to individual courses
         
     
-    
+
 
 
     
@@ -4843,7 +4843,7 @@ See also core:localAwardId.
     
         term label
     
-    
+
 
 
     
@@ -4851,7 +4851,7 @@ See also core:localAwardId.
     
         term type
     
-    
+
 
 
     
@@ -4868,7 +4868,7 @@ See also core:localAwardId.
             
         
     
-    
+
 
 
     
@@ -4877,7 +4877,7 @@ See also core:localAwardId.
         Institutional Review Board (IRB) number
         Every clinical trial in the United States must be approved and monitored by an Institutional Review Board (IRB). An IRB is an independent committee of physicians, statisticians, community advocates and others whose objective is to ensure that a clinical trial is ethical and the rights of study participants are protected. 
     
-    
+
 
 
     
@@ -4887,7 +4887,7 @@ See also core:localAwardId.
         ClinicalTrials.gov is an ICMJE-acceptable public registry, offering up-to-date information for locating clinical trials for a wide range of diseases and conditions. The U.S. National Institutes of Health (NIH), through its National Library of Medicine (NLM), developed this site in collaboration with the Food and Drug Administration (FDA), as a result of the FDA Modernization Act, which was passed into law in November 1997.   This property should be publically visible since it is one of the principal identifiers in a national registry of clinical trials 
         NCT00000419
     
-    
+
 
 
     
@@ -4896,7 +4896,7 @@ See also core:localAwardId.
         study population count
         number of human participants in the study (trial).
     
-    
+
 
 
     
@@ -4906,7 +4906,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4917,7 +4917,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4928,7 +4928,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4938,7 +4938,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4948,7 +4948,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4958,7 +4958,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4968,7 +4968,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4978,7 +4978,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4988,7 +4988,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -4999,7 +4999,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -5009,7 +5009,7 @@ See also core:localAwardId.
         
         
     
-    
+
 
 
     
@@ -5021,7 +5021,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5032,7 +5032,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5043,7 +5043,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5054,7 +5054,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5064,7 +5064,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5074,7 +5074,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5084,7 +5084,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5094,7 +5094,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Use 2 char language code from RFC5646
         
     
-    
+
 
 
     
@@ -5104,7 +5104,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5114,7 +5114,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5124,7 +5124,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5134,7 +5134,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5144,7 +5144,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5154,7 +5154,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5164,7 +5164,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5174,7 +5174,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5183,7 +5183,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         product ID
         
     
-    
+
 
 
     
@@ -5193,7 +5193,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5203,7 +5203,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5212,7 +5212,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         revision
         
     
-    
+
 
 
     
@@ -5222,7 +5222,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5231,7 +5231,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         sort as
         
     
-    
+
 
 
     
@@ -5241,7 +5241,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5250,7 +5250,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         source
         
     
-    
+
 
 
     
@@ -5260,7 +5260,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5269,7 +5269,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Telephone
         
     
-    
+
 
 
     
@@ -5279,7 +5279,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5289,7 +5289,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         
     
-    
+
 
 
     
@@ -5299,7 +5299,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         To specify a value that represents a globally unique identifier corresponding to the entity associated with the vCard
         
     
-    
+
 
 
     
@@ -5308,10 +5308,10 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         URL
         
     
-    
 
 
-    
 
-    
+
 
 
     
@@ -5520,7 +5520,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
             
         
     
-    
+
 
 
     
@@ -5529,7 +5529,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Disputed
         
     
-    
+
 
 
     
@@ -5538,7 +5538,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Economic Region
         
     
-    
+
 
 
     
@@ -5549,7 +5549,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         United Nations statistics department http://unstats.un.org/unsd/methods/m49/m49regin.htm
     
-    
+
 
 
     
@@ -5558,7 +5558,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Group
         
     
-    
+
 
 
     
@@ -5586,7 +5586,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         UN Cartographic Section, Department of Field Support http://www.un.org/Depts/Cartographic/map/profile/world00.pdf
     
-    
+
 
 
     
@@ -5595,7 +5595,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Organization
         
     
-    
+
 
 
     
@@ -5604,7 +5604,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Other
         
     
-    
+
 
 
     
@@ -5616,7 +5616,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         
         United Nations Map Library http://www.un.org/depts/dhl/maplib/countinfo.htm
     
-    
+
 
 
     
@@ -5625,7 +5625,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Special Group
         
     
-    
+
 
 
     
@@ -5887,13 +5887,13 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
             
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -5902,7 +5902,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Topic Weight Measurement
         
     
-    
+
 
 
     
@@ -5911,7 +5911,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Expertise Measurement
         
     
-    
+
 
 
     
@@ -5920,7 +5920,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Topic Weight Measurement Process
         
     
-    
+
 
 
     
@@ -5929,7 +5929,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Expertise Measurement Process
         
     
-    
+
 
 
     
@@ -5938,7 +5938,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Experience
         
     
-    
+
 
 
     
@@ -5947,7 +5947,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         specialty
         
     
-    
+
 
 
     
@@ -5956,7 +5956,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Contact Qualifier
         
     
-    
+
 
 
     
@@ -5965,7 +5965,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         FOAF Profile
         
     
-    
+
 
 
     
@@ -5974,7 +5974,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Contact
         
     
-    
+
 
 
     
@@ -5982,7 +5982,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
     
         Entity
     
-    
+
 
 
     
@@ -5991,7 +5991,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Continuant
         
     
-    
+
 
 
     
@@ -6000,7 +6000,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Occurrent
         
     
-    
+
 
 
     
@@ -6009,7 +6009,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Independent Continuant
         
     
-    
+
 
 
     
@@ -6018,7 +6018,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Spatial Region
         
     
-    
+
 
 
     
@@ -6027,7 +6027,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Temporal Region
         
     
-    
+
 
 
     
@@ -6036,7 +6036,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Process
         
     
-    
+
 
 
     
@@ -6045,7 +6045,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Disposition
         
     
-    
+
 
 
     
@@ -6067,7 +6067,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         the role of this boundary to delineate where Utah and Colorado meet
         
     
-    
+
 
 
     
@@ -6076,7 +6076,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Quality
         
     
-    
+
 
 
     
@@ -6085,7 +6085,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Specifically Dependent Continuant
         
     
-    
+
 
 
     
@@ -6115,7 +6115,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Only use if no specific subclasses of core:Role describe the role.
         Only use this broad role class if no subclasses of role describe the item being classified.
     
-    
+
 
 
     
@@ -6124,7 +6124,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Site
         
     
-    
+
 
 
     
@@ -6133,7 +6133,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Generically Dependent Continuant
         
     
-    
+
 
 
     
@@ -6142,7 +6142,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Function
         
     
-    
+
 
 
     
@@ -6151,7 +6151,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         One-Dimensional Temporal Region
         
     
-    
+
 
 
     
@@ -6160,7 +6160,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Material Entity
         
     
-    
+
 
 
     
@@ -6169,7 +6169,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Immaterial Entity
         
     
-    
+
 
 
     
@@ -6178,7 +6178,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Zero-Dimensional Temporal Region
         
     
-    
+
 
 
     
@@ -6206,7 +6206,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         instrument
         
     
-    
+
 
 
     
@@ -6222,7 +6222,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         service
         
     
-    
+
 
 
     
@@ -6257,7 +6257,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         reagent
         
     
-    
+
 
 
     
@@ -6272,7 +6272,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wikipedia.org/wiki/Technique
         
     
-    
+
 
 
     
@@ -6288,7 +6288,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6310,7 +6310,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Melissa Haendel
         
     
-    
+
 
 
     
@@ -6326,7 +6326,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         human study
         
     
-    
+
 
 
     
@@ -6351,7 +6351,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wikipedia.org/wiki/Clinical_trial
         
     
-    
+
 
 
     
@@ -6374,7 +6374,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wikipedia.org/wiki/Specimen
         
     
-    
+
 
 
     
@@ -6390,7 +6390,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         software
         
     
-    
+
 
 
     
@@ -6404,7 +6404,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         The NIH is a funding agency.
         
     
-    
+
 
 
     
@@ -6418,7 +6418,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6433,7 +6433,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6448,7 +6448,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         coordinate with NIF. NIF ID:nlx_res_20090419
         
     
-    
+
 
 
     
@@ -6463,7 +6463,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Training a researcher to use a microscope.
         
     
-    
+
 
 
     
@@ -6478,7 +6478,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://neurolex.org/wiki/Category:Production_service_resource
         
     
-    
+
 
 
     
@@ -6493,7 +6493,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://neurolex.org/wiki/Category:Analysis_service_resource
         
     
-    
+
 
 
     
@@ -6508,7 +6508,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://neurolex.org/wiki/Category:Material_service_resource
         
     
-    
+
 
 
     
@@ -6522,7 +6522,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Technology Transfer Office
         
     
-    
+
 
 
     
@@ -6562,7 +6562,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         student research opportunity
         
     
-    
+
 
 
     
@@ -6575,7 +6575,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6588,7 +6588,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wiktionary.org/wiki/citizen
         
     
-    
+
 
 
     
@@ -6601,7 +6601,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         https://www.google.com/search?q=residency+status&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=Bcx&rls=org.mozilla:en-US:official&q=citizen&tbs=dfn:1&tbo=u&sa=X&ei=micXT_DwMIjUiAK15tDUDw&ved=0CCgQkQ4&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=7b67128a22f602af&biw=1609&bih=794
         
     
-    
+
 
 
     
@@ -6614,7 +6614,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://connection.ebscohost.com/us/immigration-restrictions/overview-legal-and-illegal-immigration
         
     
-    
+
 
 
     
@@ -6627,7 +6627,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://www.irs.gov/taxtopics/tc851.html
         
     
-    
+
 
 
     
@@ -6641,7 +6641,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://www.thefreedictionary.com/student
         
     
-    
+
 
 
     
@@ -6655,7 +6655,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://www.thefreedictionary.com/student
         
     
-    
+
 
 
     
@@ -6669,7 +6669,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://www.thefreedictionary.com/student
         
     
-    
+
 
 
     
@@ -6683,7 +6683,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://www.thefreedictionary.com/student
         
     
-    
+
 
 
     
@@ -6697,7 +6697,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://dictionary.reference.com/browse/employment
         
     
-    
+
 
 
     
@@ -6711,7 +6711,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://dictionary.reference.com/browse/faculty
         
     
-    
+
 
 
     
@@ -6725,7 +6725,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6738,7 +6738,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6752,7 +6752,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Nicole Vasilevsky
         
     
-    
+
 
 
     
@@ -6766,7 +6766,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wikipedia.org/wiki/License
         
     
-    
+
 
 
     
@@ -6780,7 +6780,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Transport of a patient within a hospital.
         
     
-    
+
 
 
     
@@ -6794,7 +6794,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Technical support.
         
     
-    
+
 
 
     
@@ -6808,7 +6808,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6822,7 +6822,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         Storing data on a server.
         
     
-    
+
 
 
     
@@ -6835,7 +6835,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6849,7 +6849,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6863,7 +6863,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6877,7 +6877,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6893,7 +6893,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         data transformation service
         
     
-    
+
 
 
     
@@ -6907,7 +6907,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         PERSON: Matthew Brush
         
     
-    
+
 
 
     
@@ -6921,7 +6921,7 @@ To enable other Gender/Sex codes to be used, this dataproperty has range URI. Th
         http://en.wikipedia.org/wiki/Database
         
     
-    
+
 
 
     
@@ -6943,7 +6943,7 @@ of this, different, term.
         
         
     
-    
+
 
 
     
@@ -6964,7 +6964,7 @@ of this, different, term.
         
         
     
-    
+
 
 
     
@@ -6979,7 +6979,7 @@ of this, different, term.
         
         
     
-    
+
 
 
     
@@ -6994,7 +6994,7 @@ of this, different, term.
         
         
     
-    
+
 
 
     
@@ -7012,7 +7012,7 @@ of this, different, term.
         
         
     
-    
+
 
 
     
@@ -7024,10 +7024,10 @@ of this, different, term.
         2009-03-16: data item deliberatly ambiguous: we merged data set and datum to be one entity, not knowing how to define singular versus plural. So data item is more general than datum.
         2009-03-16: removed datum as alternative term as datum specifically refers to singular form, and is thus not an exact synonym.
         Data items include counts of things, analyte concentrations, and statistical summaries.
-        JAR: datum     -- well, this will be very tricky to define, but maybe some 
-information-like stuff that might be put into a computer and that is 
-meant, by someone, to denote and/or to be interpreted by some 
-process... I would include lists, tables, sentences... I think I might 
+        JAR: datum     -- well, this will be very tricky to define, but maybe some
+information-like stuff that might be put into a computer and that is
+meant, by someone, to denote and/or to be interpreted by some
+process... I would include lists, tables, sentences... I think I might
 defer to Barry, or to Brian Cantwell Smith
 
 JAR: A data item is an approximately justified approximately true approximate belief
@@ -7040,7 +7040,7 @@ JAR: A data item is an approximately justified approximately true approximate be
         
         
     
-    
+
 
 
     
@@ -7108,7 +7108,7 @@ Previous. An information content entity is a non-realizable information entity t
         
         
     
-    
+
 
 
     
@@ -7125,7 +7125,7 @@ this case we explicitly refer to the singular form
         a scalar measurement datum is a measurement datum that is composed of two parts, numerals and a unit label.
         
     
-    
+
 
 
     
@@ -7141,7 +7141,7 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
@@ -7152,7 +7152,7 @@ this case we explicitly refer to the singular form
         Person:Alan Ruttenberg
         data about an ontology part is a data item about a part of an ontology, for example a term
     
-    
+
 
 
     
@@ -7171,7 +7171,7 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
@@ -7188,7 +7188,7 @@ this case we explicitly refer to the singular form
         person:Chris Stoeckert
         
     
-    
+
 
 
     
@@ -7205,7 +7205,7 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
@@ -7221,7 +7221,7 @@ this case we explicitly refer to the singular form
         text
         textual entity
     
-    
+
 
 
     
@@ -7239,7 +7239,7 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
@@ -7255,25 +7255,25 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -7290,13 +7290,13 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -7323,7 +7323,7 @@ this case we explicitly refer to the singular form
         A person or organization that has a manufacturer role
         
     
-    
+
 
 
     
@@ -7332,7 +7332,7 @@ this case we explicitly refer to the singular form
         Rate Measurement Datum
         
     
-    
+
 
 
     
@@ -7351,7 +7351,7 @@ this case we explicitly refer to the singular form
         
         
     
-    
+
 
 
     
@@ -7363,7 +7363,7 @@ this case we explicitly refer to the singular form
         study design
         
     
-    
+
 
 
     
@@ -7372,7 +7372,7 @@ this case we explicitly refer to the singular form
         Rate Unit
         
     
-    
+
 
 
     
@@ -7428,13 +7428,13 @@ this case we explicitly refer to the singular form
 
 The previous short definition was: "An arbitrary classification of a space/time region, by a cognitive agent."
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -7442,17 +7442,17 @@ The previous short definition was: "An arbitrary classification of a space/
     
         Phase
         
-        Phase describes the level of a trial required of drugs before (and after) they are routinely used in clinical practice: 
-- Phase I trials assess toxic effects on humans (not many people participate in them, and usually without controls); 
-- Phase ll trials assess therapeutic benefit (usually involving a few hundred people, usually with controls, but not always); 
-- Phase III trials compare the new treatment against standard (or placebo) treatment (usually a full randomised controlled trial). At this point, a drug can be approved for community use. 
+        Phase describes the level of a trial required of drugs before (and after) they are routinely used in clinical practice:
+- Phase I trials assess toxic effects on humans (not many people participate in them, and usually without controls);
+- Phase ll trials assess therapeutic benefit (usually involving a few hundred people, usually with controls, but not always);
+- Phase III trials compare the new treatment against standard (or placebo) treatment (usually a full randomised controlled trial). At this point, a drug can be approved for community use.
 - Phase IV monitors a new treatment in the community, often to evaluate longterm safety and effectiveness. [Glossary of Terms in The Cochrane Collaboration]
 
 A trial can be of a combination phase (e.g., I/II).
 The concept of phase is not applicable to trials studying certain interventions (e.g., device, procedure, behavioral)
         Simona
     
-    
+
 
 
     
@@ -7463,7 +7463,7 @@ The concept of phase is not applicable to trials studying certain interventions
         A Phase 0 trial is an exploratory trial involving very limited human exposure, with no therapeutic or diagnostic intent (e.g., screening study, microdose study). [http://prsinfo.clinicaltrials.gov/definitions.html]
         Simona
     
-    
+
 
 
     
@@ -7474,7 +7474,7 @@ The concept of phase is not applicable to trials studying certain interventions
         A Phase I trial assesses toxic effects on humans (not many people participate, and usually without controls) [Glossary of Terms in The Cochrane Collaboration]
         Simona
     
-    
+
 
 
     
@@ -7485,7 +7485,7 @@ The concept of phase is not applicable to trials studying certain interventions
         A Phase ll trial assesses therapeutic benefit (usually involving a few hundred people, usually with controls, but not always) [Glossary of Terms in The Cochrane Collaboration]
         Simona
     
-    
+
 
 
     
@@ -7497,7 +7497,7 @@ The concept of phase is not applicable to trials studying certain interventions
 randomised controlled trial). At this point, a drug can be approved for community use. [Glossary of Terms in The Cochrane Collaboration]
         Simona
     
-    
+
 
 
     
@@ -7508,7 +7508,7 @@ randomised controlled trial). At this point, a drug can be approved for communit
         A Phase IV study monitors a new treatment in the community, often to evaluate longterm safety and effectiveness. [Glossary of Terms in The Cochrane Collaboration]
         Simona
     
-    
+
 
 
     
@@ -7521,7 +7521,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         Simona
         Simona: to be reviewed
     
-    
+
 
 
     
@@ -7547,7 +7547,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A scholarly academic article, typically published in a journal.
     
-    
+
 
 
     
@@ -7580,7 +7580,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A written composition in prose, usually nonfiction, on a specific topic, forming an independent part of a book or other publication, as a newspaper or magazine.
     
-    
+
 
 
     
@@ -7600,7 +7600,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         An audio document; aka record.
     
-    
+
 
 
     
@@ -7620,7 +7620,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         An audio-visual document; film, video, and so forth.
         stable
     
-    
+
 
 
     
@@ -7634,7 +7634,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         Draft legislation presented for discussion to a legal body.
         stable
     
-    
+
 
 
     
@@ -7672,7 +7672,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A written or printed work of fiction or nonfiction, usually on sheets of paper fastened or bound together within covers.
     
-    
+
 
 
     
@@ -7704,7 +7704,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A section of a book.
     
-    
+
 
 
     
@@ -7717,7 +7717,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A written argument submitted to a court.
         unstable
     
-    
+
 
 
     
@@ -7730,7 +7730,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A chapter of a book.
         unstable
     
-    
+
 
 
     
@@ -7745,7 +7745,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A collection of statutes.
     
-    
+
 
 
     
@@ -7765,7 +7765,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A document that simultaneously contains other documents.
     
-    
+
 
 
     
@@ -7786,7 +7786,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A collection of Documents or Collections
         stable
     
-    
+
 
 
     
@@ -7807,7 +7807,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A meeting for consultation or discussion.
     
-    
+
 
 
     
@@ -7821,7 +7821,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A collection of legal cases.
         stable
     
-    
+
 
 
     
@@ -7876,7 +7876,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         
         
     
-    
+
 
 
     
@@ -7902,7 +7902,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         a distinct part of a larger document or collected document.
         unstable
     
-    
+
 
 
     
@@ -7916,7 +7916,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         The status of the publication of a document.
         stable
     
-    
+
 
 
     
@@ -7948,7 +7948,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         An edited book.
         stable
     
-    
+
 
 
     
@@ -7962,7 +7962,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A passage selected from a larger work.
         stable
     
-    
+
 
 
     
@@ -7975,7 +7975,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         aka movie.
         stable
     
-    
+
 
 
     
@@ -7989,7 +7989,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         An instance or a session in which testimony and arguments are presented, esp. before an official, as a judge in a lawsuit.
         stable
     
-    
+
 
 
     
@@ -8005,7 +8005,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A document that presents visual or diagrammatic information.
     
-    
+
 
 
     
@@ -8019,7 +8019,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A formalized discussion between two or more people.
     
-    
+
 
 
     
@@ -8033,7 +8033,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         something that is printed or published and distributed, esp. a given number of a periodical
         stable
     
-    
+
 
 
     
@@ -8054,7 +8054,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A periodical of scholarly journal Articles.
     
-    
+
 
 
     
@@ -8067,7 +8067,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A document accompanying a legal case.
     
-    
+
 
 
     
@@ -8080,7 +8080,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A document containing an authoritative determination (as a decree or judgment) made after consideration of facts or law.
     
-    
+
 
 
     
@@ -8093,7 +8093,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A legal document; for example, a court decision, a brief, and so forth.
     
-    
+
 
 
     
@@ -8107,7 +8107,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A legal document proposing or enacting a law or a group of laws.
     
-    
+
 
 
     
@@ -8118,7 +8118,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A written or printed communication addressed to a person or organization and usually transmitted by mail
         A written or printed communication addressed to a person or organization and usually transmitted by mail
     
-    
+
 
 
     
@@ -8133,7 +8133,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A periodical of magazine Articles. A magazine is a publication that is issued periodically, usually bound in a paper cover, and typically contains essays, stories, poems, etc., by many writers, and often photographs and drawings, frequently specializing in a particular subject or area, as hobbies, news, or sports.
         stable
     
-    
+
 
 
     
@@ -8147,7 +8147,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A small reference book, especially one giving instructions.
         unstable
     
-    
+
 
 
     
@@ -8161,7 +8161,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         An unpublished Document, which may also be submitted to a publisher for publication.
         stable
     
-    
+
 
 
     
@@ -8175,7 +8175,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A graphical depiction of geographic features.
         unstable
     
-    
+
 
 
     
@@ -8189,7 +8189,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A periodical of documents, usually issued daily or weekly, containing current news, editorials, feature articles, and usually advertising.
     
-    
+
 
 
     
@@ -8203,7 +8203,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         Notes or annotations about a resource.
     
-    
+
 
 
     
@@ -8229,7 +8229,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A document describing the exclusive right granted by a government to an inventor to manufacture, use, or sell an invention for a certain number of years.
         stable
     
-    
+
 
 
     
@@ -8242,7 +8242,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A public performance.
     
-    
+
 
 
     
@@ -8272,7 +8272,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A group of related documents issued at regular intervals.
     
-    
+
 
 
     
@@ -8283,7 +8283,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A personal communication manifested in some document.
         A personal communication manifested in some document.
     
-    
+
 
 
     
@@ -8297,7 +8297,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A compilation of documents published from an event, such as a conference.
     
-    
+
 
 
     
@@ -8311,7 +8311,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         An excerpted collection of words.
         stable
     
-    
+
 
 
     
@@ -8325,7 +8325,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A document that presents authoritative reference information, such as a dictionary or encylopedia .
     
-    
+
 
 
     
@@ -8351,7 +8351,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A document describing an account or statement describing in detail an event, situation, or the like, usually as the result of observation, inquiry, etc..
         stable
     
-    
+
 
 
     
@@ -8377,7 +8377,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A loose, thematic, collection of Documents, often Books.
         stable
     
-    
+
 
 
     
@@ -8391,7 +8391,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A slide in a slideshow
         unstable
     
-    
+
 
 
     
@@ -8405,7 +8405,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A presentation of a series of slides, usually presented in front of an audience with written text and images.
         stable
     
-    
+
 
 
     
@@ -8419,7 +8419,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         A document describing a standard
     
-    
+
 
 
     
@@ -8433,7 +8433,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A bill enacted into law.
         stable
     
-    
+
 
 
     
@@ -8459,7 +8459,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A document created to summarize research findings associated with the completion of an academic degree.
         stable
     
-    
+
 
 
     
@@ -8474,7 +8474,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         stable
         The academic degree of a Thesis
     
-    
+
 
 
     
@@ -8487,7 +8487,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A web page is an online document available (at least initially) on the world wide web. A web page is written first and foremost to appear on the web, as distinct from other online resources such as books, manuscripts or audio documents which use the web primarily as a distribution mechanism alongside other more traditional methods such as print.
     
-    
+
 
 
     
@@ -8507,7 +8507,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         unstable
         A group of Webpages accessible on the Web.
     
-    
+
 
 
     
@@ -8520,7 +8520,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A seminar, discussion group, or the like, that emphasizes zxchange of ideas and the demonstration and application of techniques, skills, etc.
         stable
     
-    
+
 
 
     
@@ -8531,7 +8531,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         A source of information about bibliographic citations, such as Google Scholar, Web of Science or Scopus.
         A source of information about bibliographic citations, such as Google Scholar, Web of Science or Scopus.
     
-    
+
 
 
     
@@ -8542,7 +8542,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         The number of times a work has been cited globally, as determined from a particular bibliographic information source on a particular date.
         The number of times a work has been cited globally, as determined from a particular bibliographic information source on a particular date.
     
-    
+
 
 
     
@@ -8552,7 +8552,7 @@ A study in which an individual acts has his/her own comparison does not fall int
         
         A recommendation on the appropriate treatment and care of people with a specific disease or condition, based on the best available evidence, designed to help healthcare professionals in their work.
     
-    
+
 
 
     
@@ -8565,7 +8565,7 @@ A study in which an individual acts has his/her own comparison does not fall int
 
 has super-classes
     
-    
+
 
 
     
@@ -8575,7 +8575,7 @@ has super-classes
         
         A formal correction to an error introduced by the publisher into a previously published document.
     
-    
+
 
 
     
@@ -8585,7 +8585,7 @@ has super-classes
         
         An abstract that is published as a standalone document or in a journal of abstracts
     
-    
+
 
 
     
@@ -8610,7 +8610,7 @@ has super-classes
         B.A. Bachelor of Arts
         This list may have multiple abbreviations for some degrees.
     
-    
+
 
 
     
@@ -8621,7 +8621,7 @@ has super-classes
         A distinct, usually specialized educational unit within an educational organization.
         Endodontics (department within a College of Dentistry); English (department within a College of Liberal Arts)
     
-    
+
 
 
     
@@ -8631,7 +8631,7 @@ has super-classes
         
         An explicit individual academic term, quarter, or semester rather than the generic fall, spring or summer semester.
     
-    
+
 
 
     
@@ -8641,7 +8641,7 @@ has super-classes
         
         An explicit individual period considered by an academic institution to be its primary academic cycle.
     
-    
+
 
 
     
@@ -8650,7 +8650,7 @@ has super-classes
         Administrator Role
         
     
-    
+
 
 
     
@@ -8659,7 +8659,7 @@ has super-classes
         Advisee Role
         
     
-    
+
 
 
     
@@ -8668,7 +8668,7 @@ has super-classes
         Advising Process
         
     
-    
+
 
 
     
@@ -8708,7 +8708,7 @@ has super-classes
         
         A dual relationship of one person being advised or mentored by another person, typically including start and end dates
     
-    
+
 
 
     
@@ -8717,7 +8717,7 @@ has super-classes
         Advisor Role
         
     
-    
+
 
 
     
@@ -8729,7 +8729,7 @@ has super-classes
         A group of persons or organizations organized for a common purpose.
         Special Libraries Association; Association for Computing Machinery(ACM); American Medical Informatics Association(AMIA)
     
-    
+
 
 
     
@@ -8739,7 +8739,7 @@ has super-classes
         
         A role of attending an Event or EventSeries
     
-    
+
 
 
     
@@ -8748,7 +8748,7 @@ has super-classes
         Attending Process
         
     
-    
+
 
 
     
@@ -8780,7 +8780,7 @@ This class allows for linking an author to a publication while indicating inform
         Contains the authors name, their rank in the publication, and whether or not they are a corresponding author on the publication.
         Currently any abstract name is given to members of this class. This could change in the future.
     
-    
+
 
 
     
@@ -8792,7 +8792,7 @@ This class allows for linking an author to a publication while indicating inform
         An Award or Honor
         Wiley Prize in Biomedical Sciences
     
-    
+
 
 
     
@@ -8839,7 +8839,7 @@ This class allows for linking an author to a publication while indicating inform
         The award bestowed may be represented with the Award class.
         The bestowal of an award, honor, or distinction to a person or person's at a particular time.  
     
-    
+
 
 
     
@@ -8861,7 +8861,7 @@ This class allows for linking an author to a publication while indicating inform
         
         The awarding of a degree by an agent to another agent. It is mostly for academic degrees.
     
-    
+
 
 
     
@@ -8873,7 +8873,7 @@ This class allows for linking an author to a publication while indicating inform
         Library of Congress Blog
         Regularly updated online journal or newsletter by one or more writers, called bloggers, containing articles and commentary of interest to the blogger
     
-    
+
 
 
     
@@ -8890,7 +8890,7 @@ This class allows for linking an author to a publication while indicating inform
         A specific blog posting
         An online article or commentary appearing on a blog
     
-    
+
 
 
     
@@ -8914,7 +8914,7 @@ This class allows for linking an author to a publication while indicating inform
         Enter building name. If the building's name is a number (as in many governmental organizations such as national laboratories and military bases), then enter it. Do not confuse with the number that appears in a postal address.
         Martha Van Rensselaer Hall (VR); Caldwell Hall (CD); University Auditorium
     
-    
+
 
 
     
@@ -8926,7 +8926,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition taken from dictionary.com (http://dictionary.reference.com/browse/campus).
         The grounds of a school, college, university, or hospital. Or, a large, usually suburban, landscaped business or industrial site.
     
-    
+
 
 
     
@@ -8937,7 +8937,7 @@ This class allows for linking an author to a publication while indicating inform
         A form of qualitative descriptive research that is used to study individuals, a small group of participants, or a group as a whole. Medical usage (from MeSH): clinical presentations that may be followed by evaluative studies that eventually lead to a diagnosis. 
         A qualitative descriptive research study of individuals or a group
     
-    
+
 
 
     
@@ -8961,7 +8961,7 @@ This class allows for linking an author to a publication while indicating inform
         NLM Catalog
         Short Definition is the Medical Subject Heading (MeSH) definition 
     
-    
+
 
 
     
@@ -8974,7 +8974,7 @@ This class allows for linking an author to a publication while indicating inform
         An organization where a specified activity is concentrated.
         Short Definition take from http://www.thefreedictionary.com/center.
     
-    
+
 
 
     
@@ -8985,7 +8985,7 @@ This class allows for linking an author to a publication while indicating inform
         A document confirming certain characteristics of a person or organization, usually provided by some form of external review, education, or assessment.
         A document confirming certain characteristics of a person or organization, usually provided by some form of external review, education, or assessment.
     
-    
+
 
 
     
@@ -8996,7 +8996,7 @@ This class allows for linking an author to a publication while indicating inform
         An issued certificate
         see also core:Certificate
     
-    
+
 
 
     
@@ -9008,7 +9008,7 @@ This class allows for linking an author to a publication while indicating inform
         Any organization with a significant clinical function as a matter of course and not just through occasional clinical roles
         In the future we may be able to make this a defined class that would not need to be directly asserted, but the consensus seems to be that some organizations "are" clinical and some "are" research organizations and that the distinction is important enough to warrant the additional class and class assertions
     
-    
+
 
 
     
@@ -9018,7 +9018,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A role of observing or treating patients
     
-    
+
 
 
     
@@ -9028,7 +9028,7 @@ This class allows for linking an author to a publication while indicating inform
         
         Role of co-principal investigator of an Agreement (for example, a grant), who devotes a specified percentage of time and is considered key personnel.
     
-    
+
 
 
     
@@ -9040,7 +9040,7 @@ This class allows for linking an author to a publication while indicating inform
         A primary academic unit within a University or a free-standing higher education organization without graduate degree programs.
         College of Arts & Sciences; Ivy Tech Community College
     
-    
+
 
 
     
@@ -9053,7 +9053,7 @@ This class allows for linking an author to a publication while indicating inform
         Curriculum Steering Committee; PhD Advisory Committee
         There could be many subclasses such as thesis committee or tenure committee, but these may typically be differentiated via the moniker unless distinct properties become important.
     
-    
+
 
 
     
@@ -9065,7 +9065,7 @@ This class allows for linking an author to a publication while indicating inform
         A legally-recognized business organization.
         from Wikipedia: "A company is a form of business organization. It is an association or collection of individual real persons and/or other companies ... This collection, group or association of persons can be made to exist in law and then a company is itself considered a "legal person". The name company arose because, at least originally, it represented or was owned by more than one real or legal person."
     
-    
+
 
 
     
@@ -9077,7 +9077,7 @@ This class allows for linking an author to a publication while indicating inform
         Intel Talent Search; poetry contest
         Not the same as an award or distinction.
     
-    
+
 
 
     
@@ -9093,7 +9093,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A paper presented at a conference; optionally collected into a Proceedings or a special Journal issue
     
-    
+
 
 
     
@@ -9103,7 +9103,7 @@ This class allows for linking an author to a publication while indicating inform
         
         The digital file (or physical equivalent), if available after the conference, vs. the act of attending/presenting: use ConferencePresentation for information about date/time/location/name of the event where the poster was presented
     
-    
+
 
 
     
@@ -9114,7 +9114,7 @@ This class allows for linking an author to a publication while indicating inform
         An organized series of a meeting for consultation or discussion.
         For individual, separate conferences, use conference instead.  core:ConferenceSeries and core:SeminarSeries are very similar.
     
-    
+
 
 
     
@@ -9125,7 +9125,7 @@ This class allows for linking an author to a publication while indicating inform
         A group  of independent organizations working together toward a common goal, under an expressed agreement.
         Committee on Institutional Cooperation (CIC); The Five Colleges of Ohio
     
-    
+
 
 
     
@@ -9137,7 +9137,7 @@ This class allows for linking an author to a publication while indicating inform
         Short Definition take from http://en.wiktionary.org/wiki/continent.
         The seven commonly recognized continents are Africa; Antarctica; Asia; Australia; Europe; North America; South America
     
-    
+
 
 
     
@@ -9183,7 +9183,7 @@ This class allows for linking an author to a publication while indicating inform
         
         An agreement involving specific deliverables and payment
     
-    
+
 
 
     
@@ -9193,7 +9193,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A lab providing services such as training, protocols, or access to instruments or software
     
-    
+
 
 
     
@@ -9205,7 +9205,7 @@ This class allows for linking an author to a publication while indicating inform
         An area of land distinguished by its political autonomy. Politically independent territories.
         Source of the Short Definition: http://www.thefreedictionary.com/country.  This is also the same as geopolitical.owl:self_governing.
     
-    
+
 
 
     
@@ -9217,7 +9217,7 @@ This class allows for linking an author to a publication while indicating inform
         Short Definition modified from the one found here: http://www.thefreedictionary.com/county.
         The largest administrative division of most states or provinces.
     
-    
+
 
 
     
@@ -9234,7 +9234,7 @@ This class allows for linking an author to a publication while indicating inform
         A course as taught in one time period (such as a semester; although note that a course could consist of only one meeting (teaching session)) by one or more instructors, normally but not always for credit. Does not represent either each meeting of the course or the course offering such as Biology 101 taught every semester from 1980 to 2010
         A course as taught in one time period by one or more instructors, normally but not always for credit. Does not represent either each meeting of the course or the course offering such as Biology 101 taught every semester from 1980 to 2010
     
-    
+
 
 
     
@@ -9263,7 +9263,7 @@ This class allows for linking an author to a publication while indicating inform
         An attestation of qualification, competence, or authority issued to an individual by a third party with a relevant or  de facto authority or assumed competence to do so.
         An attestation of qualification, competence, or authority issued to an individual by a third party with a relevant or  de facto authority or assumed competence to do so.
     
-    
+
 
 
     
@@ -9281,7 +9281,7 @@ This class allows for linking an author to a publication while indicating inform
         PubMed
         Short Definition is the Medical Subject Heading (MeSH) definition
     
-    
+
 
 
     
@@ -9298,7 +9298,7 @@ This class allows for linking an author to a publication while indicating inform
         A named collection of data, usually containing only one type of data
         US Patent Data; US Job Data
     
-    
+
 
 
     
@@ -9308,7 +9308,7 @@ This class allows for linking an author to a publication while indicating inform
         
         a specific period or duration, defined by (optional) start and end date/times.
     
-    
+
 
 
     
@@ -9318,7 +9318,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A date and/or time
     
-    
+
 
 
     
@@ -9328,7 +9328,7 @@ This class allows for linking an author to a publication while indicating inform
         
         Indicates the precision of the value of a DateTimeValue instance.
     
-    
+
 
 
     
@@ -9340,7 +9340,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition modified from the definition here: http://dictionary.reference.com/browse/department. It is difficult to tell the difference between and department and a division.
         Legal (department within a company); Use for any non-academic department
     
-    
+
 
 
     
@@ -9352,7 +9352,7 @@ This class allows for linking an author to a publication while indicating inform
         Cardiovascular Medicine (division within medicine)
         Definition modified from http://www.thefreedictionary.com/division.  It is difficult to tell the difference between a division and a department.
     
-    
+
 
 
     
@@ -9363,7 +9363,7 @@ This class allows for linking an author to a publication while indicating inform
         An ongoing editorial responsibility for a bibo:Collection, such as a Journal or Series
         An ongoing editorial responsibility for a bibo:Collection, such as a Journal or Series
     
-    
+
 
 
     
@@ -9373,7 +9373,7 @@ This class allows for linking an author to a publication while indicating inform
         
         An article of opinion, typically published in a newspaper. For academics, most commonly Op Ed pieces
     
-    
+
 
 
     
@@ -9395,7 +9395,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A relationship that represents the recognition of an agent as an editor.
     
-    
+
 
 
     
@@ -9419,7 +9419,7 @@ This class allows for linking an author to a publication while indicating inform
         Represents educational training that has been received.
         This connects person to their academic degree through this educational training, but can also be used when the training does not result in a degree.
     
-    
+
 
 
     
@@ -9429,7 +9429,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A retired faculty member who has retained their rank, title and privileges.
     
-    
+
 
 
     
@@ -9439,7 +9439,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A retired librarian who has retained their rank, title and privileges.
     
-    
+
 
 
     
@@ -9450,7 +9450,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A retired professor who has retained their rank, title and privileges.
     
-    
+
 
 
     
@@ -9468,7 +9468,7 @@ This class allows for linking an author to a publication while indicating inform
         A physical object provided for specific purpose, task or occupation. 
         server; Bruker Vector-33 FT-IR
     
-    
+
 
 
     
@@ -9504,7 +9504,7 @@ This class allows for linking an author to a publication while indicating inform
         Only use if no specific subclasses of core:EventSeries desribe the activity.
         Two or more events that occur at different times and are connected to each other.
     
-    
+
 
 
     
@@ -9514,7 +9514,7 @@ This class allows for linking an author to a publication while indicating inform
         
         The showing of an object or a collection of objects, in an organized manner.
     
-    
+
 
 
     
@@ -9526,7 +9526,7 @@ This class allows for linking an author to a publication while indicating inform
         A unit devoted primarily to extension activities, whether for outreach or research.
         Alachua County Extension Office
     
-    
+
 
 
     
@@ -9536,7 +9536,7 @@ This class allows for linking an author to a publication while indicating inform
         
         F1000 is a place where faculty go to critique papers published in PubMed. Any given record in F1000 might have anywhere from one to dozens of reviews.
     
-    
+
 
 
     
@@ -9560,7 +9560,7 @@ This class allows for linking an author to a publication while indicating inform
         Something designed, built, installed, etc., to serve a specific function or activity affording a convenience or service.
         Use subclasses of core:Facility subclasses instead of this class if possible
     
-    
+
 
 
     
@@ -9572,7 +9572,7 @@ This class allows for linking an author to a publication while indicating inform
         Associate Dean
         That is a position held by an academic faculty member who works for administration.
     
-    
+
 
 
     
@@ -9583,7 +9583,7 @@ This class allows for linking an author to a publication while indicating inform
         A person with at least one academic appointment to a specific faculty of a university or institution of higher learning.
         Definition from here: http://research.carleton.ca/htr/defs.php.
     
-    
+
 
 
     
@@ -9593,7 +9593,7 @@ This class allows for linking an author to a publication while indicating inform
         
         An advisory relationship in which one faculty member mentors another faculty member.
     
-    
+
 
 
     
@@ -9605,7 +9605,7 @@ This class allows for linking an author to a publication while indicating inform
         Professor, associate professor and assistant professor are common positions for academic faculty.
         Professor; Associate Professor; Assistant Professor
     
-    
+
 
 
     
@@ -9617,7 +9617,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition take from: http://dictionary.reference.com/browse/foundation.
         The Ford Foundation
     
-    
+
 
 
     
@@ -9635,7 +9635,7 @@ This class allows for linking an author to a publication while indicating inform
         An organization that provides financial support to individuals or organizations to carry out specified activities.
         National Institute of Health (NIH)
     
-    
+
 
 
     
@@ -9659,7 +9659,7 @@ This class allows for linking an author to a publication while indicating inform
         Removed the word "stable" because disputed territories from geopolitical.owl are included. This could imply that the geographic coordinates could change. I've also copied this definition to core:Geographic Location.  I think core:Geographic Location and core:Geographic Region are both the same and only one is needed. There is also geopolitical.owl:geographical_region which further causes confusion.
         Use subclasses of core:Geographic Location subclasses instead of this class if possible.
     
-    
+
 
 
     
@@ -9671,7 +9671,7 @@ This class allows for linking an author to a publication while indicating inform
         Removed the word "stable" because disputed territories from geopolitical.owl are included. This could imply that the geographic coordinates could change. This definition was originally in core:Geographic Location.  I simply copied the definition from there.  I think core:Geographic Location and core:Geographic Region are both the same and only one is needed. There is also geopolitical.owl:geographical_region which further causes confusion.
         Use subclasses of core:Geographic Region subclasses instead of this class if possible.
     
-    
+
 
 
     
@@ -9683,7 +9683,7 @@ This class allows for linking an author to a publication while indicating inform
         Short definition obtained here: http://en.wiktionary.org/wiki/geopolitical_entity.
         Use subclasses of core:GeopoliticalEntity subclasses instead of this class if possible.
     
-    
+
 
 
     
@@ -9695,7 +9695,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition take from: http://en.wikipedia.org/wiki/Government_agency.
         United States Library of Congress
     
-    
+
 
 
     
@@ -9705,7 +9705,7 @@ This class allows for linking an author to a publication while indicating inform
         
         An advisory relationship in which a professor advises a graduate student.
     
-    
+
 
 
     
@@ -9715,7 +9715,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A person who has already received a bachelor's degree and is working toward a Master's or Doctoral degree.
     
-    
+
 
 
     
@@ -9763,7 +9763,7 @@ This class allows for linking an author to a publication while indicating inform
         Financial assistance mechanism providing money, property, or both to an eligible entity to carry out an approved project or activity
         Short definition is from the Glossary of NIH Terms.
     
-    
+
 
 
     
@@ -9775,7 +9775,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition take from: http://dictionary.reference.com/browse/hospital.
         Shands at the University of Florida
     
-    
+
 
 
     
@@ -9787,7 +9787,7 @@ This class allows for linking an author to a publication while indicating inform
         An organization founded to pursue or promote certain research, educational or public policy interests or activities.
         Institute for Fundamental Theory
     
-    
+
 
 
     
@@ -9797,7 +9797,7 @@ This class allows for linking an author to a publication while indicating inform
         
         Typically a student or a recent graduate undergoing supervised practical training.
     
-    
+
 
 
     
@@ -9807,7 +9807,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A role in an Agreement (for example, a grant) as a named investigator or key personnel.
     
-    
+
 
 
     
@@ -9816,7 +9816,7 @@ This class allows for linking an author to a publication while indicating inform
         Invited Talk
         
     
-    
+
 
 
     
@@ -9867,7 +9867,7 @@ This class allows for linking an author to a publication while indicating inform
             
         
     
-    
+
 
 
     
@@ -9878,7 +9878,7 @@ This class allows for linking an author to a publication while indicating inform
         An organization unit that facilitates or conduits observation, testing, experimentation, or research in a field of study or practice.
         An organizational unit (as opposed to the physical facility) that performs research, provides services, or processes materials
     
-    
+
 
 
     
@@ -9889,7 +9889,7 @@ This class allows for linking an author to a publication while indicating inform
         A broad-ranging leader concept, from leading a small temporary committee to head of a large international organization.
         A leadership role
     
-    
+
 
 
     
@@ -9899,7 +9899,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A person working in a position of librarian or information professional, or academic or technical expert in support of providing information services or materials.
     
-    
+
 
 
     
@@ -9911,7 +9911,7 @@ This class allows for linking an author to a publication while indicating inform
         It is the common position in libraries.
         Librarian; Library Systems Analyst; Music Bibliographer
     
-    
+
 
 
     
@@ -9923,7 +9923,7 @@ This class allows for linking an author to a publication while indicating inform
         Marston Science Library
         Used information from this definition: http://dictionary.reference.com/browse/library.
     
-    
+
 
 
     
@@ -9934,7 +9934,7 @@ This class allows for linking an author to a publication while indicating inform
         Licenses are usually issued in order to regulate some activity that is deemed to be dangerous or a threat to the person or the public or which involves a high level of specialized skill.  See also core:Licensure.
         Official or legal permission to do something
     
-    
+
 
 
     
@@ -9945,7 +9945,7 @@ This class allows for linking an author to a publication while indicating inform
         A granted license, which gives a 'permission to practice.'
         A granted license, which gives a 'permission to practice.' Such licenses are usually issued in order to regulate some activity that is deemed to be dangerous or a threat to the person or the public or which involves a high level of specialized skill.  See also core:License.
     
-    
+
 
 
     
@@ -9957,7 +9957,7 @@ This class allows for linking an author to a publication while indicating inform
         Top level of all location classes.
         Use subclasses of core:Location when classsifying items.
     
-    
+
 
 
     
@@ -9967,7 +9967,7 @@ This class allows for linking an author to a publication while indicating inform
         
         Residency is a stage of graduate medical training. 
     
-    
+
 
 
     
@@ -9977,7 +9977,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A gathering of people for a defined purpose, not necessarily public or announced
     
-    
+
 
 
     
@@ -9987,7 +9987,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A role of being a member in a Process or an Organization
     
-    
+
 
 
     
@@ -9999,7 +9999,7 @@ This class allows for linking an author to a publication while indicating inform
         Definition was take from here:  http://dictionary.reference.com/browse/museum
         The Getty Museum
     
-    
+
 
 
     
@@ -10009,7 +10009,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A short written piece focused on an event or announcement of note, having a defined publication time and of less enduring interest than a news feature.
     
-    
+
 
 
     
@@ -10020,7 +10020,7 @@ This class allows for linking an author to a publication while indicating inform
         The Ornithological Newsletter
         Usually issued periodically, prepared by or for a group or institution to present information to a specific audience, often also made available to the press and public
     
-    
+
 
 
     
@@ -10030,7 +10030,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A person holding a position that is not considered to be an academic appointment.
     
-    
+
 
 
     
@@ -10042,7 +10042,7 @@ This class allows for linking an author to a publication while indicating inform
         Accounting & Research Services Assistant; Director of Information Technology
         Staff, support, and other non-academic positions.
     
-    
+
 
 
     
@@ -10052,7 +10052,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A person not considered a faculty member but holding an academic appointment.
     
-    
+
 
 
     
@@ -10064,7 +10064,7 @@ This class allows for linking an author to a publication while indicating inform
         Researcher; Academic Extension Associate; Postdoctoral Associate
         Those positions are held by people who do academic work but do not have faculty positions in universities or institutes.
     
-    
+
 
 
     
@@ -10074,7 +10074,7 @@ This class allows for linking an author to a publication while indicating inform
         
         A role of organizing
     
-    
+
 
 
     
@@ -10083,7 +10083,7 @@ This class allows for linking an author to a publication while indicating inform
         Organizing Process
         
     
-    
+
 
 
     
@@ -10095,7 +10095,7 @@ This class allows for linking an author to a publication while indicating inform
         Communicating Astronomy to the Public
         The example is one outreach role required by US space agency NASA, which is related with one project in NASA. Name of the outreach role should be put here.
     
-    
+
 
 
     
@@ -10108,7 +10108,7 @@ This class allows for linking an author to a publication while indicating inform
 Contents
 [hide]
     
-    
+
 
 
     
@@ -10118,7 +10118,7 @@ Contents
         
         Either city or town - a thickly populated area having fixed boundaries and certain local powers of government.
     
-    
+
 
 
     
@@ -10154,7 +10154,7 @@ Contents
         Director of Admissions and Placement; Associate University Librarian
         Particular position in an organization, commonly identified by job title, and normally associated with a job description that details the tasks and responsibilities that go with the position.
     
-    
+
 
 
     
@@ -10164,7 +10164,7 @@ Contents
         
         A Person holding an academic employment appointment focused on research rather than teaching; temporary (or for some defined term)
     
-    
+
 
 
     
@@ -10174,7 +10174,7 @@ Contents
         
         An advisory relationship in which the advisee is a Postdoc or Fellow.
     
-    
+
 
 
     
@@ -10184,7 +10184,7 @@ Contents
         
         A postdoctoral training appointment (job)
     
-    
+
 
 
     
@@ -10194,7 +10194,7 @@ Contents
         
         Postdoctoral research is academic or scholarly research conducted by a person who has completed his or her doctoral studies, normally within the following five years. It is intended to further deepen expertise in a specialist subject.
     
-    
+
 
 
     
@@ -10204,7 +10204,7 @@ Contents
         
         Encompasses talk, speech, lecture, slide lecture, conference presentation
     
-    
+
 
 
     
@@ -10215,7 +10215,7 @@ Contents
         A role of presenting information
         Are we assuming that a PresenterRole is in a Presentation?  Or could you have a PresenterRole in, say, a committee?
     
-    
+
 
 
     
@@ -10224,7 +10224,7 @@ Contents
         Presenting Process
         
     
-    
+
 
 
     
@@ -10235,7 +10235,7 @@ Contents
         A position designated as primary by the organization or group where it is held. This designation may be applied to zero or more of an agent's positions and may be asserted in conjunction with other subclasses of position.
         A position designated as primary by the organization where it is held.
     
-    
+
 
 
     
@@ -10245,7 +10245,7 @@ Contents
         
         Role of a person to direct a project or activity being supported by an Agreement (for example, a grant), and who is accountable to the grantee for the proper conduct of the project or activity. Also known as Program Director or Project Director.
     
-    
+
 
 
     
@@ -10257,7 +10257,7 @@ Contents
         Definition obtained here: http://answers.ask.com/Business/Finance/what_is_a_private_company.  Examples of private companies found here: http://www.forbes.com/2008/11/03/largest-private-companies-biz-privates08-cx_sr_1103private_land.html
         Publix Super Markets; Ernst & Young; PricewaterhouseCoopers
     
-    
+
 
 
     
@@ -10268,7 +10268,7 @@ Contents
         A Cornell graduate field (http://vivo.cornell.edu/index.jsp?home=65535&collection=820)
         An ongoing academic initiative not formalized with department or division status.
     
-    
+
 
 
     
@@ -10298,7 +10298,7 @@ Contents
         An endeavor, frequently collaborative, that occurs over a finite period of time and is intended to achieve a particular aim.
 
     
-    
+
 
 
     
@@ -10310,7 +10310,7 @@ Contents
         Definition found here: http://dictionary.reference.com/browse/publisher
         Elsevier; Harper & Row; Indiana University Press
     
-    
+
 
 
     
@@ -10321,7 +10321,7 @@ Contents
         a reified relationship
         functions as an n-ary predicate
     
-    
+
 
 
     
@@ -10331,7 +10331,7 @@ Contents
         
         Any organization (likely also asserted as another class of Organization) with a primary, ongoing research function, not just through occasional roles
     
-    
+
 
 
     
@@ -10341,7 +10341,7 @@ Contents
         
         A proposal for a research grant that has been submitted but not approved; does not represent an existing activity
     
-    
+
 
 
     
@@ -10352,7 +10352,7 @@ Contents
         A role of conducting funded or unfunded research,  sometimes linked to an Agreement.
         Examples of research can be seen at: http://www.ufl.edu/research/products/index.html.  Note these may have been funded, but the research doesn't have to be funded.  Also, the research may be linked to an Agreement (for example, a Grant), but does not need to be.
     
-    
+
 
 
     
@@ -10362,7 +10362,7 @@ Contents
         
         An article reviewing one or more other information resources (a book, one or more other articles, movies, etc)
     
-    
+
 
 
     
@@ -10373,7 +10373,7 @@ Contents
         A role that encompasses both ongoing reviewer responsibility for a bibo:Collection, such as a Journal or Series, and also a review performed for a bibo:Document, such as a book, academic article or conference paper.
         A role that encompasses both ongoing reviewer responsibility for a bibo:Collection, such as a Journal or Series, and also a review performed for a bibo:Document, such as a book, academic article or conference paper.
     
-    
+
 
 
     
@@ -10391,7 +10391,7 @@ Contents
         Enter room number of name.
         Room that provides a particular service or is used for a particular activity.
     
-    
+
 
 
     
@@ -10403,7 +10403,7 @@ Contents
         Definition take from here: http://dictionary.reference.com/browse/school.
         School of Architecture; School of Music
     
-    
+
 
 
     
@@ -10413,7 +10413,7 @@ Contents
         
         Written musical composition for voice or instruments or both
     
-    
+
 
 
     
@@ -10423,7 +10423,7 @@ Contents
         
         Written script for a film production, including dialogue and descriptions of gestures, actions, shooting directions
     
-    
+
 
 
     
@@ -10435,7 +10435,7 @@ Contents
         Applied Microeconomics Seminars; Future of Rural New York Seminar Series
         For individual seminars, use seminar instead.  core:ConferenceSeries and core:SeminarSeries are very similar.
     
-    
+
 
 
     
@@ -10446,7 +10446,7 @@ Contents
         A laboratory that provides services
         Ideally a defined class -- a Laboratory the provides some Service via the property
     
-    
+
 
 
     
@@ -10456,7 +10456,7 @@ Contents
         
         Text of a speech written in preparation for delivery of the speech.
     
-    
+
 
 
     
@@ -10468,7 +10468,7 @@ Contents
         One of a number of areas or communities having their own governments and forming a federation under a sovereign government, as in the US.
         Source of the Short Definition: http://www.thefreedictionary.com/state.
     
-    
+
 
 
     
@@ -10479,7 +10479,7 @@ Contents
         A person who is enrolled in an educational institution.
         Use only if no specific subclasses of core:Student describe the person.
     
-    
+
 
 
     
@@ -10491,7 +10491,7 @@ Contents
         Dancin' Gators
         Definition take from here: http://en.wikipedia.org/wiki/Student_society
     
-    
+
 
 
     
@@ -10504,7 +10504,7 @@ Contents
         Short definition was partially taken from http://en.wikipedia.org/wiki/Subnational_entity.
         Smaller administrative division into which a country may be divided.
     
-    
+
 
 
     
@@ -10514,7 +10514,7 @@ Contents
         
         A role of serving as an educator
     
-    
+
 
 
     
@@ -10526,7 +10526,7 @@ Contents
         An informal organization brought together for the purposes of a project or event
         VIVO Outreach Team; VIVO Ontology Team
     
-    
+
 
 
     
@@ -10536,7 +10536,7 @@ Contents
         
         The result of rendering a work from one language to another
     
-    
+
 
 
     
@@ -10546,7 +10546,7 @@ Contents
         
         An advisory relationship in which a professor advises an undergraduate student.
     
-    
+
 
 
     
@@ -10556,7 +10556,7 @@ Contents
         
         A person registered in an undergraduate program leading to a bachelor's degree or an undergraduate diploma or certificate.
     
-    
+
 
 
     
@@ -10568,7 +10568,7 @@ Contents
         Definition taken from: http://en.wikipedia.org/wiki/University
         University of Florida; Washington University in St. Louis
     
-    
+
 
 
     
@@ -10578,7 +10578,7 @@ Contents
         
         Audiovisual recording in video format
     
-    
+
 
 
     
@@ -10594,7 +10594,7 @@ Contents
         
         A document created as a basis for discussion or a very early draft of a formal paper
     
-    
+
 
 
     
@@ -10605,7 +10605,7 @@ Contents
         An organized series of workshop events, whether repetitions of the same workshop or multiple different workshops.
         Use workshop for individual events.
     
-    
+
 
 
     
@@ -10616,7 +10616,7 @@ Contents
         Phase 0 Clinical Trial
         Phase 0 is a recent designation for exploratory, first-in-human trials  conducted in accordance with the United States Food and Drug Administration's (FDA) 2006 Guidance on Exploratory Investigational New Drug (IND) Studies.  Phase 0 trials are also known as human microdosing  studies and are designed to speed up the development of promising drugs or imaging agents by establishing very early on whether the drug or agent behaves in human subjects as was expected from preclinical studies.
     
-    
+
 
 
     
@@ -10627,7 +10627,7 @@ Contents
         In Phase I trials, researchers test an experimental drug or treatment in a small group of people (20-80) for the first time to evaluate its safety, determine a safe dosage range, and identify side effects
         Phase 1 Clinical Trial
     
-    
+
 
 
     
@@ -10638,7 +10638,7 @@ Contents
         In Phase 2 trials, an experimental study drug or treatment is given to a larger group of people (100-300) to see if it is effective and to further evaluate its safety.
         Phase 2 Clinical Trial
     
-    
+
 
 
     
@@ -10650,7 +10650,7 @@ Contents
 
         Phase 3 Clinical Trial
     
-    
+
 
 
     
@@ -10661,7 +10661,7 @@ Contents
         In Phase 4 trials, post marketing studies delineate additional information including the drug's or treatment's risks, benefits, and optimal use.
         Phase 4 Clinical Trial
     
-    
+
 
 
     
@@ -10669,7 +10669,7 @@ Contents
     
         
     
-    
+
 
 
     
@@ -10677,7 +10677,7 @@ Contents
     
         
     
-    
+
 
 
     
@@ -10685,7 +10685,7 @@ Contents
     
         
     
-    
+
 
 
     
@@ -10693,7 +10693,7 @@ Contents
     
         
     
-    
+
 
 
     
@@ -10701,7 +10701,7 @@ Contents
     
         Concept
     
-    
+
 
 
     
@@ -10710,7 +10710,7 @@ Contents
         Acquaintance
         
     
-    
+
 
 
     
@@ -10786,7 +10786,7 @@ Contents
         
         To specify the components of the delivery address for the vCard object
     
-    
+
 
 
     
@@ -10849,7 +10849,7 @@ Contents
         
         These types are concerned with information related to the delivery addressing or label for the vCard object
     
-    
+
 
 
     
@@ -10858,7 +10858,7 @@ Contents
         Agent
         
     
-    
+
 
 
     
@@ -10896,7 +10896,7 @@ Contents
             
         
     
-    
+
 
 
     
@@ -10921,7 +10921,7 @@ Contents
         To specify the URI for the busy time associated with the object that the vCard represents.
 Was called FBURI in vCard
     
-    
+
 
 
     
@@ -10946,7 +10946,7 @@ Was called FBURI in vCard
         To specify the URI for a calendar associated with the object represented by the vCard.
 Was called CALURI in vCard.
     
-    
+
 
 
     
@@ -10968,10 +10968,10 @@ Was called CALURI in vCard.
             
         
         
-        To specify the calendar user address [RFC5545] to which a scheduling request [RFC5546] should be sent for the object represented by the vCard. 
+        To specify the calendar user address [RFC5545] to which a scheduling request [RFC5546] should be sent for the object represented by the vCard.
 Was called CALADRURI in vCard
     
-    
+
 
 
     
@@ -10995,7 +10995,7 @@ Was called CALADRURI in vCard
         
         To specify application category information about the vCard, also known as tags. This was called CATEGORIES in vCard.
     
-    
+
 
 
     
@@ -11005,7 +11005,7 @@ Was called CALADRURI in vCard
         
         Also called mobile telephone
     
-    
+
 
 
     
@@ -11014,7 +11014,7 @@ Was called CALADRURI in vCard
         Child
         
     
-    
+
 
 
     
@@ -11023,7 +11023,7 @@ Was called CALADRURI in vCard
         Code
         Contains all the Code related Classes that are used to indicate vCard Types
     
-    
+
 
 
     
@@ -11032,7 +11032,7 @@ Was called CALADRURI in vCard
         Colleague
         
     
-    
+
 
 
     
@@ -11095,7 +11095,7 @@ Was called CALADRURI in vCard
         
         These properties describe information about how to communicate with the object the vCard represents
     
-    
+
 
 
     
@@ -11104,7 +11104,7 @@ Was called CALADRURI in vCard
         Contact
         
     
-    
+
 
 
     
@@ -11113,7 +11113,7 @@ Was called CALADRURI in vCard
         Coresident
         
     
-    
+
 
 
     
@@ -11122,7 +11122,7 @@ Was called CALADRURI in vCard
         Coworker
         
     
-    
+
 
 
     
@@ -11131,7 +11131,7 @@ Was called CALADRURI in vCard
         Crush
         
     
-    
+
 
 
     
@@ -11140,7 +11140,7 @@ Was called CALADRURI in vCard
         Date
         
     
-    
+
 
 
     
@@ -11164,7 +11164,7 @@ Was called CALADRURI in vCard
         
         To specify the electronic mail address for communication with the object the vCard represents
     
-    
+
 
 
     
@@ -11173,7 +11173,7 @@ Was called CALADRURI in vCard
         Emergency
         
     
-    
+
 
 
     
@@ -11236,7 +11236,7 @@ Was called CALADRURI in vCard
         
         These properties are concerned with additional explanations, such as that related to informational notes or revisions specific to the  vCard
     
-    
+
 
 
     
@@ -11245,7 +11245,7 @@ Was called CALADRURI in vCard
         Fax
         
     
-    
+
 
 
     
@@ -11254,7 +11254,7 @@ Was called CALADRURI in vCard
         Female
         
     
-    
+
 
 
     
@@ -11278,7 +11278,7 @@ Was called CALADRURI in vCard
         
         Specifies the formatted text corresponding to the name of the object the vCard represents
     
-    
+
 
 
     
@@ -11287,7 +11287,7 @@ Was called CALADRURI in vCard
         Friend
         
     
-    
+
 
 
     
@@ -11296,7 +11296,7 @@ Was called CALADRURI in vCard
         Gender
         
     
-    
+
 
 
     
@@ -11320,7 +11320,7 @@ Was called CALADRURI in vCard
         
         Used to indicate global positioning  information that is specific to an address
     
-    
+
 
 
     
@@ -11343,7 +11343,7 @@ Was called CALADRURI in vCard
         
         These properties are concerned with information associated with  geographical positions or regions associated with the object the vCard represents
     
-    
+
 
 
     
@@ -11367,7 +11367,7 @@ Was called CALADRURI in vCard
         
         Defines all the properties required to be a Group of Individuals or  Organizations
     
-    
+
 
 
     
@@ -11377,7 +11377,7 @@ Was called CALADRURI in vCard
         
         This implies that the property is related to an individual's personal life
     
-    
+
 
 
     
@@ -11440,7 +11440,7 @@ Was called CALADRURI in vCard
         
         These types are used to capture information associated with the identification and naming of the entity associated with the vCard
     
-    
+
 
 
     
@@ -11504,7 +11504,7 @@ Was called CALADRURI in vCard
         
         Defines all the properties required to be an Individual
     
-    
+
 
 
     
@@ -11526,10 +11526,10 @@ Was called CALADRURI in vCard
             
         
         
-        To specify the URI for instant messaging and presence protocol communications with the object the vCard represents. 
+        To specify the URI for instant messaging and presence protocol communications with the object the vCard represents.
 Was called IMPP in vCard.
     
-    
+
 
 
     
@@ -11552,7 +11552,7 @@ Was called IMPP in vCard.
         
         
     
-    
+
 
 
     
@@ -11561,7 +11561,7 @@ Was called IMPP in vCard.
         Kin
         
     
-    
+
 
 
     
@@ -11661,7 +11661,7 @@ Was called IMPP in vCard.
         
         The parent class for all vCard Objects
     
-    
+
 
 
     
@@ -11685,7 +11685,7 @@ Was called IMPP in vCard.
         
         To specify the language(s) that may be used for contacting the entity associated with the vCard.
     
-    
+
 
 
     
@@ -11695,7 +11695,7 @@ Was called IMPP in vCard.
         
         Defines all the properties required to be a Location
     
-    
+
 
 
     
@@ -11719,7 +11719,7 @@ Was called IMPP in vCard.
         
         To specify a graphic image of a logo associated with the  object the vCard represents
     
-    
+
 
 
     
@@ -11728,7 +11728,7 @@ Was called IMPP in vCard.
         Male
         
     
-    
+
 
 
     
@@ -11737,7 +11737,7 @@ Was called IMPP in vCard.
         Me
         
     
-    
+
 
 
     
@@ -11746,7 +11746,7 @@ Was called IMPP in vCard.
         Met
         
     
-    
+
 
 
     
@@ -11755,7 +11755,7 @@ Was called IMPP in vCard.
         Muse
         
     
-    
+
 
 
     
@@ -11831,7 +11831,7 @@ Was called IMPP in vCard.
         
         Specifies the components of the name of the object the  vCard represents
     
-    
+
 
 
     
@@ -11840,7 +11840,7 @@ Was called IMPP in vCard.
         Neighbor
         
     
-    
+
 
 
     
@@ -11864,7 +11864,7 @@ Was called IMPP in vCard.
         
         Specifies the text corresponding to the nickname of the object the vCard represents
     
-    
+
 
 
     
@@ -11873,7 +11873,7 @@ Was called IMPP in vCard.
         None
         
     
-    
+
 
 
     
@@ -11897,7 +11897,7 @@ Was called IMPP in vCard.
         
         To specify supplemental information or a comment that is associated with the vCard
     
-    
+
 
 
     
@@ -11908,7 +11908,7 @@ Was called IMPP in vCard.
         Defines all the properties required to be an  Organization
         To specify the organizational name  associated with the vCard
     
-    
+
 
 
     
@@ -11931,7 +11931,7 @@ Was called IMPP in vCard.
         
         
     
-    
+
 
 
     
@@ -11954,7 +11954,7 @@ Was called IMPP in vCard.
         
         
     
-    
+
 
 
     
@@ -12017,7 +12017,7 @@ Was called IMPP in vCard.
         
         These properties are concerned with information associated with characteristics of the organization or organizational units of the object that the vCard represents
     
-    
+
 
 
     
@@ -12026,7 +12026,7 @@ Was called IMPP in vCard.
         Other
         
     
-    
+
 
 
     
@@ -12035,7 +12035,7 @@ Was called IMPP in vCard.
         Pager
         
     
-    
+
 
 
     
@@ -12044,7 +12044,7 @@ Was called IMPP in vCard.
         Parent
         
     
-    
+
 
 
     
@@ -12068,7 +12068,7 @@ Was called IMPP in vCard.
         
         Specifies an image or photograph information that annotates some aspect of the object the vCard represents
     
-    
+
 
 
     
@@ -12092,7 +12092,7 @@ Was called IMPP in vCard.
         
         To specify a relationship between another entity and the entity represented by this vCard
     
-    
+
 
 
     
@@ -12101,13 +12101,13 @@ Was called IMPP in vCard.
         Relation Type
         
     
-    
+
 
 
     
 
     
-    
+
 
 
     
@@ -12158,7 +12158,7 @@ Was called IMPP in vCard.
         
         Contains all the Security related Classes
     
-    
+
 
 
     
@@ -12167,7 +12167,7 @@ Was called IMPP in vCard.
         Sibling
         
     
-    
+
 
 
     
@@ -12191,7 +12191,7 @@ Was called IMPP in vCard.
         
         To specify a digital sound content information that annotates some aspect of the vCard.  This property is often used to specify the proper pronunciation of the name property value of the vCard
     
-    
+
 
 
     
@@ -12200,7 +12200,7 @@ Was called IMPP in vCard.
         Spouse
         
     
-    
+
 
 
     
@@ -12209,7 +12209,7 @@ Was called IMPP in vCard.
         Sweetheart
         
     
-    
+
 
 
     
@@ -12232,7 +12232,7 @@ Was called IMPP in vCard.
         
         
     
-    
+
 
 
     
@@ -12241,7 +12241,7 @@ Was called IMPP in vCard.
         Telephone Type
         
     
-    
+
 
 
     
@@ -12251,7 +12251,7 @@ Was called IMPP in vCard.
         
         Also called sms telephone
     
-    
+
 
 
     
@@ -12260,7 +12260,7 @@ Was called IMPP in vCard.
         Text Phone
         
     
-    
+
 
 
     
@@ -12284,7 +12284,7 @@ Was called IMPP in vCard.
         
         Used to indicate time zone information that is specific to a location or address
     
-    
+
 
 
     
@@ -12308,7 +12308,7 @@ Was called IMPP in vCard.
         
         To specify the position or job of the object the vCard represents
     
-    
+
 
 
     
@@ -12318,7 +12318,7 @@ Was called IMPP in vCard.
         
         This is called TYPE in vCard but renamed here to Context for less confusion (with types/class)
     
-    
+
 
 
     
@@ -12342,7 +12342,7 @@ Was called IMPP in vCard.
         
         To specify a uniform resource locator associated with the object to which the vCard refers.  Examples for individuals include personal web sites, blogs, and social networking site  identifiers. 
     
-    
+
 
 
     
@@ -12351,7 +12351,7 @@ Was called IMPP in vCard.
         Unknown
         
     
-    
+
 
 
     
@@ -12360,7 +12360,7 @@ Was called IMPP in vCard.
         Video
         
     
-    
+
 
 
     
@@ -12369,7 +12369,7 @@ Was called IMPP in vCard.
         Voice
         
     
-    
+
 
 
     
@@ -12379,7 +12379,7 @@ Was called IMPP in vCard.
         
         This implies that the property is related to an individual's work place
     
-    
+
 
 
     
@@ -12414,7 +12414,7 @@ Was called IMPP in vCard.
         see: http://xmlns.com/foaf/spec/#term_Agent
         Used to describe any "agent" related to bibliographic items. Such agents can be persons, organizations or groups of any kind.
     
-    
+
 
 
     
@@ -12431,7 +12431,7 @@ see: http://xmlns.com/foaf/spec/#term_Group
         PERSON: Scott Hoffmann
         group
     
-    
+
 
 
     
@@ -12479,7 +12479,7 @@ see: http://xmlns.com/foaf/spec/#term_Group
         organization
         Ued to describe an organization related to bibliographic items such as a publishing company, etc.
     
-    
+
 
 
     
@@ -12525,12 +12525,12 @@ see: http://xmlns.com/foaf/spec/#term_Group
         person
     
 
-    
-    
+
+
     
         1
     
-    
+
 
 
 
diff --git a/home/src/main/resources/rdf/tbox/firsttime/vitroAnnotations.n3 b/home/src/main/resources/rdf/tbox/firsttime/vitroAnnotations.n3
index c23d014e..9651b025 100644
--- a/home/src/main/resources/rdf/tbox/firsttime/vitroAnnotations.n3
+++ b/home/src/main/resources/rdf/tbox/firsttime/vitroAnnotations.n3
@@ -32,7 +32,7 @@
 
       rdfs:label "SKOS (Simple Knowledge Organization System)"@en-US ;
       vitro:ontologyPrefixAnnot "skos" .
-      
+
 
       rdfs:label "VIVO Core Ontology"@en-US ;
       vitro:ontologyPrefixAnnot "vivo" .
@@ -40,35 +40,35 @@
 
       rdfs:label "OCRe Research"@en-US ;
       vitro:ontologyPrefixAnnot "ocrer" .
-      
+
 
       rdfs:label "OCRe Study Design"@en-US ;
       vitro:ontologyPrefixAnnot "ocresd" .
-      
+
 
       rdfs:label "OCRe Study Protocol"@en-US ;
       vitro:ontologyPrefixAnnot "ocresp" .
-      
+
 
       rdfs:label "OCRe Statistics"@en-US ;
       vitro:ontologyPrefixAnnot "ocresst" .
-      
+
 
       rdfs:label "Geopolitical Ontology"@en-US ;
       vitro:ontologyPrefixAnnot "geo" .
-      
+
 
       rdfs:label "Event Ontology"@en-US ;
       vitro:ontologyPrefixAnnot "event" .
 
-  
+
       rdfs:label "OBO Foundry"@en-US ;
       vitro:ontologyPrefixAnnot "obo" .
-              
+
 
       rdfs:label "VCard"@en-US ;
       vitro:ontologyPrefixAnnot "vcard" .
-              
+
 
       rdfs:label "FOAF (Friend of a Friend)"@en-US ;
       vitro:ontologyPrefixAnnot "foaf" .
@@ -88,22 +88,22 @@
 
       rdfs:label "CiTO (Citation Typing Ontology)"@en-US ;
       vitro:ontologyPrefixAnnot "cito" .
-    
+
 
       rdfs:label "Dublin Core Terms"@en-US ;
-      vitro:ontologyPrefixAnnot "dcterms" .  
-    
+      vitro:ontologyPrefixAnnot "dcterms" .
+
 
       rdfs:label "Vocabulary for Annotating Vocabulary Descriptions"@en-US ;
       vitro:ontologyPrefixAnnot "vann" .
-      
+
 
       rdfs:label "Relations Ontology"@en-US ;
-      vitro:ontologyPrefixAnnot "ro" .    
-      
+      vitro:ontologyPrefixAnnot "ro" .
+
 
       rdfs:label "Software Ontology"@en-US ;
-      vitro:ontologyPrefixAnnot "swo" . 
+      vitro:ontologyPrefixAnnot "swo" .
 
 vivo:pmcid
       vitro:hiddenFromDisplayBelowRoleLevelAnnot
@@ -2512,7 +2512,7 @@ obo:ERO_0000044
                ;
       vitro:inPropertyGroupAnnot
                .
-              
+
 obo:ERO_0001261
       vitro:inClassGroup  .
 
@@ -2670,7 +2670,7 @@ obo:ERO_0000045
                ;
       vitro:inPropertyGroupAnnot
                .
- 
+
 vivo:Division
       vitro:displayLimitAnnot
               "-1"^^xsd:int ;
@@ -4642,7 +4642,7 @@ obo:ERO_0000482 # deprecated
 #              "true"^^xsd:boolean ;
 #      vitro:inPropertyGroupAnnot
 #               .
-              
+
 vivo:ResearchProposal
       vitro:displayLimitAnnot
               "-1"^^xsd:int ;
@@ -5323,7 +5323,7 @@ geo:agriculturalAreaYear
       vitro:prohibitedFromUpdateBelowRoleLevelAnnot
                .
 
-        
+
 vivo:providesFundingThrough
       vitro:displayLimitAnnot
               "5"^^xsd:int ;
@@ -6188,7 +6188,7 @@ obo:ERO_0000033
               "true"^^xsd:boolean ;
       vitro:inPropertyGroupAnnot
                .
-              
+
 obo:ERO_0000397
       vitro:displayLimitAnnot
               "5"^^xsd:int ;
@@ -7376,7 +7376,7 @@ obo:ERO_0000919
               "true"^^xsd:boolean ;
       vitro:offerCreateNewOptionAnnot
               "true"^^xsd:boolean .
-              
+
 bibo:status
       vitro:displayLimitAnnot
               "5"^^xsd:int ;
@@ -7460,7 +7460,7 @@ geo:validUntil
       vitro:hiddenFromPublishBelowRoleLevelAnnot
                .
 
- 
+
 vivo:hasEquipment
       vitro:displayRankAnnot
               "80"^^xsd:int ;
@@ -7518,37 +7518,37 @@ vivo:hasEquipment
       vitro:displayRankAnnot
               "1"^^xsd:int .
 
- 
-      vitro:hiddenFromDisplayBelowRoleLevelAnnot 
-               ;
-      vitro:prohibitedFromUpdateBelowRoleLevelAnnot
-               .
-
- 
-      vitro:hiddenFromDisplayBelowRoleLevelAnnot
-               ;
-      vitro:prohibitedFromUpdateBelowRoleLevelAnnot 
-               .
-  
-vivo:relates 
+
       vitro:hiddenFromDisplayBelowRoleLevelAnnot
                ;
       vitro:prohibitedFromUpdateBelowRoleLevelAnnot
                .
 
-vivo:relatedBy 
+
       vitro:hiddenFromDisplayBelowRoleLevelAnnot
                ;
       vitro:prohibitedFromUpdateBelowRoleLevelAnnot
                .
 
-vivo:assigns 
+vivo:relates
       vitro:hiddenFromDisplayBelowRoleLevelAnnot
                ;
-      vitro:prohibitedFromUpdateBelowRoleLevelAnnot 
+      vitro:prohibitedFromUpdateBelowRoleLevelAnnot
                .
 
-vivo:assignedBy 
+vivo:relatedBy
+      vitro:hiddenFromDisplayBelowRoleLevelAnnot
+               ;
+      vitro:prohibitedFromUpdateBelowRoleLevelAnnot
+               .
+
+vivo:assigns
+      vitro:hiddenFromDisplayBelowRoleLevelAnnot
+               ;
+      vitro:prohibitedFromUpdateBelowRoleLevelAnnot
+               .
+
+vivo:assignedBy
       vitro:hiddenFromDisplayBelowRoleLevelAnnot
                ;
       vitro:prohibitedFromUpdateBelowRoleLevelAnnot
diff --git a/installer/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf b/installer/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
index 4435ddc4..e582f049 100644
--- a/installer/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
+++ b/installer/home/src/main/resources/rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
@@ -3,7 +3,7 @@
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:j.0="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
     
         
         VIVO
diff --git a/installer/solr/src/main/webResources/WEB-INF/classes/log4j.properties b/installer/solr/src/main/webResources/WEB-INF/classes/log4j.properties
index 89f1b437..b8307c2b 100644
--- a/installer/solr/src/main/webResources/WEB-INF/classes/log4j.properties
+++ b/installer/solr/src/main/webResources/WEB-INF/classes/log4j.properties
@@ -1,11 +1,11 @@
-log4j.appender.AllAppender=org.apache.log4j.RollingFileAppender 
+log4j.appender.AllAppender=org.apache.log4j.RollingFileAppender
 log4j.appender.AllAppender.File= ${catalina.base}/logs/${app-name}solr.log
-log4j.appender.AllAppender.MaxFileSize=10MB 
-log4j.appender.AllAppender.MaxBackupIndex=10 
-log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout 
+log4j.appender.AllAppender.MaxFileSize=10MB
+log4j.appender.AllAppender.MaxBackupIndex=10
+log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout
 log4j.appender.AllAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{1}] %m%n
 
-log4j.rootLogger=INFO, AllAppender 
+log4j.rootLogger=INFO, AllAppender
 
 # Make all of the Solr classes quieter...
 log4j.logger.org.apache.solr.level = WARNING
diff --git a/installer/webapp/src/main/webapp/local/css/local.css b/installer/webapp/src/main/webapp/local/css/local.css
index 4a441c96..b12c01cc 100644
--- a/installer/webapp/src/main/webapp/local/css/local.css
+++ b/installer/webapp/src/main/webapp/local/css/local.css
@@ -2,4 +2,4 @@
     Override theme CSS styles by placing them in this file
 
     Note - all themes must include <../../..>/local/css/local.css as the last import.
-*/
\ No newline at end of file
+*/
diff --git a/legacy/config/licenser/licenser.properties b/legacy/config/licenser/licenser.properties
index ead4e62f..6cb86917 100644
--- a/legacy/config/licenser/licenser.properties
+++ b/legacy/config/licenser/licenser.properties
@@ -1,34 +1,34 @@
-# --------------------------------------------------------------------------
-#  Properties for running the licenser utility in VIVO.
-# --------------------------------------------------------------------------
-  
-# The path to the top level directory to be scanned or copied
-# (if relative, then relative to this file)
-source_dir = ../../
-
-# The path to the top level directory to copy into (ignored if only scanning)
-# (if relative, then relative to this file)
-target_dir = 
-
-# A list of filename globs that match the files we want to license,
-# delimited by commas with optional white-space.
-file_matchers = *.java, *.jsp, *.tld, *.xsl, *.xslt, *.css, *.js, *.ftl, *.xml
-
-# "globs" that describe paths that we won't follow for scanning OR FOR COPYING.
-# (relative to the source_dir)
-skip_directories = ./bin, ./.svn, ./**/.svn, ./.build, ./vitro-core
-
-# The path to a file containing filename/path globs that match the files that 
-# we know should have no license tags in them. 
-# The file contains one glob per line; blank lines and comments ("#") are ignored. 
-# (if relative, then relative to the source directory)
-known_exceptions = config/licenser/known_exceptions.txt
-
-# The path to the text of the license agreement (ignored if only scanning)
-# If the agreement contains a ${year} token, the current year will be substituted.
-# (if relative, then relative to the source directory)
-license_file = doc/license.txt
-
-# Set to 'full' for a full report, 'short' for a brief statment, or to anything
-# else for a medium-length summary.
-report_level = short
+# --------------------------------------------------------------------------
+#  Properties for running the licenser utility in VIVO.
+# --------------------------------------------------------------------------
+
+# The path to the top level directory to be scanned or copied
+# (if relative, then relative to this file)
+source_dir = ../../
+
+# The path to the top level directory to copy into (ignored if only scanning)
+# (if relative, then relative to this file)
+target_dir =
+
+# A list of filename globs that match the files we want to license,
+# delimited by commas with optional white-space.
+file_matchers = *.java, *.jsp, *.tld, *.xsl, *.xslt, *.css, *.js, *.ftl, *.xml
+
+# "globs" that describe paths that we won't follow for scanning OR FOR COPYING.
+# (relative to the source_dir)
+skip_directories = ./bin, ./.svn, ./**/.svn, ./.build, ./vitro-core
+
+# The path to a file containing filename/path globs that match the files that
+# we know should have no license tags in them.
+# The file contains one glob per line; blank lines and comments ("#") are ignored.
+# (if relative, then relative to the source directory)
+known_exceptions = config/licenser/known_exceptions.txt
+
+# The path to the text of the license agreement (ignored if only scanning)
+# If the agreement contains a ${year} token, the current year will be substituted.
+# (if relative, then relative to the source directory)
+license_file = doc/license.txt
+
+# Set to 'full' for a full report, 'short' for a brief statment, or to anything
+# else for a medium-length summary.
+report_level = short
diff --git a/legacy/example.build.properties b/legacy/example.build.properties
index dce8c9da..bfd56ace 100644
--- a/legacy/example.build.properties
+++ b/legacy/example.build.properties
@@ -1,56 +1,56 @@
-# -----------------------------------------------------------------------------
-#
-# VIVO build properties
-#
-# This file is provided as example.build.properties.
-#
-# Save a copy of this file as build.properties, and edit the properties as 
-# needed for your deployment.
-#
-# -----------------------------------------------------------------------------
-
-
-# -----------------------------------------------------------------------------
-# BASIC PROPERTIES
-# -----------------------------------------------------------------------------
-
-  #
-  # Where is the Vitro core directory?
-  # In most deployments, this is set to ./vitro-core (It is not uncommon for this 
-  # setting to point elsewhere in development environments).
-  #   Examples:
-  #      vitro.core.dir = ./vitro-core
-  #      vitro.core.dir = ../Vitro
-  #      vitro.core.dir = /usr/local/vitro/trunk
-vitro.core.dir = ./vitro-core
-
-  #
-  # The base install directory for your Tomcat server. The VIVO application 
-  # will be deployed in the /webapps directory below this base. 
-  #
-tomcat.home = /usr/local/tomcat
-
-  #
-  # The name of the VIVO application. This will be used as the name of the
-  # subdirectory within your Tomcat server's /webapps directory. It also appears
-  # in the URL for the application. For example, http://my.vivo.server/vivo
-  #
-webapp.name = vivo
-
-  #
-  # The location where the VIVO application will store the data that it creates.
-  # This includes uploaded files (usually images) and the search index.
-  #
-vitro.home = /usr/local/vivo/home
-
-
-# -----------------------------------------------------------------------------
-# ADDING LANGUAGES TO VIVO
-# -----------------------------------------------------------------------------
-
-  #
-  # Additional languages to be built into your VIVO site. The locales specified
-  # here must appear as sub-directories of [vivo]/languages in the distribution.
-  # Find more information on the VIVO Wiki (https://wiki.duraspace.org/display/VIVO).
-  #
-#languages.addToBuild = 
+# -----------------------------------------------------------------------------
+#
+# VIVO build properties
+#
+# This file is provided as example.build.properties.
+#
+# Save a copy of this file as build.properties, and edit the properties as
+# needed for your deployment.
+#
+# -----------------------------------------------------------------------------
+
+
+# -----------------------------------------------------------------------------
+# BASIC PROPERTIES
+# -----------------------------------------------------------------------------
+
+  #
+  # Where is the Vitro core directory?
+  # In most deployments, this is set to ./vitro-core (It is not uncommon for this
+  # setting to point elsewhere in development environments).
+  #   Examples:
+  #      vitro.core.dir = ./vitro-core
+  #      vitro.core.dir = ../Vitro
+  #      vitro.core.dir = /usr/local/vitro/trunk
+vitro.core.dir = ./vitro-core
+
+  #
+  # The base install directory for your Tomcat server. The VIVO application
+  # will be deployed in the /webapps directory below this base.
+  #
+tomcat.home = /usr/local/tomcat
+
+  #
+  # The name of the VIVO application. This will be used as the name of the
+  # subdirectory within your Tomcat server's /webapps directory. It also appears
+  # in the URL for the application. For example, http://my.vivo.server/vivo
+  #
+webapp.name = vivo
+
+  #
+  # The location where the VIVO application will store the data that it creates.
+  # This includes uploaded files (usually images) and the search index.
+  #
+vitro.home = /usr/local/vivo/home
+
+
+# -----------------------------------------------------------------------------
+# ADDING LANGUAGES TO VIVO
+# -----------------------------------------------------------------------------
+
+  #
+  # Additional languages to be built into your VIVO site. The locales specified
+  # here must appear as sub-directories of [vivo]/languages in the distribution.
+  # Find more information on the VIVO Wiki (https://wiki.duraspace.org/display/VIVO).
+  #
+#languages.addToBuild =
diff --git a/legacy/languages/es_GO/rdf/display/firsttime/aboutPage_es_GO.n3 b/legacy/languages/es_GO/rdf/display/firsttime/aboutPage_es_GO.n3
index 10d61916..0145c845 100644
--- a/legacy/languages/es_GO/rdf/display/firsttime/aboutPage_es_GO.n3
+++ b/legacy/languages/es_GO/rdf/display/firsttime/aboutPage_es_GO.n3
@@ -1,4 +1,4 @@
-# $This file is distributed under the terms of the license in LICENSE$ 
+# $This file is distributed under the terms of the license in LICENSE$
 
 @prefix about:  .
 
diff --git a/legacy/languages/es_GO/rdf/display/firsttime/menu_es_GO.n3 b/legacy/languages/es_GO/rdf/display/firsttime/menu_es_GO.n3
index 5df58fe9..fe31441a 100644
--- a/legacy/languages/es_GO/rdf/display/firsttime/menu_es_GO.n3
+++ b/legacy/languages/es_GO/rdf/display/firsttime/menu_es_GO.n3
@@ -4,7 +4,7 @@ display:HomeMenuItem display:linkText "Inicio"@es-GO .
 display:PeopleMenuItem display:linkText "Personas"@es-GO .
 display:OrganizationsMenuItem display:linkText "Organizaciones"@es-GO .
 display:ResearchMenuItem display:linkText "Investigación"@es-GO .
-display:EventsMenuItem display:linkText "Eventos"@es-GO . 
+display:EventsMenuItem display:linkText "Eventos"@es-GO .
 display:Home display:title "Inicio"@es-GO .
 display:Events display:title "Eventos"@es-GO .
 display:Organizations display:title "Organizaciones"@es-GO .
diff --git a/legacy/languages/es_GO/templates/freemarker/aboutMapOfScience_es_GO.ftl b/legacy/languages/es_GO/templates/freemarker/aboutMapOfScience_es_GO.ftl
index 244b16d7..75470475 100644
--- a/legacy/languages/es_GO/templates/freemarker/aboutMapOfScience_es_GO.ftl
+++ b/legacy/languages/es_GO/templates/freemarker/aboutMapOfScience_es_GO.ftl
@@ -1,52 +1,52 @@
-<#-- $This file is distributed under the terms of the license in LICENSE$ -->
-
-<#assign aboutImagesRoot = '${urls.images}/visualization/mapofscience/about/'>
-
-

Acerca Mapa de Visualización de Ciencia VIVO

-

Mapa base de referencia

-

El mapa VIVO de la visualización ciencia utiliza el mapa UCSD de la ciencia y clasificación -sistema que se calcula a partir de datos de papel a nivel de alrededor de 25 000 revistas de Elsevier -Scopus y y Thomson Reuters Web of Science (WoS) para los años 2001-2010. El mapa UCSD -de la ciencia se encarga de los 25.000 diarios a 554 subdisciplinas que se agregan más -en 13 disciplinas principales de la ciencia. En el mapa, cada disciplina tiene un color distinto -(verde para 'Biología', marrón de 'Ciencias de la Tierra', etc) y una etiqueta. (Sub) disciplinas que -son similares más cerca el uno al otro en el mapa. (Sub) disciplinas que son especialmente similares -están conectados por líneas grises.

- -

Data Overlay

-

La actividad de publicación de una universidad, organización o persona puede superponerse a la -asignar para generar perfiles experiencia. El proceso es el siguiente: (1) El conjunto de único -se identifica revistas, (2) el número de veces que cada revista sirve como un lugar de publicación -se calcula, y (3) el tamaño del área de las 13 disciplinas y 554 es subdisciplinas -calculado sobre la base de estas publicaciones de revistas recuentos lugar. Tenga en cuenta que algunas revistas están -asociado con exactamente una disciplina (sub), mientras que otros, por ejemplo, los interdisciplinares como -Ciencia o Nature, son marginalmente asociados con múltiples -(sub) disciplinas. Subdisciplinas heredan los colores de sus disciplinas principales. -(Sub) disciplinas sin ningún tipo de publicaciones asociadas se muestran en gris.

- - - - -

Experiencia Perfil Comparación Mapa

-

La actividad de publicación de hasta tres personas u organizaciones pueden compararse a través de "Comparar -organizaciones. "en la tabla de la izquierda, seleccione hasta tres organizaciones. La experiencia -el perfil de cada organización se muestra como datos de overlay. Todas las organizaciones es -representada en un color distinto y una lista de 10 de subdisciplinas con el mayor número -de las publicaciones es la siguiente el mapa comparación. Los datos pueden ser guardados como archivos CSV.

- - - -

Interactividad

-

El mapa puede ser explorado en dos niveles-por 13 disciplinas o subdisciplinas 554. Al hacer clic en -en un nodo en el mapa aparece el número de publicaciones en revistas fraccionada asociada -y el porcentaje de publicaciones asignadas a esta disciplina (sub). Pase el ratón sobre una disciplina -en la tabla de la izquierda para ver lo que los círculos corresponde a en el mapa. Usar control deslizante situado debajo -mapa, sobre el derecho a reducir el número de subdisciplinas demostrado mejorar la legibilidad.

- -

Enlaces

-

Para obtener más información sobre el mapa UCSD de la ciencia y el sistema de clasificación, véase -http://sci.cns.iu.edu/ucsdmap. -Para otros mapas de la ciencia, ver -http://scimaps.org y -http://mapofscience.com.

+<#-- $This file is distributed under the terms of the license in LICENSE$ --> + +<#assign aboutImagesRoot = '${urls.images}/visualization/mapofscience/about/'> + +

Acerca Mapa de Visualización de Ciencia VIVO

+

Mapa base de referencia

+

El mapa VIVO de la visualización ciencia utiliza el mapa UCSD de la ciencia y clasificación +sistema que se calcula a partir de datos de papel a nivel de alrededor de 25 000 revistas de Elsevier +Scopus y y Thomson Reuters Web of Science (WoS) para los años 2001-2010. El mapa UCSD +de la ciencia se encarga de los 25.000 diarios a 554 subdisciplinas que se agregan más +en 13 disciplinas principales de la ciencia. En el mapa, cada disciplina tiene un color distinto +(verde para 'Biología', marrón de 'Ciencias de la Tierra', etc) y una etiqueta. (Sub) disciplinas que +son similares más cerca el uno al otro en el mapa. (Sub) disciplinas que son especialmente similares +están conectados por líneas grises.

+ +

Data Overlay

+

La actividad de publicación de una universidad, organización o persona puede superponerse a la +asignar para generar perfiles experiencia. El proceso es el siguiente: (1) El conjunto de único +se identifica revistas, (2) el número de veces que cada revista sirve como un lugar de publicación +se calcula, y (3) el tamaño del área de las 13 disciplinas y 554 es subdisciplinas +calculado sobre la base de estas publicaciones de revistas recuentos lugar. Tenga en cuenta que algunas revistas están +asociado con exactamente una disciplina (sub), mientras que otros, por ejemplo, los interdisciplinares como +Ciencia o Nature, son marginalmente asociados con múltiples +(sub) disciplinas. Subdisciplinas heredan los colores de sus disciplinas principales. +(Sub) disciplinas sin ningún tipo de publicaciones asociadas se muestran en gris.

+ + + + +

Experiencia Perfil Comparación Mapa

+

La actividad de publicación de hasta tres personas u organizaciones pueden compararse a través de "Comparar +organizaciones. "en la tabla de la izquierda, seleccione hasta tres organizaciones. La experiencia +el perfil de cada organización se muestra como datos de overlay. Todas las organizaciones es +representada en un color distinto y una lista de 10 de subdisciplinas con el mayor número +de las publicaciones es la siguiente el mapa comparación. Los datos pueden ser guardados como archivos CSV.

+ + + +

Interactividad

+

El mapa puede ser explorado en dos niveles-por 13 disciplinas o subdisciplinas 554. Al hacer clic en +en un nodo en el mapa aparece el número de publicaciones en revistas fraccionada asociada +y el porcentaje de publicaciones asignadas a esta disciplina (sub). Pase el ratón sobre una disciplina +en la tabla de la izquierda para ver lo que los círculos corresponde a en el mapa. Usar control deslizante situado debajo +mapa, sobre el derecho a reducir el número de subdisciplinas demostrado mejorar la legibilidad.

+ +

Enlaces

+

Para obtener más información sobre el mapa UCSD de la ciencia y el sistema de clasificación, véase +http://sci.cns.iu.edu/ucsdmap. +Para otros mapas de la ciencia, ver +http://scimaps.org y +http://mapofscience.com.

diff --git a/legacy/languages/es_GO/templates/freemarker/mapOfScienceTooltips_es_GO.ftl b/legacy/languages/es_GO/templates/freemarker/mapOfScienceTooltips_es_GO.ftl index 9faded02..8ae99d70 100644 --- a/legacy/languages/es_GO/templates/freemarker/mapOfScienceTooltips_es_GO.ftl +++ b/legacy/languages/es_GO/templates/freemarker/mapOfScienceTooltips_es_GO.ftl @@ -44,7 +44,7 @@ La cobertura de la publicación de esta visualización se puede mejorar mediante Las organizaciones mencionadas son hijos del nodo de ${entityLabel} en la jerarquía organizacional. Es posible que 'profundizar' para ver las organizaciones por debajo de un determinado sub-organización, seleccione el icono de gráfico junto al nombre de un sub-organización seleccionada por debajo de la gráfica de la derecha.

-El número de publicaciones columna muestra la cantidad de las publicaciones fueron asignadas a cada especialidad. Esta cuenta puede ser fraccionario ya que algunos lugares de publicación están asociados con más de una especialidad. Cada publicación de tal lugar contribuye fraccionadamente a todas las subdisciplinas asociados de acuerdo con un esquema de ponderación. +El número de publicaciones columna muestra la cantidad de las publicaciones fueron asignadas a cada especialidad. Esta cuenta puede ser fraccionario ya que algunos lugares de publicación están asociados con más de una especialidad. Cada publicación de tal lugar contribuye fraccionadamente a todas las subdisciplinas asociados de acuerdo con un esquema de ponderación.

El porcentaje de la columna de actividad muestra qué proporción de las publicaciones que se asigna a cada especialidad. diff --git a/legacy/languages/es_GO/themes/wilma/i18n/all_es_GO.properties b/legacy/languages/es_GO/themes/wilma/i18n/all_es_GO.properties index 464d2aaa..5c381b0f 100644 --- a/legacy/languages/es_GO/themes/wilma/i18n/all_es_GO.properties +++ b/legacy/languages/es_GO/themes/wilma/i18n/all_es_GO.properties @@ -38,7 +38,7 @@ intro_searchvivo = Buscar VIVO intro_filtersearch = búsqueda Filtrar # -# "partial" individual templates ( /templates/freemarker/body/partials/individual ) +# "partial" individual templates ( /templates/freemarker/body/partials/individual ) # contact_capitalized = Contacto phone = teléfono @@ -169,7 +169,7 @@ link_text = texto del enlace link_name = nombre del enlace no_url_provided = no url prevista enlace -# +# # individual templates ( /templates/freemarker/body/individual ) # standard_view = Vista de perfil estándar @@ -180,7 +180,7 @@ geographic_focus = Enfoque Geográfico background_top_image = background image arriba full_view_icon = icono de la vista profile_type = Tipo de perfil -# +# # body templates ( /templates/freemarker/body/ ) # export_qr_code = Exportar código QR @@ -190,12 +190,12 @@ view_this_profile = Ver perfil de este usuario vcard = Vcard hyperlink = Hiperenlace -# +# # accounts templates ( /templates/freemarker/body/accounts ) # password = contraseña -# +# # harvester templates ( /templates/freemarker/body/harvester ) # must_be_admin = Usted debe ser un administrador para usar esta herramienta. @@ -242,14 +242,14 @@ progress_capitalized = Progreso undefined_runtime_property = propiedad en runtime.properties no está definido. define_value_for_property = Para utilizar esta función, defina un valor para esta propiedad que señala al directorio de instalación antes de volver a implementar Cosechadora y reiniciar la aplicación. -# +# # menupage templates ( /templates/freemarker/body/menupage ) # grants_text_one = Este cuerpo es de la la plantilla del archivo vivo / productMods / templates / FreeMarker / cuerpo / menupage / grants.ftl. En el modelo de presentación, la página de becas tiene una pantalla: la propiedad requiresBodyTemplate que define que la página de becas anula la plantilla predeterminada. La plantilla predeterminada de estas páginas está en / in vitro / webapp / web / templates / FreeMarker / cuerpo / menupage / menupage.ftl grants_two = Esta técnica podría ser usada para definir las páginas sin elementos de menú, que obtienen su contenido a partir de una plantilla de FreeMarker. Un ejemplo sería el relacionado con la página. grants_text_three = Esto crearía una página que utilice about.ftl como el cuerpo. La página se accede a través de / sobre y anularía todas las asignaciones de servlet en web.xml. -# +# # lib templates ( /templates/freemarker/body/lib ) # faculty_capitalized = Profesorado @@ -264,7 +264,7 @@ verify_match_capitalized = Verifique este partido change_selection = cambiar la selección # -# custom form templates ( /templates/freemarker/edit/forms ) +# custom form templates ( /templates/freemarker/edit/forms ) # manage_concepts = Gestione Conceptos no_concepts_specified = Actualmente no hay conceptos especificados. @@ -504,7 +504,7 @@ postal_code = Código Postal posn_entry_for = entrada de la posición de # -# coauthorship templates ( /templates/freemarker/visualization/coauthorship ) +# coauthorship templates ( /templates/freemarker/visualization/coauthorship ) # within_last_10_years = dentro de los últimos 10 años total = total @@ -518,7 +518,7 @@ unique_coauthors_per_year = Únicos coautores por año count_capitalized = Contar # -# copi templates ( /templates/freemarker/visualization/copi ) +# copi templates ( /templates/freemarker/visualization/copi ) # year_capitalized = Año unique_coinvestigators = Unique co-investigadores @@ -528,7 +528,7 @@ unique_coinvestigators_per_year = Únicos co-investigadores por año view_timeline_copi_network = Ver entrada completa línea de tiempo y de la red co-investigador. # -# entity comparison templates ( /templates/freemarker/visualization/entitycomparison ) +# entity comparison templates ( /templates/freemarker/visualization/entitycomparison ) # parent_organization_of = Organización de padres de temporal_graph_drill_up = gráfico temporal sintetiza @@ -577,7 +577,7 @@ activity = actividad activities = actividades # -# grant visualization templates ( /templates/freemarker/visualization/grant ) +# grant visualization templates ( /templates/freemarker/visualization/grant ) # view_all_grants = ver todas las subvenciones view_all_grants_text = Ver todas las subvenciones VIVO y correspondiente de la red co-investigador. @@ -585,7 +585,7 @@ grant_per_year = Donaciones por año link = enlace # -# map of science templates ( /templates/freemarker/visualization/mapOfScience ) +# map of science templates ( /templates/freemarker/visualization/mapOfScience ) # parent_entity = entidad matriz map_of_science_icon = mapa de icono de la ciencia @@ -601,14 +601,14 @@ please_visit = Por favor visite el for_complete_overview = para obtener una descripción completa. # -# model constructor templates ( /templates/freemarker/visualization/modelconstructor ) +# model constructor templates ( /templates/freemarker/visualization/modelconstructor ) # cached_models_regenerated = Se regenerarán los siguientes modelos de caché. uri_independent_model = URI Independiente Modelo currently_no_constructed_models = De momento no hay modelos construidos para el uso de la visualización. # -# person level templates ( /templates/freemarker/visualization/personlevel) +# person level templates ( /templates/freemarker/visualization/personlevel) # loading_data = la carga de datos co_investigator_icon = icono de co-investigador @@ -646,7 +646,7 @@ grant_info_for_all_years = La información de las siguientes tablas es para todo grant_sparkline_note = Las líneas de chispa que se muestran arriba reflejan las becas del último año natural completo. Estas tablas, sin embargo, muestran la información de concesión para todos los años, sobre la base de la información cargada en el sistema in vivo. # -# publication templates ( /templates/freemarker/visualization/publication) +# publication templates ( /templates/freemarker/visualization/publication) # numbers_based_on_publications_in_vivo = Estas cifras se basan únicamente en las publicaciones que se han cargado en la aplicación in vivo. Si esta es tu perfil, puede entrar en las publicaciones adicionales a continuación. last_ten_full_years = en los últimos 10 años completos @@ -656,7 +656,7 @@ download_link = el enlace de descarga years = año # -# miscellaneous visualization templates ( /templates/freemarker/visualization) +# miscellaneous visualization templates ( /templates/freemarker/visualization) # visualization_tools = Herramientas de visualización refresh_cached_vis_models = Actualizar Modelos en caché para visualización @@ -668,7 +668,7 @@ vis_tools_note_three = Actualmente estamos caché estos modelos en la memoria. L vis_tools_note_four = Los modelos se actualizan cada vez que se reinicia el servidor. Dado que esto no es generalmente práctico sobre instancias de producción, los administradores pueden usar en lugar del enlace "actualización de caché" para hacer esto sin reiniciar. # -# custom form javascript variables ( /templates/freemarker/edit/js) +# custom form javascript variables ( /templates/freemarker/edit/js) # drag_drop_reorder_authors = Arrastrar y soltar para cambiar el orden de los autores reordering_authors_failed = Reordenación de los autores no. @@ -710,7 +710,7 @@ confirm_webpage_deletion = ¿Está seguro de que desea eliminar esta página web error_removing_webpage = Solicitud de procesamiento Error: la página web no se elimina. # -# miscellaneous javascript variables ( productMods/js) +# miscellaneous javascript variables ( productMods/js) # researcher = investigador researchers = investigadores @@ -729,13 +729,13 @@ view_all_departments = ver todos los departamentos académicos no_departments_found = No hay departamentos académicos encontrados. # -# individual javascript variables ( productMods/js/individual) +# individual javascript variables ( productMods/js/individual) # error_processing_type_change = Solicitud de procesamiento Error: las etiquetas sin control no pudo ser eliminado. # -# visualization javascript variables ( productMods/js/visualization) +# visualization javascript variables ( productMods/js/visualization) # publications_with = Publicaciones con @@ -803,7 +803,7 @@ publication_pubs = publicaciones (pubs.) percent_activity = % De actividad # -# miscellaneous additions +# miscellaneous additions # limit_search = limitar la búsqueda diff --git a/legacy/utilities/LoadTesting/modelData/_patches_and_queries/image_file_query.sparql b/legacy/utilities/LoadTesting/modelData/_patches_and_queries/image_file_query.sparql index 9e11dc85..071856e5 100644 --- a/legacy/utilities/LoadTesting/modelData/_patches_and_queries/image_file_query.sparql +++ b/legacy/utilities/LoadTesting/modelData/_patches_and_queries/image_file_query.sparql @@ -2,7 +2,7 @@ # Run this sparql query and format the output as CSV to find a list of # everywhere that VIVO expects to find an image file. # -# Process the result file with ????? to insert dummy images in all of +# Process the result file with ????? to insert dummy images in all of # those locations. # diff --git a/legacy/utilities/acceptance-tests/example.acceptance_tests.properties b/legacy/utilities/acceptance-tests/example.acceptance_tests.properties index 003c11f1..6db81a83 100644 --- a/legacy/utilities/acceptance-tests/example.acceptance_tests.properties +++ b/legacy/utilities/acceptance-tests/example.acceptance_tests.properties @@ -1,30 +1,30 @@ -# -# These properties tell how to set up Selenium to run a test suite. -# -website_url = http://localhost:8080/vivo -suite_parent_directories = suites -output_directory = ../../.build/acceptance-tests-output -user_extensions_path = /vitro/utilities/testrunner/selenium/user-extensions.js -firefox_profile_template_path = -suite_timeout_limit = 240 -selenium_jar_path = /vitro/utilities/testrunner/selenium/selenium-server.jar - -# -# These properties are needed to cleanse the data model between test suites. -# - -mysql_username = vivoUser -mysql_password = vivoPass -mysql_dumpfile = test-model/testmodeldump.sql -mysql_db_name = vivo -vivo_webapp_directory = /usr/local/tomcat//webapps/vivo -upload_directory = /usr/local/vivo/data/uploads -tomcat_check_ready_command = /usr/local/vivo/commands/check_tomcat.sh -tomcat_stop_command = /usr/local/vivo/commands/stop_tomcat.sh -tomcat_start_command = /usr/local/vivo/commands/start_tomcat.sh - - -# -# These properties control the output formatting of the tests. -# -ignored_tests_file = suites/ignored_tests.txt +# +# These properties tell how to set up Selenium to run a test suite. +# +website_url = http://localhost:8080/vivo +suite_parent_directories = suites +output_directory = ../../.build/acceptance-tests-output +user_extensions_path = /vitro/utilities/testrunner/selenium/user-extensions.js +firefox_profile_template_path = +suite_timeout_limit = 240 +selenium_jar_path = /vitro/utilities/testrunner/selenium/selenium-server.jar + +# +# These properties are needed to cleanse the data model between test suites. +# + +mysql_username = vivoUser +mysql_password = vivoPass +mysql_dumpfile = test-model/testmodeldump.sql +mysql_db_name = vivo +vivo_webapp_directory = /usr/local/tomcat//webapps/vivo +upload_directory = /usr/local/vivo/data/uploads +tomcat_check_ready_command = /usr/local/vivo/commands/check_tomcat.sh +tomcat_stop_command = /usr/local/vivo/commands/stop_tomcat.sh +tomcat_start_command = /usr/local/vivo/commands/start_tomcat.sh + + +# +# These properties control the output formatting of the tests. +# +ignored_tests_file = suites/ignored_tests.txt diff --git a/legacy/utilities/acceptance-tests/suites/MultiLabels/TestMultipleLabels.n3 b/legacy/utilities/acceptance-tests/suites/MultiLabels/TestMultipleLabels.n3 index 3a7631a8..d1086bd8 100644 --- a/legacy/utilities/acceptance-tests/suites/MultiLabels/TestMultipleLabels.n3 +++ b/legacy/utilities/acceptance-tests/suites/MultiLabels/TestMultipleLabels.n3 @@ -8,12 +8,12 @@ @prefix vivo: . - a foaf:Person , - vivo:FacultyMember , - foaf:Agent , - owl:Thing , - obo:BFO_0000002 , - obo:BFO_0000001 , + a foaf:Person , + vivo:FacultyMember , + foaf:Agent , + owl:Thing , + obo:BFO_0000002 , + obo:BFO_0000001 , obo:BFO_0000004 ; rdfs:label "Furter, Frank "^^xsd:string ; rdfs:label "Test Label 1 "^^xsd:string ; @@ -22,30 +22,30 @@ vitro:mostSpecificType vivo:FacultyMember . - a obo:BFO_0000031 , - vcard:Kind , - obo:ARG_2000379 , - owl:Thing , - obo:IAO_0000030 , - obo:BFO_0000002 , - obo:BFO_0000001 , + a obo:BFO_0000031 , + vcard:Kind , + obo:ARG_2000379 , + owl:Thing , + obo:IAO_0000030 , + obo:BFO_0000002 , + obo:BFO_0000001 , vcard:Individual ; obo:ARG_2000029 ; vitro:mostSpecificType vcard:Individual ; vcard:hasName . - a vcard:Name , - vcard:Geographical , - vcard:TimeZone , - owl:Thing , - vcard:Organizational , - vcard:Geo , - vcard:Communication , - vcard:Explanatory , - vcard:Identification , - vcard:Security , - vcard:Addressing , + a vcard:Name , + vcard:Geographical , + vcard:TimeZone , + owl:Thing , + vcard:Organizational , + vcard:Geo , + vcard:Communication , + vcard:Explanatory , + vcard:Identification , + vcard:Security , + vcard:Addressing , vcard:Calendar ; vitro:mostSpecificType vcard:Name ; vcard:familyName "Furter"^^xsd:string ; diff --git a/legacy/utilities/acceptance-tests/suites/ProcessRDFData/ontology_v2.0_Lite.rdf b/legacy/utilities/acceptance-tests/suites/ProcessRDFData/ontology_v2.0_Lite.rdf index b178ec27..d6f5249d 100644 --- a/legacy/utilities/acceptance-tests/suites/ProcessRDFData/ontology_v2.0_Lite.rdf +++ b/legacy/utilities/acceptance-tests/suites/ProcessRDFData/ontology_v2.0_Lite.rdf @@ -4127,7 +4127,7 @@ vineyards - + diff --git a/legacy/utilities/acceptance-tests/suites/SearchBoost/BoostClass.n3 b/legacy/utilities/acceptance-tests/suites/SearchBoost/BoostClass.n3 index 725dd113..1b2d8270 100644 --- a/legacy/utilities/acceptance-tests/suites/SearchBoost/BoostClass.n3 +++ b/legacy/utilities/acceptance-tests/suites/SearchBoost/BoostClass.n3 @@ -1,9 +1,9 @@ -# +# # 100000.0. -# +# # 5000.0. diff --git a/legacy/utilities/acceptance-tests/suites/SearchExclusion/TestSearchExclusion.n3 b/legacy/utilities/acceptance-tests/suites/SearchExclusion/TestSearchExclusion.n3 index a4beecdf..01c9068a 100644 --- a/legacy/utilities/acceptance-tests/suites/SearchExclusion/TestSearchExclusion.n3 +++ b/legacy/utilities/acceptance-tests/suites/SearchExclusion/TestSearchExclusion.n3 @@ -1,7 +1,7 @@ -@prefix owl: . -@prefix vitroDisplay: . -@prefix rdf: . - -vitroDisplay:SearchIndex - rdf:type owl:Thing ; - vitroDisplay:excludeClass . +@prefix owl: . +@prefix vitroDisplay: . +@prefix rdf: . + +vitroDisplay:SearchIndex + rdf:type owl:Thing ; + vitroDisplay:excludeClass . diff --git a/legacy/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 b/legacy/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 index f0ff92f0..e2ba509e 100644 --- a/legacy/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 +++ b/legacy/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 @@ -1,4 +1,4 @@ -# $This file is distributed under the terms of the license in LICENSE$ +# $This file is distributed under the terms of the license in LICENSE$ # # Short View configuration @@ -8,7 +8,7 @@ # implementation, and should be replaced when the work on the Application and Display # Ontology is complete. # -# Find out how to use this file at +# Find out how to use this file at # https://sourceforge.net/apps/mediawiki/vivo/index.php?title=Using_Short_Views_in_Release_1.5 # @@ -18,34 +18,34 @@ @prefix mydomain: . # -# In all views, Facult Members should show the name of the +# In all views, Facult Members should show the name of the # department they belong to. # -vivo:FacultyMember +vivo:FacultyMember display:hasCustomView mydomain:facultySearchView ; display:hasCustomView mydomain:facultyIndexView ; display:hasCustomView mydomain:facultyBrowseView . - + mydomain:facultySearchView a display:customViewForIndividual ; display:appliesToContext "SEARCH" ; display:hasTemplate "view-search-faculty.ftl" ; display:hasDataGetter mydomain:facultyDepartmentDG . - + mydomain:facultyIndexView a display:customViewForIndividual ; display:appliesToContext "INDEX" ; display:hasTemplate "view-index-faculty.ftl" ; display:hasDataGetter mydomain:facultyDepartmentDG . - + mydomain:facultyBrowseView a display:customViewForIndividual ; display:appliesToContext "BROWSE" ; display:hasTemplate "view-browse-faculty.ftl" ; display:hasDataGetter mydomain:facultyDepartmentDG ; display:hasDataGetter mydomain:facultyPreferredTitleDG . - + mydomain:facultyDepartmentDG a datagetters:SparqlQueryDataGetter ; display:saveToVar "details" ; @@ -57,11 +57,11 @@ SELECT ?deptName WHERE { ?individualUri obo:RO_0000053 ?membership . ?membership vivo:roleContributesTo ?deptUri . -?deptUri +?deptUri a vivo:AcademicDepartment ; rdfs:label ?deptName . } -LIMIT 20 +LIMIT 20 """ . mydomain:facultyPreferredTitleDG @@ -80,7 +80,7 @@ LIMIT 1 """ . # -# In the INDEX view, Academic departments should show locations +# In the INDEX view, Academic departments should show locations # and department head. # diff --git a/legacy/utilities/acceptance-tests/suites/ShortViews/view-browse-faculty.ftl b/legacy/utilities/acceptance-tests/suites/ShortViews/view-browse-faculty.ftl index c223ec41..023c48fb 100644 --- a/legacy/utilities/acceptance-tests/suites/ShortViews/view-browse-faculty.ftl +++ b/legacy/utilities/acceptance-tests/suites/ShortViews/view-browse-faculty.ftl @@ -35,6 +35,6 @@ <#if (details[0].deptName)?? > Member of ${details[0].deptName} - + diff --git a/legacy/utilities/acceptance-tests/suites/SparqlQueryApi/EnableSparqlQueryApi.n3 b/legacy/utilities/acceptance-tests/suites/SparqlQueryApi/EnableSparqlQueryApi.n3 index 5548d4b0..f83bfe53 100644 --- a/legacy/utilities/acceptance-tests/suites/SparqlQueryApi/EnableSparqlQueryApi.n3 +++ b/legacy/utilities/acceptance-tests/suites/SparqlQueryApi/EnableSparqlQueryApi.n3 @@ -2,5 +2,5 @@ @prefix auth: . @prefix simplePermission: . -auth:ADMIN - auth:hasPermission simplePermission:UseSparqlQueryApi ; +auth:ADMIN + auth:hasPermission simplePermission:UseSparqlQueryApi ; diff --git a/legacy/utilities/acceptance-tests/suites/SparqlUpdateApi/EnableSparqlUpdateApi.n3 b/legacy/utilities/acceptance-tests/suites/SparqlUpdateApi/EnableSparqlUpdateApi.n3 index a9d54a1a..3a8ec2c6 100644 --- a/legacy/utilities/acceptance-tests/suites/SparqlUpdateApi/EnableSparqlUpdateApi.n3 +++ b/legacy/utilities/acceptance-tests/suites/SparqlUpdateApi/EnableSparqlUpdateApi.n3 @@ -2,5 +2,5 @@ @prefix auth: . @prefix simplePermission: . -auth:ADMIN - auth:hasPermission simplePermission:UseSparqlUpdateApi ; +auth:ADMIN + auth:hasPermission simplePermission:UseSparqlUpdateApi ; diff --git a/selenium/test-output/testng.css b/selenium/test-output/testng.css index 3904800f..5124ba86 100644 --- a/selenium/test-output/testng.css +++ b/selenium/test-output/testng.css @@ -1,9 +1,9 @@ -.invocation-failed, .test-failed { background-color: #DD0000; } -.invocation-percent, .test-percent { background-color: #006600; } -.invocation-passed, .test-passed { background-color: #00AA00; } -.invocation-skipped, .test-skipped { background-color: #CCCC00; } - -.main-page { - font-size: x-large; -} - +.invocation-failed, .test-failed { background-color: #DD0000; } +.invocation-percent, .test-percent { background-color: #006600; } +.invocation-passed, .test-passed { background-color: #00AA00; } +.invocation-skipped, .test-skipped { background-color: #CCCC00; } + +.main-page { + font-size: x-large; +} + diff --git a/selenium/test-user-model.owl b/selenium/test-user-model.owl index a84b1370..4e1da1fd 100644 --- a/selenium/test-user-model.owl +++ b/selenium/test-user-model.owl @@ -1,5 +1,5 @@ -Admin DC647EB65E6711E155375218212B3964 ACTIVE - 1 - 0 + 1 + 0 @@ -26,8 +26,8 @@ Curator DC647EB65E6711E155375218212B3964 ACTIVE - 1 - 0 + 1 + 0 @@ -38,8 +38,8 @@ Editor DC647EB65E6711E155375218212B3964 ACTIVE - 1 - 0 + 1 + 0 @@ -50,8 +50,8 @@ User DC647EB65E6711E155375218212B3964 ACTIVE - 1 - 0 + 1 + 0 diff --git a/webapp/src/main/webapp/WEB-INF/applicationContext.xml b/webapp/src/main/webapp/WEB-INF/applicationContext.xml index 057a92fe..11715102 100644 --- a/webapp/src/main/webapp/WEB-INF/applicationContext.xml +++ b/webapp/src/main/webapp/WEB-INF/applicationContext.xml @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/askUpdated.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/askUpdated.sparql index 024bfb78..41884637 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/askUpdated.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/askUpdated.sparql @@ -1,5 +1,5 @@ -PREFIX vitro: -PREFIX owl: +PREFIX vitro: +PREFIX owl: PREFIX rdf: ASK { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/diff.tab.txt b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/diff.tab.txt index 4e18a4b7..ab423470 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/diff.tab.txt +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/diff.tab.txt @@ -1 +1 @@ -http://purl.org/NET/c4dm/event.owl#agent Delete z http://purl.org/NET/c4dm/event.owl#isAgentIn Delete z http://purl.org/NET/c4dm/event.owl#produced_in http://purl.obolibrary.org/obo/RO_0002353 Yes z http://purl.org/NET/c4dm/event.owl#product http://purl.obolibrary.org/obo/RO_0002234 Yes z http://purl.org/dc/elements/1.1/isVersionOf Delete z http://vivoweb.org/ontology/core#administeredBy Delete complex construct with grant administrator role http://purl.org/dc/terms/isReferencedBy Delete z http://purl.org/dc/terms/isVersionOf Delete z http://purl.org/dc/terms/publisher http://vivoweb.org/ontology/core#publisher Yes z http://purl.org/ontology/bibo/editor Delete z http://vivoweb.org/ontology/core#administers Delete complex construct with grant administrator role http://vivoweb.org/ontology/core#advisee Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#adviseeIn Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#advisingContributionTo Delete construct http://vivoweb.org/ontology/core#advisor Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#advisorIn Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#associatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#associatedWithPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#attendeeRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#authorInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardConferred http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#awardConferredBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#awardOrHonor http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardOrHonorFor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#awardsGrant http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#clinicalRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#co-PrincipalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#courseOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#credentialOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#currentMemberOf Delete construct MemberRole http://vivoweb.org/ontology/core#currentlyHeadOf Delete construct LeaderRole http://vivoweb.org/ontology/core#currentlyHeadedBy Delete construct LeaderRole http://vivoweb.org/ontology/core#degreeEarned http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#degreeOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#degreeOutcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#domesticGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#domesticGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#editor Delete CC editorship http://vivoweb.org/ontology/core#editorOf Delete CC editorship http://vivoweb.org/ontology/core#editorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#educationalTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#educationalTrainingOf http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#equipmentInFacility http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#eventWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#geographicLocationOf http://purl.obolibrary.org/obo/RO_0001015 Yes """location of""" http://vivoweb.org/ontology/core#geographicallyContains http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#geographicallyWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#grantAwardedBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#hasAttendeeRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasAttendeeRoleContext http://vivoweb.org/ontology/core#hasClinicalRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasClinicalRoleContext http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasCo-PrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#hasCurrentMember Delete construct MemberRole http://vivoweb.org/ontology/core#hasEditorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasEditorRoleContext http://vivoweb.org/ontology/core#hasGeographicLocation http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#hasInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasInvestigatorRoleContext http://vivoweb.org/ontology/core#hasLeaderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasLeaderRoleContext http://vivoweb.org/ontology/core#hasMemberRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasMemberRoleContext http://vivoweb.org/ontology/core#hasOrganizerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOrganizerRoleContext http://vivoweb.org/ontology/core#hasOutreachProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOutreachProviderContext http://vivoweb.org/ontology/core#hasPart http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasPresenterRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPresenterRoleContext http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasResearcherRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasResearcherRoleContext http://vivoweb.org/ontology/core#hasReviewerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasReviewerRoleContext http://vivoweb.org/ontology/core#hasRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#hasRoom http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#hasServiceProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasServiceProviderRoleContext http://vivoweb.org/ontology/core#hasSubGrant http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasSubOrganization http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasTeacherRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#inEventSeries http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#includesEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#informationProduct http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#informationProductOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#informationResourceInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#internationalGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#internationalGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#investigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes """inheres in""" http://vivoweb.org/ontology/core#issuanceOfCredential http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#issuedCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#leaderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#linkedAuthor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#linkedInformationResource http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#locationOfEquipment http://purl.obolibrary.org/obo/RO_0001015 Yes z http://vivoweb.org/ontology/core#mailingAddress Delete VCard http://vivoweb.org/ontology/core#mailingAddressFor Delete VCard http://vivoweb.org/ontology/core#memberRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#offersCourse http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#offersDegree http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#organizationForPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#organizationForTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#organizerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#outcome http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#outcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#outreachProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#partOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#personInPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#positionForPerson http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#positionInOrganization http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#presenterRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#principalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#providesService http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#realizedRole http://purl.obolibrary.org/obo/BFO_0000055 Yes """realizes""" http://vivoweb.org/ontology/core#receipt http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#receiptOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#relatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#researcherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#reviewerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleIn http://purl.obolibrary.org/obo/BFO_0000054 Yes """realized in"" (or delete, since there should be subs?)" http://vivoweb.org/ontology/core#roleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleRealizedIn http://purl.obolibrary.org/obo/BFO_0000054 Yes z http://vivoweb.org/ontology/core#roomWithinBuilding http://purl.obolibrary.org/obo/RO_0001025 Yes z http://vivoweb.org/ontology/core#seriesForEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#serviceProvidedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#serviceProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#subGrantOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#subOrganizationWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#teacherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#trainingAtOrganization http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#authorRank http://vivoweb.org/ontology/core#rank Yes z http://vivoweb.org/ontology/core#preferredTitle Delete z http://vivoweb.org/ontology/core#EducationalTraining http://vivoweb.org/ontology/core#EducationalProcess Yes z http://vivoweb.org/ontology/core#ServiceProviderRole http://purl.obolibrary.org/obo/ERO_0000012 Yes z http://vivoweb.org/ontology/core#URLLink http://www.w3.org/2006/vcard/ns#URL Yes z http://vivoweb.org/ontology/core#Agreement Delete z http://vivoweb.org/ontology/core#InformationResource http://purl.obolibrary.org/obo/IAO_0000030 Yes z http://vivoweb.org/ontology/core#Service http://purl.obolibrary.org/obo/ERO_0000005 Yes z http://vivoweb.org/ontology/core#Software http://purl.obolibrary.org/obo/ERO_0000071 Yes z \ No newline at end of file +http://purl.org/NET/c4dm/event.owl#agent Delete z http://purl.org/NET/c4dm/event.owl#isAgentIn Delete z http://purl.org/NET/c4dm/event.owl#produced_in http://purl.obolibrary.org/obo/RO_0002353 Yes z http://purl.org/NET/c4dm/event.owl#product http://purl.obolibrary.org/obo/RO_0002234 Yes z http://purl.org/dc/elements/1.1/isVersionOf Delete z http://vivoweb.org/ontology/core#administeredBy Delete complex construct with grant administrator role http://purl.org/dc/terms/isReferencedBy Delete z http://purl.org/dc/terms/isVersionOf Delete z http://purl.org/dc/terms/publisher http://vivoweb.org/ontology/core#publisher Yes z http://purl.org/ontology/bibo/editor Delete z http://vivoweb.org/ontology/core#administers Delete complex construct with grant administrator role http://vivoweb.org/ontology/core#advisee Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#adviseeIn Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#advisingContributionTo Delete construct http://vivoweb.org/ontology/core#advisor Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#advisorIn Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#associatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#associatedWithPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#attendeeRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#authorInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardConferred http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#awardConferredBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#awardOrHonor http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardOrHonorFor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#awardsGrant http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#clinicalRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#co-PrincipalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#courseOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#credentialOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#currentMemberOf Delete construct MemberRole http://vivoweb.org/ontology/core#currentlyHeadOf Delete construct LeaderRole http://vivoweb.org/ontology/core#currentlyHeadedBy Delete construct LeaderRole http://vivoweb.org/ontology/core#degreeEarned http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#degreeOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#degreeOutcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#domesticGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#domesticGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#editor Delete CC editorship http://vivoweb.org/ontology/core#editorOf Delete CC editorship http://vivoweb.org/ontology/core#editorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#educationalTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#educationalTrainingOf http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#equipmentInFacility http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#eventWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#geographicLocationOf http://purl.obolibrary.org/obo/RO_0001015 Yes """location of""" http://vivoweb.org/ontology/core#geographicallyContains http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#geographicallyWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#grantAwardedBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#hasAttendeeRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasAttendeeRoleContext http://vivoweb.org/ontology/core#hasClinicalRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasClinicalRoleContext http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasCo-PrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#hasCurrentMember Delete construct MemberRole http://vivoweb.org/ontology/core#hasEditorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasEditorRoleContext http://vivoweb.org/ontology/core#hasGeographicLocation http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#hasInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasInvestigatorRoleContext http://vivoweb.org/ontology/core#hasLeaderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasLeaderRoleContext http://vivoweb.org/ontology/core#hasMemberRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasMemberRoleContext http://vivoweb.org/ontology/core#hasOrganizerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOrganizerRoleContext http://vivoweb.org/ontology/core#hasOutreachProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOutreachProviderContext http://vivoweb.org/ontology/core#hasPart http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasPresenterRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPresenterRoleContext http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasResearcherRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasResearcherRoleContext http://vivoweb.org/ontology/core#hasReviewerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasReviewerRoleContext http://vivoweb.org/ontology/core#hasRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#hasRoom http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#hasServiceProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasServiceProviderRoleContext http://vivoweb.org/ontology/core#hasSubGrant http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasSubOrganization http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasTeacherRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#inEventSeries http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#includesEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#informationProduct http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#informationProductOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#informationResourceInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#internationalGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#internationalGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#investigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes """inheres in""" http://vivoweb.org/ontology/core#issuanceOfCredential http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#issuedCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#leaderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#linkedAuthor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#linkedInformationResource http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#locationOfEquipment http://purl.obolibrary.org/obo/RO_0001015 Yes z http://vivoweb.org/ontology/core#mailingAddress Delete VCard http://vivoweb.org/ontology/core#mailingAddressFor Delete VCard http://vivoweb.org/ontology/core#memberRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#offersCourse http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#offersDegree http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#organizationForPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#organizationForTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#organizerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#outcome http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#outcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#outreachProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#partOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#personInPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#positionForPerson http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#positionInOrganization http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#presenterRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#principalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#providesService http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#realizedRole http://purl.obolibrary.org/obo/BFO_0000055 Yes """realizes""" http://vivoweb.org/ontology/core#receipt http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#receiptOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#relatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#researcherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#reviewerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleIn http://purl.obolibrary.org/obo/BFO_0000054 Yes """realized in"" (or delete, since there should be subs?)" http://vivoweb.org/ontology/core#roleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleRealizedIn http://purl.obolibrary.org/obo/BFO_0000054 Yes z http://vivoweb.org/ontology/core#roomWithinBuilding http://purl.obolibrary.org/obo/RO_0001025 Yes z http://vivoweb.org/ontology/core#seriesForEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#serviceProvidedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#serviceProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#subGrantOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#subOrganizationWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#teacherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#trainingAtOrganization http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#authorRank http://vivoweb.org/ontology/core#rank Yes z http://vivoweb.org/ontology/core#preferredTitle Delete z http://vivoweb.org/ontology/core#EducationalTraining http://vivoweb.org/ontology/core#EducationalProcess Yes z http://vivoweb.org/ontology/core#ServiceProviderRole http://purl.obolibrary.org/obo/ERO_0000012 Yes z http://vivoweb.org/ontology/core#URLLink http://www.w3.org/2006/vcard/ns#URL Yes z http://vivoweb.org/ontology/core#Agreement Delete z http://vivoweb.org/ontology/core#InformationResource http://purl.obolibrary.org/obo/IAO_0000030 Yes z http://vivoweb.org/ontology/core#Service http://purl.obolibrary.org/obo/ERO_0000005 Yes z http://vivoweb.org/ontology/core#Software http://purl.obolibrary.org/obo/ERO_0000071 Yes z diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/geopolitical-ver1.1-11-18-11-annotations.rdf b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/geopolitical-ver1.1-11-18-11-annotations.rdf index 97282f05..e2f5506b 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/geopolitical-ver1.1-11-18-11-annotations.rdf +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/geopolitical-ver1.1-11-18-11-annotations.rdf @@ -20,7 +20,7 @@ xmlns:dcterms="http://purl.org/dc/terms/" xmlns:scires="http://vivoweb.org/ontology/scientific-research#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > hasCoordinate diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/isDefinedBy-1.5-annotations.rdf b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/isDefinedBy-1.5-annotations.rdf index 392a90b1..85269262 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/isDefinedBy-1.5-annotations.rdf +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/isDefinedBy-1.5-annotations.rdf @@ -22,7 +22,7 @@ xmlns:scires="http://vivoweb.org/ontology/scientific-research#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:swrl="http://www.w3.org/2003/11/swrl#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > is defined by true diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vitro-0.7-annotations.rdf b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vitro-0.7-annotations.rdf index 3f9f1cdc..8d9a084a 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vitro-0.7-annotations.rdf +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vitro-0.7-annotations.rdf @@ -2,7 +2,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vivo-core-1.5-annotations.rdf b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vivo-core-1.5-annotations.rdf index f39f09dd..99811b41 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vivo-core-1.5-annotations.rdf +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldAnnotations/vivo-core-1.5-annotations.rdf @@ -5949,7 +5949,7 @@ nearestGeographicLocation This relates something to its geographic location, for example, an organization to its geographic location. + >This relates something to its geographic location, for example, an organization to its geographic location. diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/geopolitical.tbox.ver1.1-11-18-11.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/geopolitical.tbox.ver1.1-11-18-11.owl index 37834ae3..c3b3138f 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/geopolitical.tbox.ver1.1-11-18-11.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/geopolitical.tbox.ver1.1-11-18-11.owl @@ -13,7 +13,7 @@ FAO DISCLAIMER: Information on the FAO Country Profiles portal is provided as and when available. The designations employed and the presentation of information do not imply the expression of any opinion whatsoever on the part of the Food and Agriculture Organization of the United Nations (FAO) concerning the legal status of any country, territory, city or area, or of its authorities, or concerning the delimitation of its frontiers or boundaries. FAO makes every effort to ensure, but does not guarantee, the accuracy or completeness of and declines responsibility for any loss, damage, liability or expense suffered which is claimed to result from its use. Version 1.1 of the ontology includes a structured description of sources (source creator, source identifier by language, and last updated date on source) . + >Version 1.1 of the ontology includes a structured description of sources (source creator, source identifier by language, and last updated date on source) . FAO's geopolitical ontology version 1.1 was populated with FAO, UN and internationally recognized data sources. diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/isDefinedBy-1.5.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/isDefinedBy-1.5.owl index 7020407f..28c16c4a 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/isDefinedBy-1.5.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/isDefinedBy-1.5.owl @@ -18,7 +18,7 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-bibo-1.5.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-bibo-1.5.owl index 33ccab46..eb0d79d4 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-bibo-1.5.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-bibo-1.5.owl @@ -1214,7 +1214,7 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi stable http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:oclcnum/. + >http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:oclcnum/. bibo has the domain of this property set to the union of Collection and Document. diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-fabio-1.5.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-fabio-1.5.owl index f3a8da67..4b1f11b8 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-fabio-1.5.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/oldVersion/vivo-fabio-1.5.owl @@ -29,8 +29,8 @@ A verbal or written remark concerning some entity. In written form, a comment is often appended to that entity and termed an annotation. Within computer programs or ontologies, comments are added to enhance human understanding, and are usually prefaced by A verbal or written remark concerning some entity. In written form, a comment is often appended to that entity and termed an annotation. Within computer programs or ontologies, comments are added to enhance human understanding, and are usually prefaced by a special syntactic symbol that ensures they are ignored during execution of the program. - + >A verbal or written remark concerning some entity. In written form, a comment is often appended to that entity and termed an annotation. Within computer programs or ontologies, comments are added to enhance human understanding, and are usually prefaced by a special syntactic symbol that ensures they are ignored during execution of the program. + has super-classes diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdviseeRole.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdviseeRole.sparql index c79d5687..e2711e0d 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdviseeRole.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdviseeRole.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdvisorRole.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdvisorRole.sparql index 8a389c08..dec88058 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdvisorRole.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/AdvisorRole.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/Editorship.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/Editorship.sparql index 204664f8..501b4054 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/Editorship.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/Editorship.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -9,12 +9,12 @@ CONSTRUCT { _:Editorship vivo:relates ?document . ?document vivo:relatedBy _:Editorship . } WHERE { - { + { ?person vivo:editorOf ?document } UNION { ?document vivo:editor ?person - FILTER NOT EXISTS { ?person vivo:editorOf ?document } - } + FILTER NOT EXISTS { ?person vivo:editorOf ?document } + } FILTER NOT EXISTS { ?person vivo:relatedBy ?editorshipNode . ?editorshipNode vivo:relates ?document . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/LeaderRole.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/LeaderRole.sparql index 2a09ef27..bd8d5426 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/LeaderRole.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/LeaderRole.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -10,8 +10,8 @@ CONSTRUCT { ?org vivo:contributingRole _:leaderRole . } WHERE { { ?person vivo:currentlyHeadOf ?org } - UNION - { ?org vivo:currentlyHeadedBy ?person + UNION + { ?org vivo:currentlyHeadedBy ?person FILTER NOT EXISTS { ?person vivo:currentlyHeadOf ?org } } FILTER NOT EXISTS { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/MemberRole.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/MemberRole.sparql index 85a5b275..e25f1984 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/MemberRole.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/MemberRole.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -10,8 +10,8 @@ CONSTRUCT { ?org vivo:contributingRole _:memberRole . } WHERE { { ?person vivo:currentMemberOf ?org } - UNION - { ?org vivo:hasCurrentMember ?person + UNION + { ?org vivo:hasCurrentMember ?person FILTER NOT EXISTS { ?person vivo:currentMemberOf ?org } } FILTER NOT EXISTS { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/concept.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/concept.sparql index 4183699a..cdf6209c 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/concept.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/concept.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX skos: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grant-pre.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grant-pre.sparql index 99c631b6..ae7e4fee 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grant-pre.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grant-pre.sparql @@ -1,10 +1,10 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { ?role vivo:relatedBy ?grant . - ?grant vivo:relates ?role + ?grant vivo:relates ?role } WHERE { ?role vivo:roleContributesTo ?grant . { ?grant a vivo:Grant } UNION { ?grant a vivo:Contract } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grantAdmin.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grantAdmin.sparql index 72315e11..12ba49db 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grantAdmin.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/grantAdmin.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -13,8 +13,8 @@ CONSTRUCT { } WHERE { { ?agent vivo:administers ?grant } UNION - { ?grant vivo:administeredBy ?agent - FILTER NOT EXISTS { ?agent vivo:administers ?grant } + { ?grant vivo:administeredBy ?agent + FILTER NOT EXISTS { ?agent vivo:administers ?grant } } FILTER NOT EXISTS { ?agent ?adminRoleNode . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/orcid.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/orcid.sparql index d53f0db2..f1cd7f42 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/orcid.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/orcid.sparql @@ -1,11 +1,11 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: CONSTRUCT { ?s vivo:orcidId ?orcidURI . ?orcidURI a owl:Thing . } WHERE { - ?s vivo:orcidId ?orcidString + ?s vivo:orcidId ?orcidString FILTER(isLiteral(?orcidString)) FILTER (regex(str(?orcidString), "^[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]([0-9]|X)$")) BIND(IRI(concat("http://orcid.org/", str(?orcidString))) AS ?orcidURI) diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/Grant.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/Grant.sparql index 0277868c..67df8630 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/Grant.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/Grant.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -9,5 +9,5 @@ CONSTRUCT { ?agent ?role . ?role vivo:relatedBy ?grant . { ?grant a vivo:Grant } UNION { ?grant a vivo:Contract } - FILTER NOT EXISTS { ?grant vivo:relates ?agent } + FILTER NOT EXISTS { ?grant vivo:relates ?agent } } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardConferred.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardConferred.sparql index 971b713f..15e411b3 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardConferred.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardConferred.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardedDegree.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardedDegree.sparql index 5beaf5a2..497e7655 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardedDegree.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/awardedDegree.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { @@ -19,8 +19,8 @@ CONSTRUCT { ?educationalProcess ?degree . ?degree a vivo:AcademicDegree . OPTIONAL { - ?educationalProcess ?org . - ?org a foaf:Organization + ?educationalProcess ?org . + ?org a foaf:Organization } FILTER NOT EXISTS { ?educationalProcess ?awardedDegreeNode . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/contributingAdvising.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/contributingAdvising.sparql index af1e6871..eb30cb3d 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/contributingAdvising.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/post/contributingAdvising.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-0.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-0.sparql index 40f24583..2a632eec 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-0.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-0.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { @@ -10,18 +10,18 @@ CONSTRUCT { _:vcard a v:Individual . } WHERE { ?s a foaf:Person - FILTER ( + FILTER ( EXISTS { ?s foaf:firstName ?firstName } || EXISTS { ?s foaf:lastName ?lastName } || EXISTS { ?s vivo:middleName ?middleName } || - EXISTS { ?s vivo:email ?email } || + EXISTS { ?s vivo:email ?email } || EXISTS { ?s vivo:primaryEmail ?primaryEmail } || EXISTS { ?s vivo:phoneNumber ?phoneNumber } || EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || EXISTS { ?s vivo:faxNumber ?faxNumber } || EXISTS { ?s vivo:mailingAddress ?address } || EXISTS { ?s vivo:webpage ?webpage } || - EXISTS { ?s vivo:preferredTitle ?preferredTitle } || + EXISTS { ?s vivo:preferredTitle ?preferredTitle } || EXISTS { ?s bibo:prefixName ?prefixName } || EXISTS { ?s bibo:suffixName ?suffixName } ) diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-1.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-1.sparql index 1ff6690f..1dd5932e 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-1.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-1.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?s arg:ARG_2000028 _:vcard . @@ -9,8 +9,8 @@ CONSTRUCT { _:vcard a v:Organization . } WHERE { ?s a foaf:Organization - FILTER ( - EXISTS { ?s vivo:email ?email } || + FILTER ( + EXISTS { ?s vivo:email ?email } || EXISTS { ?s vivo:primaryEmail ?primaryEmail } || EXISTS { ?s vivo:phoneNumber ?phoneNumber } || EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-2.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-2.sparql index 030704e9..f56eff02 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-2.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-2.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?s arg:ARG_2000028 _:vcard . @@ -9,14 +9,14 @@ CONSTRUCT { _:vcard a v:Group . } WHERE { ?s a foaf:Group - FILTER ( - EXISTS { ?s vivo:email ?email } || + FILTER ( + EXISTS { ?s vivo:email ?email } || EXISTS { ?s vivo:primaryEmail ?primaryEmail } || EXISTS { ?s vivo:phoneNumber ?phoneNumber } || EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || EXISTS { ?s vivo:faxNumber ?faxNumber } || EXISTS { ?s vivo:mailingAddress ?address } || - EXISTS { ?s vivo:webpage ?webpage } - ) + EXISTS { ?s vivo:webpage ?webpage } + ) FILTER NOT EXISTS { ?s arg:ARG_2000028 ?vcardNode } } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-3.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-3.sparql index cb908214..33560713 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-3.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard1-3.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX owl: CONSTRUCT { @@ -10,14 +10,14 @@ CONSTRUCT { _:vcard a v:Kind . } WHERE { ?s a owl:Thing - FILTER ( - EXISTS { ?s vivo:email ?email } || + FILTER ( + EXISTS { ?s vivo:email ?email } || EXISTS { ?s vivo:primaryEmail ?primaryEmail } || EXISTS { ?s vivo:phoneNumber ?phoneNumber } || EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || EXISTS { ?s vivo:faxNumber ?faxNumber } || EXISTS { ?s vivo:mailingAddress ?address } || - EXISTS { ?s vivo:webpage ?webpage } - ) + EXISTS { ?s vivo:webpage ?webpage } + ) FILTER NOT EXISTS { ?s arg:ARG_2000028 ?vcardNode } } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard22.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard22.sparql index db2f6276..94da9683 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard22.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard22.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2a.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2a.sparql index ef2dc2ba..e2306dd7 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2a.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2a.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2b.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2b.sparql index 64634413..d630cbfa 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2b.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2b.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2c.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2c.sparql index dbcaf50a..f646059d 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2c.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2c.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { @@ -9,7 +9,7 @@ CONSTRUCT { _:name a v:Name . _:name vivo:middleName ?middleName . } WHERE { - ?s vivo:middleName ?middleName . + ?s vivo:middleName ?middleName . ?s arg:ARG_2000028 ?vcard . FILTER NOT EXISTS { ?vcard v:hasName ?name diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2d.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2d.sparql index cb32f1b9..de437718 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2d.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2d.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { ?name vivo:middleName ?middleName . } WHERE { - ?s vivo:middleName ?middleName . + ?s vivo:middleName ?middleName . ?s a foaf:Person . ?s arg:ARG_2000028 ?vcard . ?vcard v:hasName ?name diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2e.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2e.sparql index cfa9ea92..9cef1237 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2e.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2e.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { @@ -9,7 +9,7 @@ CONSTRUCT { _:name a v:Name . _:name v:familyName ?lastName . } WHERE { - ?s foaf:lastName ?lastName . + ?s foaf:lastName ?lastName . ?s arg:ARG_2000028 ?vcard . FILTER NOT EXISTS { ?vcard v:hasName ?name diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2f.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2f.sparql index 4337be4d..e1d7822d 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2f.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2f.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { ?name v:familyName ?lastName . } WHERE { - ?s foaf:lastName ?lastName . + ?s foaf:lastName ?lastName . ?s arg:ARG_2000028 ?vcard . ?vcard v:hasName ?name } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2g.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2g.sparql index 66231ddf..8d7b2803 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2g.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2g.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { @@ -9,7 +9,7 @@ CONSTRUCT { _:name a v:Name . _:name v:honorificPrefix ?prefixName . } WHERE { - ?s bibo:prefixName ?prefixName . + ?s bibo:prefixName ?prefixName . ?s arg:ARG_2000028 ?vcard . FILTER NOT EXISTS { ?vcard v:hasName ?name diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2h.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2h.sparql index 1eb06b3b..2ae254be 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2h.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2h.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { ?name v:honorificPrefix ?prefixName . } WHERE { - ?s bibo:prefixName ?prefixName . + ?s bibo:prefixName ?prefixName . ?s arg:ARG_2000028 ?vcard . ?vcard v:hasName ?name } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2i.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2i.sparql index 5d873f15..af3755e8 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2i.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2i.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { @@ -9,7 +9,7 @@ CONSTRUCT { _:name a v:Name . _:name v:honorificSuffix ?suffixName . } WHERE { - ?s bibo:suffixName ?suffixName . + ?s bibo:suffixName ?suffixName . ?s arg:ARG_2000028 ?vcard . FILTER NOT EXISTS { ?vcard v:hasName ?name diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2j.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2j.sparql index a3abaff9..735c01a0 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2j.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard2j.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: PREFIX bibo: CONSTRUCT { ?name v:honorificSuffix ?suffixName . } WHERE { - ?s bibo:suffixName ?suffixName . + ?s bibo:suffixName ?suffixName . ?s arg:ARG_2000028 ?vcard . ?vcard v:hasName ?name } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard3.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard3.sparql index 2952d182..463ffa32 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard3.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard3.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasEmail _:email . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard4.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard4.sparql index 8699c703..51f60c3b 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard4.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard4.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasEmail _:primaryEmail . _:primaryEmail a v:Email . _:primaryEmail a v:Work . - _:primaryEmail v:email ?primaryEmail . + _:primaryEmail v:email ?primaryEmail . } WHERE { ?s vivo:primaryEmail ?primaryEmail . ?s arg:ARG_2000028 ?vcard . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard5.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard5.sparql index 26017bc1..266d839d 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard5.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard5.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasTelephone _:telephone . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard6.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard6.sparql index 8bc690a0..12d11f0e 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard6.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard6.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasTelephone _:primaryTelephone . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard7.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard7.sparql index c94a7638..076dd00e 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard7.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard7.sparql @@ -1,13 +1,13 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasTelephone _:fax . _:fax a v:Telephone . _:fax a v:Fax. - _:fax v:telephone ?faxNumber . + _:fax v:telephone ?faxNumber . } WHERE { ?s vivo:faxNumber ?faxNumber . ?s arg:ARG_2000028 ?vcard . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard8.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard8.sparql index 48c1fd52..2942ca5a 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard8.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard8.sparql @@ -1,7 +1,7 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasAddress ?address . @@ -25,18 +25,18 @@ CONSTRUCT { ?address vivo:address1 ?address1 . ?address vivo:address2 ?address2 . ?address vivo:address3 ?address3 . - BIND (CONCAT(?address1, ", ", ?address2, ", ", ?address3) AS ?streetAddress) - } + BIND (CONCAT(?address1, ", ", ?address2, ", ", ?address3) AS ?streetAddress) + } OPTIONAL { ?address vivo:address1 ?address1 . ?address vivo:address2 ?address2 . FILTER NOT EXISTS { ?address vivo:address3 ?address3 } - BIND (CONCAT(?address1, ", ", ?address2) AS ?streetAddress) + BIND (CONCAT(?address1, ", ", ?address2) AS ?streetAddress) } OPTIONAL { ?address vivo:address1 ?address1 BIND(?address1 as ?streetAddress) - } + } FILTER NOT EXISTS { ?vcard v:hasAddress ?addressNode } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard9.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard9.sparql index bf8db27a..db140fb9 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard9.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/additions/vcard9.sparql @@ -1,8 +1,8 @@ -PREFIX arg: -PREFIX foaf: +PREFIX arg: +PREFIX foaf: PREFIX rdfs: -PREFIX v: -PREFIX vivo: +PREFIX v: +PREFIX vivo: CONSTRUCT { ?vcard v:hasURL ?webpage . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql index 3bb114bd..6f9904ad 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql @@ -1,13 +1,13 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { ?advisor vivo:advisorIn ?advisingRelationship . - ?advisingRelationship vivo:advisor ?advisor + ?advisingRelationship vivo:advisor ?advisor } WHERE { ?advisor vivo:advisorIn ?advisingRelationship . OPTIONAL { - ?advisingRelationship vivo:advisor ?advisor + ?advisingRelationship vivo:advisor ?advisor } } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql index 6ef6c59e..18308d72 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/EditorshipDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/EditorshipDel.sparql index 2c388daf..5c74c4c4 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/EditorshipDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/EditorshipDel.sparql @@ -1,12 +1,12 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { ?person vivo:editorOf ?document . ?document vivo:editor ?person } WHERE { - { + { ?person vivo:editorOf ?document } UNION { ?document vivo:editor ?person diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/conceptDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/conceptDel.sparql index 3a32aa00..978b2a01 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/conceptDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/conceptDel.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX skos: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/grant-pre-del.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/grant-pre-del.sparql index f35cb8bd..d9b05b91 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/grant-pre-del.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/grant-pre-del.sparql @@ -1,9 +1,9 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { - ?role vivo:roleContributesTo ?grant . + ?role vivo:roleContributesTo ?grant . ?grant vivo:contributingRole ?role . } WHERE { ?role vivo:roleContributesTo ?grant . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/orcidDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/orcidDel.sparql index e1aa19cb..a9f6a1b4 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/orcidDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/orcidDel.sparql @@ -1,10 +1,10 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: CONSTRUCT { ?s vivo:orcidId ?orcidString . } WHERE { - ?s vivo:orcidId ?orcidString + ?s vivo:orcidId ?orcidString FILTER(isLiteral(?orcidString)) FILTER (regex(str(?orcidString), "^[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]([0-9]|X)$")) } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardConferredDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardConferredDel.sparql index f3dd1a5a..73f463ae 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardConferredDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardConferredDel.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardedDegreeDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardedDegreeDel.sparql index 4d622fff..611e0084 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardedDegreeDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/post/awardedDegreeDel.sparql @@ -1,5 +1,5 @@ -PREFIX vivo: -PREFIX owl: +PREFIX vivo: +PREFIX owl: PREFIX foaf: CONSTRUCT { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/vcardDel.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/vcardDel.sparql index 619bf855..6c2f3ef0 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/vcardDel.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/sparqlConstructs/deletions/vcardDel.sparql @@ -2,7 +2,7 @@ PREFIX arg: PREFIX foaf: PREFIX v: PREFIX vivo: -PREFIX bibo: +PREFIX bibo: CONSTRUCT { ?s foaf:firstName ?firstName . @@ -11,7 +11,7 @@ CONSTRUCT { ?s bibo:prefixName ?prefix . ?s bibo:suffixName ?suffix . ?s vivo:email ?email . - ?s vivo:primaryEmail ?primaryEmail . + ?s vivo:primaryEmail ?primaryEmail . ?s vivo:phoneNumber ?phoneNumber . ?s vivo:primaryPhoneNumber ?primaryPhoneNumber . ?s vivo:faxNumber ?faxNumber . @@ -35,35 +35,35 @@ CONSTRUCT { } WHERE { { ?s foaf:firstName ?firstName . - } + } UNION { ?s foaf:lastName ?lastName . - } + } UNION { ?s vivo:middleName ?middleName . ?s a foaf:Person . } UNION { - ?s bibo:prefixName ?prefix - } + ?s bibo:prefixName ?prefix + } UNION { ?s bibo:suffixName ?suffix - } + } UNION { ?s vivo:email ?email - } + } UNION { - ?s vivo:primaryEmail ?primaryEmail - } + ?s vivo:primaryEmail ?primaryEmail + } UNION { - ?s vivo:phoneNumber ?phoneNumber - } + ?s vivo:phoneNumber ?phoneNumber + } UNION { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber - } + } UNION { ?s vivo:faxNumber ?faxNumber - } + } UNION { ?s vivo:mailingAddress ?address . } @@ -72,60 +72,60 @@ CONSTRUCT { } UNION { ?s vivo:mailingAddress ?address . - ?address a ?addressType + ?address a ?addressType FILTER(regex(str(?addressType),"vivoweb.org/ontology/core")) } UNION { ?s vivo:mailingAddress ?address . ?address vivo:address1 ?address1 . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:address2 ?address2 . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:address3 ?address3 . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:addressCity ?city . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:addressState ?state . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:addressPostalCode ?postalCode . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:addressCountry ?country . - } + } UNION { ?s vivo:mailingAddress ?address . ?address vivo:hasGeographicLocation ?location . - } + } UNION { ?s vivo:mailingAddress ?address . ?location vivo:geographicLocationOf ?address . - } + } UNION { - ?s vivo:webpage ?webpage + ?s vivo:webpage ?webpage } UNION { ?webpage vivo:webpageOf ?s } UNION { - ?s vivo:webpage ?webpage - } + ?s vivo:webpage ?webpage + } UNION { ?s vivo:webpage ?webpage . - ?webpage vivo:linkURI ?linkURI - } + ?webpage vivo:linkURI ?linkURI + } UNION { ?s vivo:webpage ?webpage . - ?webpage vivo:linkAnchorText ?linkAnchorText + ?webpage vivo:linkAnchorText ?linkAnchorText } } diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/success.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/success.n3 index d24d34f6..3ab3b53e 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/success.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update15to16/success.n3 @@ -7,4 +7,4 @@ vitro:updatedOntology . vitro:fromOntologyVersion "1.5" . vitro:toOntologyVersion "1.6" . - + diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/askUpdated.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/askUpdated.sparql index 96249c55..e0454841 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/askUpdated.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/askUpdated.sparql @@ -1,5 +1,5 @@ -PREFIX vitro: -PREFIX owl: +PREFIX vitro: +PREFIX owl: PREFIX rdf: ASK { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/additionalHiding.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/additionalHiding.n3 index cbeb3920..5188ef00 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/additionalHiding.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/additionalHiding.n3 @@ -8,34 +8,34 @@ @prefix vitro: . @prefix role: . @prefix local: . -@prefix vivo: . +@prefix vivo: . @base . # warning: don't use blank nodes; the display model doesn't currently support them. - + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . - - vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . - -vivo:relates + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:relatedBy +vivo:relates vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:assigns +vivo:relatedBy vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:assignedBy +vivo:assigns + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . + +vivo:assignedBy vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/initialTBoxAnnotations.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/initialTBoxAnnotations.n3 index abdb9255..320f0bcd 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/initialTBoxAnnotations.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldAnnotations/initialTBoxAnnotations.n3 @@ -2901,7 +2901,7 @@ obo:ERO_0000044 ; vitro:inPropertyGroupAnnot . - + obo:ERO_0001261 rdfs:label "Analysis Service"@en-US ; vitro:inClassGroup . @@ -3097,7 +3097,7 @@ obo:ERO_0000045 ; vitro:inPropertyGroupAnnot . - + vivo:Division rdfs:label "Division"@en-US ; vitro:displayLimitAnnot @@ -5432,7 +5432,7 @@ obo:ERO_0000482 # deprecated # "true"^^xsd:boolean ; # vitro:inPropertyGroupAnnot # . - + vivo:ResearchProposal rdfs:label "Research Proposal"@en-US ; vitro:displayLimitAnnot @@ -6134,7 +6134,7 @@ vivo:abbreviation ; vitro:inPropertyGroupAnnot . - + vcard:postalCode rdfs:label "postal code"@en-US . @@ -6242,7 +6242,7 @@ obo: rdfs:label "OBO Foundry"@en-US ; vitro:ontologyPrefixAnnot "cito"^^xsd:string ; rdfs:label "CiTO (Citation Typing Ontology)"@en-US . - + vivo:providesFundingThrough rdfs:label "provides funding through"@en-US ; vitro:displayLimitAnnot @@ -7013,7 +7013,7 @@ vivo:Room . vivo:eRACommonsId - rdfs:label "eRA Commons ID"@en-US ; + rdfs:label "eRA Commons ID"@en-US ; vitro:displayRankAnnot "15"^^xsd:int ; vitro:hiddenFromDisplayBelowRoleLevelAnnot @@ -7271,7 +7271,7 @@ obo:ERO_0000033 "true"^^xsd:boolean ; vitro:inPropertyGroupAnnot . - + obo:ERO_0000397 rdfs:label "performs technique"@en-US ; vitro:displayLimitAnnot @@ -8778,7 +8778,7 @@ obo:ERO_0000919 "true"^^xsd:boolean ; vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean . - + bibo:status rdfs:label "status"@en-US ; vitro:displayLimitAnnot @@ -8867,7 +8867,7 @@ geo:validUntil vitro:hiddenFromPublishBelowRoleLevelAnnot . - + vivo:hasEquipment rdfs:label "has equipment"@en-US ; vitro:displayRankAnnot diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldVersion/empty.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldVersion/empty.owl index 64212d5c..e91796a3 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldVersion/empty.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/oldVersion/empty.owl @@ -20,5 +20,5 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:swrl="http://www.w3.org/2003/11/swrl#" xmlns:fabio="http://purl.org/spar/fabio/" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/success.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/success.n3 index 53713858..70c23f0a 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/success.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update16to17/success.n3 @@ -7,4 +7,4 @@ vitro:updatedOntology . vitro:fromOntologyVersion "1.6" . vitro:toOntologyVersion "1.7" . - + diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/askUpdated.sparql b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/askUpdated.sparql index 96249c55..e0454841 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/askUpdated.sparql +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/askUpdated.sparql @@ -1,5 +1,5 @@ -PREFIX vitro: -PREFIX owl: +PREFIX vitro: +PREFIX owl: PREFIX rdf: ASK { diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/additionalHiding.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/additionalHiding.n3 index cbeb3920..5188ef00 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/additionalHiding.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/additionalHiding.n3 @@ -8,34 +8,34 @@ @prefix vitro: . @prefix role: . @prefix local: . -@prefix vivo: . +@prefix vivo: . @base . # warning: don't use blank nodes; the display model doesn't currently support them. - + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . - - vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . - -vivo:relates + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:relatedBy +vivo:relates vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:assigns +vivo:relatedBy vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . -vivo:assignedBy +vivo:assigns + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . + +vivo:assignedBy vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody . diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/initialTBoxAnnotations.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/initialTBoxAnnotations.n3 index abdb9255..320f0bcd 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/initialTBoxAnnotations.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldAnnotations/initialTBoxAnnotations.n3 @@ -2901,7 +2901,7 @@ obo:ERO_0000044 ; vitro:inPropertyGroupAnnot . - + obo:ERO_0001261 rdfs:label "Analysis Service"@en-US ; vitro:inClassGroup . @@ -3097,7 +3097,7 @@ obo:ERO_0000045 ; vitro:inPropertyGroupAnnot . - + vivo:Division rdfs:label "Division"@en-US ; vitro:displayLimitAnnot @@ -5432,7 +5432,7 @@ obo:ERO_0000482 # deprecated # "true"^^xsd:boolean ; # vitro:inPropertyGroupAnnot # . - + vivo:ResearchProposal rdfs:label "Research Proposal"@en-US ; vitro:displayLimitAnnot @@ -6134,7 +6134,7 @@ vivo:abbreviation ; vitro:inPropertyGroupAnnot . - + vcard:postalCode rdfs:label "postal code"@en-US . @@ -6242,7 +6242,7 @@ obo: rdfs:label "OBO Foundry"@en-US ; vitro:ontologyPrefixAnnot "cito"^^xsd:string ; rdfs:label "CiTO (Citation Typing Ontology)"@en-US . - + vivo:providesFundingThrough rdfs:label "provides funding through"@en-US ; vitro:displayLimitAnnot @@ -7013,7 +7013,7 @@ vivo:Room . vivo:eRACommonsId - rdfs:label "eRA Commons ID"@en-US ; + rdfs:label "eRA Commons ID"@en-US ; vitro:displayRankAnnot "15"^^xsd:int ; vitro:hiddenFromDisplayBelowRoleLevelAnnot @@ -7271,7 +7271,7 @@ obo:ERO_0000033 "true"^^xsd:boolean ; vitro:inPropertyGroupAnnot . - + obo:ERO_0000397 rdfs:label "performs technique"@en-US ; vitro:displayLimitAnnot @@ -8778,7 +8778,7 @@ obo:ERO_0000919 "true"^^xsd:boolean ; vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean . - + bibo:status rdfs:label "status"@en-US ; vitro:displayLimitAnnot @@ -8867,7 +8867,7 @@ geo:validUntil vitro:hiddenFromPublishBelowRoleLevelAnnot . - + vivo:hasEquipment rdfs:label "has equipment"@en-US ; vitro:displayRankAnnot diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldVersion/empty.owl b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldVersion/empty.owl index 64212d5c..e91796a3 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldVersion/empty.owl +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/oldVersion/empty.owl @@ -20,5 +20,5 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:swrl="http://www.w3.org/2003/11/swrl#" xmlns:fabio="http://purl.org/spar/fabio/" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > diff --git a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/success.n3 b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/success.n3 index 53713858..70c23f0a 100644 --- a/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/success.n3 +++ b/webapp/src/main/webapp/WEB-INF/ontologies/update17to18/success.n3 @@ -7,4 +7,4 @@ vitro:updatedOntology . vitro:fromOntologyVersion "1.6" . vitro:toOntologyVersion "1.7" . - + diff --git a/webapp/src/main/webapp/WEB-INF/resources/startup_listeners.txt b/webapp/src/main/webapp/WEB-INF/resources/startup_listeners.txt index e7bdfa88..c4bb43e5 100644 --- a/webapp/src/main/webapp/WEB-INF/resources/startup_listeners.txt +++ b/webapp/src/main/webapp/WEB-INF/resources/startup_listeners.txt @@ -1,92 +1,92 @@ -# -# ServletContextListeners for VIVO, to be instantiated and run by the StartupManager. -# -# For more information, -# https://sourceforge.net/apps/mediawiki/vivo/index.php?title=The_StartupManager -# - -edu.cornell.mannlib.vitro.webapp.servlet.setup.JvmSmokeTests - -edu.cornell.mannlib.vitro.webapp.application.ApplicationSetup - -edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSetup - -edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSmokeTests - -edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettings$Setup - -edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ComponentsSetup - -edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup - -edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup - -edu.cornell.mannlib.vitro.webapp.servlet.setup.ConfigurationModelsSetup -edu.cornell.mannlib.vitro.webapp.servlet.setup.ContentModelSetup - -edu.cornell.mannlib.vitro.webapp.web.images.PlaceholderUtil$Setup - -edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup - -# Invokes process to perform updates to align with ontology changes if needed --> -# edu.cornell.mannlib.vitro.webapp.migration.rel16.Release16Migrator -# edu.cornell.mannlib.vitro.webapp.migration.rel17.Release17Migrator -edu.cornell.mannlib.vitro.webapp.migration.rel18.Release18Migrator - -edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ReasonersSetup -edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup - -# Must run after JenaDataSourceSetup -edu.cornell.mannlib.vitro.webapp.servlet.setup.ThemeInfoSetup - -edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionRegistry$Setup - -edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionSetsSmokeTest - -edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBean$Setup - -edu.cornell.mannlib.vitro.webapp.auth.policy.setup.CommonPolicyFamilySetup - -edu.cornell.mannlib.vitro.webapp.auth.policy.RootUserPolicy$Setup - -edu.cornell.mannlib.vivo.auth.policy.SelfEditorRelationshipPolicy$Setup - -edu.cornell.mannlib.vitro.webapp.auth.policy.RestrictHomeMenuItemEditingPolicy$Setup - -edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceSetup - -edu.cornell.mannlib.vitro.webapp.visualization.setup.VisualizationSetup - -org.vivoweb.webapp.startup.DataGetterN3Setup -org.vivoweb.webapp.startup.GeneratorSetup -org.vivoweb.webapp.startup.JSONWrapperSetup -org.vivoweb.webapp.startup.MenuManagementSetup -org.vivoweb.webapp.startup.SiteAdminSetup -org.vivoweb.webapp.startup.TemplateModelSetup -org.vivoweb.webapp.startup.SearchResultTemplateModelSetup - -edu.ucsf.vitro.opensocial.OpenSocialSmokeTests - -# For multiple language support -edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup - -# The search indexer uses a "public" permission, so the PropertyRestrictionPolicyHelper -# and the PermissionRegistry must already be set up. -edu.cornell.mannlib.vitro.webapp.searchindex.SearchIndexerSetup - -edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerSetup -edu.cornell.mannlib.vitro.webapp.freemarker.config.FreemarkerConfiguration$Setup - -# On shutdown, this will kill the background thread started by Apache Commons File Upload -org.apache.commons.fileupload.servlet.FileCleanerCleanup - -# The VClassGroupCache index uses a "public" permission, so the PropertyRestrictionPolicyHelper -# and the PermissionRegistry must already be set up. -edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache$Setup - -edu.cornell.mannlib.vivo.orcid.OrcidContextSetup - -# This should be near the end, because it will issue a warning if the connection to Solr times out. -edu.cornell.mannlib.vitro.webapp.servlet.setup.SolrSmokeTest - -org.vivoweb.webapp.startup.i18nSetup +# +# ServletContextListeners for VIVO, to be instantiated and run by the StartupManager. +# +# For more information, +# https://sourceforge.net/apps/mediawiki/vivo/index.php?title=The_StartupManager +# + +edu.cornell.mannlib.vitro.webapp.servlet.setup.JvmSmokeTests + +edu.cornell.mannlib.vitro.webapp.application.ApplicationSetup + +edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSetup + +edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSmokeTests + +edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettings$Setup + +edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ComponentsSetup + +edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup + +edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup + +edu.cornell.mannlib.vitro.webapp.servlet.setup.ConfigurationModelsSetup +edu.cornell.mannlib.vitro.webapp.servlet.setup.ContentModelSetup + +edu.cornell.mannlib.vitro.webapp.web.images.PlaceholderUtil$Setup + +edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup + +# Invokes process to perform updates to align with ontology changes if needed --> +# edu.cornell.mannlib.vitro.webapp.migration.rel16.Release16Migrator +# edu.cornell.mannlib.vitro.webapp.migration.rel17.Release17Migrator +edu.cornell.mannlib.vitro.webapp.migration.rel18.Release18Migrator + +edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ReasonersSetup +edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup + +# Must run after JenaDataSourceSetup +edu.cornell.mannlib.vitro.webapp.servlet.setup.ThemeInfoSetup + +edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionRegistry$Setup + +edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionSetsSmokeTest + +edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBean$Setup + +edu.cornell.mannlib.vitro.webapp.auth.policy.setup.CommonPolicyFamilySetup + +edu.cornell.mannlib.vitro.webapp.auth.policy.RootUserPolicy$Setup + +edu.cornell.mannlib.vivo.auth.policy.SelfEditorRelationshipPolicy$Setup + +edu.cornell.mannlib.vitro.webapp.auth.policy.RestrictHomeMenuItemEditingPolicy$Setup + +edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceSetup + +edu.cornell.mannlib.vitro.webapp.visualization.setup.VisualizationSetup + +org.vivoweb.webapp.startup.DataGetterN3Setup +org.vivoweb.webapp.startup.GeneratorSetup +org.vivoweb.webapp.startup.JSONWrapperSetup +org.vivoweb.webapp.startup.MenuManagementSetup +org.vivoweb.webapp.startup.SiteAdminSetup +org.vivoweb.webapp.startup.TemplateModelSetup +org.vivoweb.webapp.startup.SearchResultTemplateModelSetup + +edu.ucsf.vitro.opensocial.OpenSocialSmokeTests + +# For multiple language support +edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup + +# The search indexer uses a "public" permission, so the PropertyRestrictionPolicyHelper +# and the PermissionRegistry must already be set up. +edu.cornell.mannlib.vitro.webapp.searchindex.SearchIndexerSetup + +edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerSetup +edu.cornell.mannlib.vitro.webapp.freemarker.config.FreemarkerConfiguration$Setup + +# On shutdown, this will kill the background thread started by Apache Commons File Upload +org.apache.commons.fileupload.servlet.FileCleanerCleanup + +# The VClassGroupCache index uses a "public" permission, so the PropertyRestrictionPolicyHelper +# and the PermissionRegistry must already be set up. +edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache$Setup + +edu.cornell.mannlib.vivo.orcid.OrcidContextSetup + +# This should be near the end, because it will issue a warning if the connection to Solr times out. +edu.cornell.mannlib.vitro.webapp.servlet.setup.SolrSmokeTest + +org.vivoweb.webapp.startup.i18nSetup diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/address/address.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/address/address.sparql index 5fb4a5c6..2660ebcd 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/address/address.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/address/address.sparql @@ -9,4 +9,4 @@ CONSTRUCT { PERSON_URI obo:ARG_2000028 ?vcard . ?vcard vcard:hasAddress ?address . ?address ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/address/locationOfAddress.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/address/locationOfAddress.sparql index 5bfba019..77dd0421 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/address/locationOfAddress.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/address/locationOfAddress.sparql @@ -9,4 +9,4 @@ CONSTRUCT { ?vcard vcard:hasAddress ?address . ?address obo:RO_0001025 ?geographicLocation . ?geographicLocation ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/advisee.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/advisee.sparql index ba5e8ab6..3d0f2e9c 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/advisee.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/advisee.sparql @@ -13,4 +13,4 @@ CONSTRUCT { ?adviseeRole a core:AdviseeRole . ?adviseeRole core:relatedBy ?advisingRelationship . ?advisee ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql index 83117529..e69b4e41 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql @@ -18,4 +18,4 @@ CONSTRUCT { ?awardedDegree core:relates ?degree . ?degree a core:AcademicDegree . ?degree ?property ?object -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql index ccc4acd4..e764a452 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql @@ -17,4 +17,4 @@ CONSTRUCT { ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:end ?dateTimeValue . ?dateTimeValue ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql index 5332ca71..ce8d89bc 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql @@ -18,4 +18,4 @@ CONSTRUCT { ?educationalTraining obo:RO_0000057 ?educationalInstitution . ?educationalInstitution a foaf:Organization . ?educationalInstitution rdfs:label ?label -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedDegree.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedDegree.sparql index e3ba5b83..2573fad3 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedDegree.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedDegree.sparql @@ -8,4 +8,4 @@ CONSTRUCT { ?advisingRelationship a core:AdvisingRelationship . ?advisingRelationship core:degreeCandidacy ?degree . ?degree ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql index e417d74f..7578b374 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql @@ -7,4 +7,4 @@ CONSTRUCT { ?advisingRelationship a core:AdvisingRelationship . ?advisingRelationship core:advisingContributionTo ?educationalTraining . ?educationalTraining ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql index a0a60c33..52b893f9 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql @@ -15,4 +15,4 @@ CONSTRUCT { ?advisee core:relates ?educationalTraining . ?educationalTraining a core:EducationalProcess . ?educationalTraining ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/award/award.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/award/award.sparql index 353e143f..dcfe941d 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/award/award.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/award/award.sparql @@ -5,7 +5,7 @@ CONSTRUCT { } WHERE { PERSON_URI core:relatedBy ?awardReceipt . ?awardReceipt a core:AwardReceipt . - ?awardReceipt core:relates ?award . + ?awardReceipt core:relates ?award . ?award a core:Award . ?award ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/award/conferringOrganization.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/award/conferringOrganization.sparql index 2c735ba4..6c95f368 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/award/conferringOrganization.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/award/conferringOrganization.sparql @@ -6,7 +6,7 @@ CONSTRUCT { } WHERE { PERSON_URI core:relatedBy ?awardReceipt . ?awardReceipt a core:AwardReceipt . - ?awardReceipt core:assignedBy ?organization . + ?awardReceipt core:assignedBy ?organization . ?organization a foaf:Organization . ?organization ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/award/sponsoringOrganization.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/award/sponsoringOrganization.sparql index e686fa86..c2e37307 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/award/sponsoringOrganization.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/award/sponsoringOrganization.sparql @@ -6,8 +6,8 @@ CONSTRUCT { } WHERE { PERSON_URI core:relatedBy ?awardReceipt . ?awardReceipt a core:AwardReceipt . - ?awardReceipt core:relates ?award . + ?awardReceipt core:relates ?award . ?award a core:Award . ?award core:sponsoredBy ?organization . ?organization ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/credential.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/credential.sparql index 124317f0..e68d14c9 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/credential.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/credential.sparql @@ -3,9 +3,9 @@ PREFIX core: CONSTRUCT { ?credential ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:relates ?credential . ?credential a core:Credential . ?credential ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql index 79bb6cb2..6e77b1d1 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql @@ -3,10 +3,10 @@ PREFIX core: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:relates ?credential . ?credential a core:Credential . ?credential core:hasGoverningAuthority ?organization . ?organization ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/eligibleForCredential.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/eligibleForCredential.sparql index bd8ae3ef..15a73fef 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/eligibleForCredential.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/eligibleForCredential.sparql @@ -3,6 +3,6 @@ PREFIX core: CONSTRUCT { ?credential ?property ?object . } WHERE { - PERSON_URI core:eligibleFor ?credential . + PERSON_URI core:eligibleFor ?credential . ?credential ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredential.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredential.sparql index e055c153..f68d58a3 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredential.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredential.sparql @@ -3,7 +3,7 @@ PREFIX core: CONSTRUCT { ?issuedCredential ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql index d59f5119..aff19623 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql @@ -4,10 +4,10 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:expirationDate ?date . ?date ?property ?object . ?date core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql index 22a41b16..6794a032 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql @@ -4,10 +4,10 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:dateIssued ?date . ?date ?property ?object . ?date core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql index afc265c9..cda40d7a 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql @@ -3,8 +3,8 @@ PREFIX core: CONSTRUCT { ?subjectArea ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?issuedCredential . - ?issuedCredential a core:IssuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:hasSubjectArea ?subjectArea . ?subjectArea ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql index 2b43a303..dc4836a0 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql @@ -4,7 +4,7 @@ PREFIX obo: CONSTRUCT { ?educationalTraining ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql index 27fb7508..931b2faf 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql @@ -4,11 +4,11 @@ PREFIX obo: CONSTRUCT { ?degree ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining obo:RO_0002234 ?awardedDegree . ?awardedDegree a core:AwardedDegree . ?awardedDegree core:relates ?degree . ?degree a core:AcademicDegree . ?degree ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql index 1ccdd587..524bf24a 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql @@ -5,9 +5,9 @@ CONSTRUCT { ?dateTimeInterval core:end ?date . ?date ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:end ?date . ?date ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql index 2edff7fe..9b149ea8 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql @@ -5,11 +5,11 @@ PREFIX foaf: CONSTRUCT { ?geographicLocation ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining obo:RO_0000057 ?organization . ?organization a foaf:Organization . ?organization obo:RO_0001025 ?geographicLocation . ?geographicLocation a core:GeographicLocation . ?geographicLocation ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql index 188ea661..e8f317c3 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql @@ -5,9 +5,9 @@ PREFIX foaf: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining obo:RO_0000057 ?organization . ?organization a foaf:Organization . ?organization ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql index f7ed31f4..736a30d4 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql @@ -4,9 +4,9 @@ PREFIX obo: CONSTRUCT { ?date ?property ?object . } WHERE { - PERSON_URI obo:RO_0000056 ?educationalTraining . - ?educationalTraining a core:EducationalProcess . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:start ?date . ?date ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/funding/grantAwardedBy.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/funding/grantAwardedBy.sparql index 8b03e590..5bd717de 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/funding/grantAwardedBy.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/funding/grantAwardedBy.sparql @@ -3,7 +3,7 @@ PREFIX foaf: PREFIX rdfs: CONSTRUCT { - ?awardingOrganization rdfs:label ?label + ?awardingOrganization rdfs:label ?label } WHERE { { {PERSON_URI core:relatedBy ?investigatorRole . @@ -12,12 +12,12 @@ CONSTRUCT { union {PERSON_URI core:relatedBy ?investigatorRole . ?investigatorRole a core:CoPrincipalInvestigatorRole - } + } } - + ?investigatorRole core:relatedBy ?grant . ?grant a core:Grant . ?grant core:assignedBy ?awardingOrganization . ?awardingOrganization a foaf:Organization . - ?awardingOrganization rdfs:label ?label -} \ No newline at end of file + ?awardingOrganization rdfs:label ?label +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/funding/grants.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/funding/grants.sparql index 3d0df166..5c701b69 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/funding/grants.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/funding/grants.sparql @@ -12,10 +12,10 @@ CONSTRUCT { union { PERSON_URI core:relatedBy ?investigatorRole . ?investigatorRole a core:CoPrincipalInvestigatorRole - } + } } - + ?investigatorRole core:relatedBy ?grant . ?grant a core:Grant . - ?grant ?property ?object -} \ No newline at end of file + ?grant ?property ?object +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/membership/memberRoleIn.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/membership/memberRoleIn.sparql index 165c83c8..eda869b7 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/membership/memberRoleIn.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/membership/memberRoleIn.sparql @@ -8,4 +8,4 @@ CONSTRUCT { ?memberRole a core:MemberRole . ?memberRole core:roleContributesTo ?endeavor . ?endeavor ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/outreach/outreachRoleIn.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/outreach/outreachRoleIn.sparql index c0c6e60a..c05fc791 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/outreach/outreachRoleIn.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/outreach/outreachRoleIn.sparql @@ -8,4 +8,4 @@ CONSTRUCT { ?outreachRole a core:OutreachProviderRole . ?outreachRole core:roleContributesTo ?endeavor . ?endeavor ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/patent/assignee.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/patent/assignee.sparql index 48c11d30..1fbea855 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/patent/assignee.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/patent/assignee.sparql @@ -3,12 +3,12 @@ PREFIX rdf: PREFIX bibo: CONSTRUCT { - ?assignee ?property ?object . + ?assignee ?property ?object . } WHERE { PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . - ?authorship core:relates ?patent . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent core:assignee ?assignee . - ?assignee ?property ?object . -} \ No newline at end of file + ?assignee ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/patent/inventors.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/patent/inventors.sparql index f14a7994..e9068d0b 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/patent/inventors.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/patent/inventors.sparql @@ -4,13 +4,13 @@ PREFIX bibo: PREFIX foaf: CONSTRUCT { - ?person ?property ?object . + ?person ?property ?object . } WHERE { PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . - ?authorship core:relates ?patent . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?authorship core:relates ?person . ?person a foaf:Person . - ?person ?property ?object . -} \ No newline at end of file + ?person ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patent.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patent.sparql index 2cd24159..3d76a500 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patent.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patent.sparql @@ -5,9 +5,9 @@ PREFIX bibo: CONSTRUCT { ?patent ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentFiledDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentFiledDate.sparql index 13dd7506..f47fe12d 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentFiledDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentFiledDate.sparql @@ -14,4 +14,4 @@ CONSTRUCT { ?date ?property ?object . ?date core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentIssuedDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentIssuedDate.sparql index 16785dc4..7d1689b3 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentIssuedDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/patent/patentIssuedDate.sparql @@ -14,4 +14,4 @@ CONSTRUCT { ?date ?property ?object . ?date core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/position/locationForPosition.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/position/locationForPosition.sparql index e1ad43bc..1b2cd386 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/position/locationForPosition.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/position/locationForPosition.sparql @@ -7,10 +7,10 @@ CONSTRUCT { ?organization core:hasGeographicLocation ?geographicLocation . ?geographicLocation rdfs:label ?label . } WHERE { - PERSON_URI core:relatedBy ?position . + PERSON_URI core:relatedBy ?position . ?position a core:Position . ?position core:relates ?organization . - ?organization a foaf:Organization . + ?organization a foaf:Organization . ?organization obo:RO_0001025 ?geographicLocation . ?geographicLocation rdfs:label ?label . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/position/organizationForPosition.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/position/organizationForPosition.sparql index dd9d5e0d..164c65f0 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/position/organizationForPosition.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/position/organizationForPosition.sparql @@ -6,9 +6,9 @@ CONSTRUCT { ?position core:positionInOrganization ?organization . ?organization rdfs:label ?label . } WHERE { - PERSON_URI core:relatedBy ?position . + PERSON_URI core:relatedBy ?position . ?position a core:Position . ?position core:relates ?organization . - ?organization a foaf:Organization . + ?organization a foaf:Organization . ?organization rdfs:label ?label . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/position/subOrganizationForPosition.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/position/subOrganizationForPosition.sparql index 6748f690..ae08da7c 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/position/subOrganizationForPosition.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/position/subOrganizationForPosition.sparql @@ -7,10 +7,10 @@ CONSTRUCT { ?organization core:hasSubOrganization ?subOrganization . ?subOrganization rdfs:label ?label . } WHERE { - PERSON_URI core:relatedBy ?position . + PERSON_URI core:relatedBy ?position . ?position a core:Position . ?position core:relates ?organization . - ?organization a foaf:Organization . + ?organization a foaf:Organization . ?organization obo:BFO_0000050 ?subOrganization . ?subOrganization rdfs:label ?label . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/position/superOrganizationForPosition.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/position/superOrganizationForPosition.sparql index 83f53147..3e5944b8 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/position/superOrganizationForPosition.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/position/superOrganizationForPosition.sparql @@ -5,10 +5,10 @@ PREFIX obo: CONSTRUCT { ?superOrganization ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?position . + PERSON_URI core:relatedBy ?position . ?position a core:Position . ?position core:relates ?organization . - ?organization a foaf:Organization . + ?organization a foaf:Organization . ?organization obo:BFO_0000051 ?superOrganization . ?superOrganization ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/presentation/meetingName.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/presentation/meetingName.sparql index cb0c8b06..94c35fdb 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/presentation/meetingName.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/presentation/meetingName.sparql @@ -10,4 +10,4 @@ CONSTRUCT { ?presenterRole obo:BFO_0000054 ?presentation . ?presentation obo:BFO_0000050 ?containingEvent . ?containingEvent rdfs:label ?containingEventName -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/presentation/presenterRoleIn.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/presentation/presenterRoleIn.sparql index b4b46ff6..6ae4ae56 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/presentation/presenterRoleIn.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/presentation/presenterRoleIn.sparql @@ -3,12 +3,12 @@ PREFIX rdfs: PREFIX obo: CONSTRUCT { - ?presentation rdfs:label ?presentationTitle . + ?presentation rdfs:label ?presentationTitle . ?presenterRole rdfs:label ?roleLabel . } WHERE { PERSON_URI obo:RO_0000053 ?presenterRole . ?presenterRole a core:PresenterRole . ?presenterRole rdfs:label ?roleLAbel . - ?presenterRole obo:BFO_0000054 ?presentation . + ?presenterRole obo:BFO_0000054 ?presentation . ?presentation rdfs:label ?presentationTitle . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/associatedJournal.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/associatedJournal.sparql index bf2582cb..36f977ed 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/associatedJournal.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/associatedJournal.sparql @@ -2,12 +2,12 @@ PREFIX core: PREFIX obo: CONSTRUCT { - ?publicationVenue ?property ?object . + ?publicationVenue ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication core:hasPublicationVenue ?publicationVenue . - ?publicationVenue ?property ?object . -} \ No newline at end of file + ?publicationVenue ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/authors.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/authors.sparql index bc1105b1..06f0a510 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/authors.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/authors.sparql @@ -4,9 +4,9 @@ PREFIX foaf: CONSTRUCT { ?coAuthorship ?property1 ?object1 . - ?person ?property2 ?object2 . + ?person ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . @@ -16,4 +16,4 @@ CONSTRUCT { ?coAuthorship core:relates ?person . ?person a foaf:Person . ?person ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEvent.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEvent.sparql index a7e4bb34..20cbb177 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEvent.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEvent.sparql @@ -6,10 +6,10 @@ PREFIX bibo: CONSTRUCT { ?event ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . ?event ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql index 6e3cfd94..439e8c73 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql @@ -6,7 +6,7 @@ CONSTRUCT { ?endDate ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . @@ -16,4 +16,4 @@ CONSTRUCT { ?dateTimeInterval core:end ?endDate . ?endDate core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql index ebddb52e..fdf1e048 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql @@ -6,11 +6,11 @@ PREFIX obo: CONSTRUCT { ?location rdfs:label ?locationName . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . ?event obo:RO_0001025 ?location . ?location rdfs:label ?locationName . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql index 3a85c078..2253b21b 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql @@ -6,7 +6,7 @@ CONSTRUCT { ?startDate ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . @@ -16,4 +16,4 @@ CONSTRUCT { ?dateTimeInterval core:start ?startDate . ?startDate core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publication.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publication.sparql index 1ab4318a..80e84f93 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publication.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publication.sparql @@ -4,9 +4,9 @@ PREFIX obo: CONSTRUCT { ?publication ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationDate.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationDate.sparql index 0f2fb63d..05b3c6a5 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationDate.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationDate.sparql @@ -5,7 +5,7 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . @@ -13,4 +13,4 @@ CONSTRUCT { ?date ?property ?object . ?date core:dateTimePrecision ?precision . ?precision ?property2 ?object2 . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql index f37a43dc..52651230 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql @@ -4,10 +4,10 @@ PREFIX obo: CONSTRUCT { ?informationResource ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication obo:BFO_0000050 ?informationResource . ?informationResource ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationReproducedIn.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationReproducedIn.sparql index 3b751a9e..529a953a 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationReproducedIn.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationReproducedIn.sparql @@ -3,12 +3,12 @@ PREFIX bibo: PREFIX obo: CONSTRUCT { - ?informationResource ?property ?object . + ?informationResource ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication bibo:reproducedIn ?informationResource . - ?informationResource ?property ?object . -} \ No newline at end of file + ?informationResource ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationStatus.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationStatus.sparql index e1cb2f25..d2eb5bf2 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationStatus.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationStatus.sparql @@ -5,10 +5,10 @@ PREFIX obo: CONSTRUCT { ?publicationStatus ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication bibo:status ?publicationStatus . ?publicationStatus ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationURL.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationURL.sparql index 47f0de80..b4463280 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationURL.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publicationURL.sparql @@ -5,11 +5,11 @@ PREFIX vcard: CONSTRUCT { ?urllink ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication obo:ARG_2000028 ?vcard . ?vcard vcard:hasURL ?urllink . ?urllink ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant1.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant1.sparql index 4ae35fd0..f2f599b1 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant1.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant1.sparql @@ -2,13 +2,13 @@ PREFIX core: PREFIX obo: CONSTRUCT { - ?publisher ?property ?object . + ?publisher ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . ?publication core:hasPublicationVenue ?publicationVenue . - ?publicationVenue core:publisher ?publisher . - ?publisher ?property ?object . -} \ No newline at end of file + ?publicationVenue core:publisher ?publisher . + ?publisher ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant2.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant2.sparql index 6d552625..62150313 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant2.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/publication/publisher_variant2.sparql @@ -2,12 +2,12 @@ PREFIX core: PREFIX obo: CONSTRUCT { - ?publisher ?property ?object . + ?publisher ?property ?object . } WHERE { - PERSON_URI core:relatedBy ?authorship . + PERSON_URI core:relatedBy ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?publication . ?publication a obo:IAO_0000030 . - ?publication core:publisher ?publisher . - ?publisher ?property ?object . -} \ No newline at end of file + ?publication core:publisher ?publisher . + ?publisher ?property ?object . +} diff --git a/webapp/src/main/webapp/WEB-INF/rich-export/teaching/teacherRoleIn.sparql b/webapp/src/main/webapp/WEB-INF/rich-export/teaching/teacherRoleIn.sparql index 76ec8cdd..adc06cd4 100644 --- a/webapp/src/main/webapp/WEB-INF/rich-export/teaching/teacherRoleIn.sparql +++ b/webapp/src/main/webapp/WEB-INF/rich-export/teaching/teacherRoleIn.sparql @@ -8,4 +8,4 @@ CONSTRUCT { ?teacherRole a core:TeacherRole . ?teacherRole obo:BFO_0000054 ?course . ?course ?property ?object . -} \ No newline at end of file +} diff --git a/webapp/src/main/webapp/WEB-INF/springmvc-beans.xml b/webapp/src/main/webapp/WEB-INF/springmvc-beans.xml index 057a92fe..11715102 100644 --- a/webapp/src/main/webapp/WEB-INF/springmvc-beans.xml +++ b/webapp/src/main/webapp/WEB-INF/springmvc-beans.xml @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/webapp/src/main/webapp/WEB-INF/visualization/visualizations-beans-injection-fm.xml b/webapp/src/main/webapp/WEB-INF/visualization/visualizations-beans-injection-fm.xml index acc2e5a7..ea5f11d5 100644 --- a/webapp/src/main/webapp/WEB-INF/visualization/visualizations-beans-injection-fm.xml +++ b/webapp/src/main/webapp/WEB-INF/visualization/visualizations-beans-injection-fm.xml @@ -1,142 +1,142 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/src/main/webapp/WEB-INF/web.xml b/webapp/src/main/webapp/WEB-INF/web.xml index 3297931e..706e999d 100644 --- a/webapp/src/main/webapp/WEB-INF/web.xml +++ b/webapp/src/main/webapp/WEB-INF/web.xml @@ -42,9 +42,9 @@ - edu.cornell.mannlib.vitro.webapp.startup.StartupManager @@ -159,7 +159,7 @@ --> - + css text/css @@ -212,7 +212,7 @@ xml application/xml - + diff --git a/webapp/src/main/webapp/config/listViewConfig-additionalEmail.xml b/webapp/src/main/webapp/config/listViewConfig-additionalEmail.xml index dbb8f48d..ecc565ca 100644 --- a/webapp/src/main/webapp/config/listViewConfig-additionalEmail.xml +++ b/webapp/src/main/webapp/config/listViewConfig-additionalEmail.xml @@ -4,10 +4,10 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - - SELECT DISTINCT ?vcard + + SELECT DISTINCT ?vcard ?email ?emailAddress WHERE { @@ -19,7 +19,7 @@ ?vcard vcard:hasEmail ?email . ?email a vcard:Work . } - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml b/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml index 57320ed9..9acb938c 100644 --- a/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml +++ b/webapp/src/main/webapp/config/listViewConfig-adviseeIn.xml @@ -6,7 +6,7 @@ PREFIX foaf: <http://xmlns.com/foaf/0.1/> - + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> diff --git a/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml b/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml index cc614d4c..211f5c7e 100644 --- a/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml +++ b/webapp/src/main/webapp/config/listViewConfig-dateTimeInterval.xml @@ -7,7 +7,7 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - + SELECT DISTINCT ?dateTimeInterval ?label ?valueStart ?valueStartName diff --git a/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml b/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml index 59c77030..d2eae7b8 100644 --- a/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml +++ b/webapp/src/main/webapp/config/listViewConfig-dateTimeValue.xml @@ -4,13 +4,13 @@ - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - - - SELECT DISTINCT ?dateTimeValue - (REPLACE(STR(?dateTimePrecision),"^.*(#)(.*)$", "$2") AS ?precision) + + + SELECT DISTINCT ?dateTimeValue + (REPLACE(STR(?dateTimePrecision),"^.*(#)(.*)$", "$2") AS ?precision) ?dateTime WHERE { ?subject ?property ?dateTimeValue . @@ -25,7 +25,7 @@ FILTER ( bound(?dateTime) ) - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-default.xml b/webapp/src/main/webapp/config/listViewConfig-default.xml index 46d9825f..b497c41f 100644 --- a/webapp/src/main/webapp/config/listViewConfig-default.xml +++ b/webapp/src/main/webapp/config/listViewConfig-default.xml @@ -1,13 +1,13 @@ - - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-degreeEarned.xml b/webapp/src/main/webapp/config/listViewConfig-degreeEarned.xml index 6dd9e478..5245714e 100644 --- a/webapp/src/main/webapp/config/listViewConfig-degreeEarned.xml +++ b/webapp/src/main/webapp/config/listViewConfig-degreeEarned.xml @@ -4,15 +4,15 @@ - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?awardedDegree ?degree - ?degreeName - ?degreeAbbr + ?degreeName + ?degreeAbbr WHERE { ?subject ?property ?awardedDegree . ?awardedDegree a core:AwardedDegree . @@ -26,7 +26,7 @@ ?degree a core:AcademicDegree . ?degree core:abbreviation ?degreeAbbr . } - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-doi.xml b/webapp/src/main/webapp/config/listViewConfig-doi.xml index 5df4045c..3cd5e6ae 100644 --- a/webapp/src/main/webapp/config/listViewConfig-doi.xml +++ b/webapp/src/main/webapp/config/listViewConfig-doi.xml @@ -1,13 +1,13 @@ - - - + + SELECT ?value WHERE { ?subject ?property ?value . diff --git a/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml b/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml index c7ede94f..dec47497 100644 --- a/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml +++ b/webapp/src/main/webapp/config/listViewConfig-fauxPropertyDefault.xml @@ -1,13 +1,13 @@ - - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-faxNumber.xml b/webapp/src/main/webapp/config/listViewConfig-faxNumber.xml index f6ec1fda..5b6a5a96 100644 --- a/webapp/src/main/webapp/config/listViewConfig-faxNumber.xml +++ b/webapp/src/main/webapp/config/listViewConfig-faxNumber.xml @@ -4,9 +4,9 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - + SELECT DISTINCT ?vcard ?phone ?number WHERE { @@ -14,7 +14,7 @@ ?vcard vcard:hasTelephone ?phone . ?phone a vcard:Fax . ?phone vcard:telephone ?number . - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-fullName.xml b/webapp/src/main/webapp/config/listViewConfig-fullName.xml index fac875a0..1c5df79b 100644 --- a/webapp/src/main/webapp/config/listViewConfig-fullName.xml +++ b/webapp/src/main/webapp/config/listViewConfig-fullName.xml @@ -4,10 +4,10 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> PREFIX core: <http://vivoweb.org/ontology/core#> - + SELECT DISTINCT ?vcard ?fullName ?firstName ?middleName @@ -42,7 +42,7 @@ ?vcard vcard:hasName ?fullName . ?fullName vcard:honorificPrefix ?prefix . } - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-grantAdministeredBy.xml b/webapp/src/main/webapp/config/listViewConfig-grantAdministeredBy.xml index d2254f73..c3a05eba 100644 --- a/webapp/src/main/webapp/config/listViewConfig-grantAdministeredBy.xml +++ b/webapp/src/main/webapp/config/listViewConfig-grantAdministeredBy.xml @@ -4,7 +4,7 @@ - + PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml b/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml index c7c036f2..9d563cc6 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasAssociatedConcept.xml @@ -1,34 +1,34 @@ - - - - - - - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX vivo: <http://vivoweb.org/ontology/core#> - PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> - - - SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName - WHERE { - ?subject ?property ?concept . - LET (?conceptName := REPLACE(STR(?concept),"^.*(#)(.*)$", "$2")) - OPTIONAL { - ?subject ?property ?concept . - ?concept rdfs:label ?conceptLabel . - } - OPTIONAL { - ?subject ?property ?concept . - ?concept rdfs:isDefinedBy ?vocabularySource . - OPTIONAL { - ?subject ?property ?concept . - ?concept rdfs:isDefinedBy ?vocabularySource . - ?vocabularySource rdfs:label ?vocabularySourceName . - } - } - } ORDER BY ?conceptLabel ?conceptName - - - - + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vivo: <http://vivoweb.org/ontology/core#> + PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> + + + SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName + WHERE { + ?subject ?property ?concept . + LET (?conceptName := REPLACE(STR(?concept),"^.*(#)(.*)$", "$2")) + OPTIONAL { + ?subject ?property ?concept . + ?concept rdfs:label ?conceptLabel . + } + OPTIONAL { + ?subject ?property ?concept . + ?concept rdfs:isDefinedBy ?vocabularySource . + OPTIONAL { + ?subject ?property ?concept . + ?concept rdfs:isDefinedBy ?vocabularySource . + ?vocabularySource rdfs:label ?vocabularySourceName . + } + } + } ORDER BY ?conceptLabel ?conceptName + + + + diff --git a/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml index 4bc8616f..3b7bc325 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasAttendeeRole.xml @@ -5,7 +5,7 @@ - + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX vivo: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> diff --git a/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml index 5c53b029..b6442841 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml @@ -5,7 +5,7 @@ - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml index f5a204df..c87854f0 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasEditorRole.xml @@ -4,20 +4,20 @@ - - + + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass ?role ?subclassLabel - ?activity + ?activity (REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal) ?activityName - ?dateTimeStart - ?dateTimeEnd + ?dateTimeStart + ?dateTimeEnd WHERE { ?subject ?property ?role . ?role a core:EditorRole . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml index e6e6eac4..df031ec9 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasInvestigatorRole.xml @@ -5,7 +5,7 @@ - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml index c14ca951..7d0aa24f 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasPresenterRole.xml @@ -7,22 +7,22 @@ - - + + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX vivo: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass - ?role ?roleLabel + ?role ?roleLabel ?presentation ?presentationName ?presentationLabel ?conference ?conferenceLabel ?series ?seriesLabel - ?workshop + ?workshop ?dateTime - + WHERE { ?subject ?property ?role . ?role a vivo:PresenterRole . diff --git a/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml index d7742082..9a0fab66 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasPrincipalInvestigatorRole.xml @@ -5,7 +5,7 @@ - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml index 81e587c2..403f86d5 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasReviewerRole.xml @@ -4,20 +4,20 @@ - - + + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass ?role ?subclassLabel - ?activity + ?activity (REPLACE(STR(?activity),"^.*(#)(.*)$", "$2") AS ?activityLocal) ?activityName - ?dateTimeStart - ?dateTimeEnd + ?dateTimeStart + ?dateTimeEnd WHERE { ?subject ?property ?role . ?role a core:ReviewerRole . @@ -49,7 +49,7 @@ ?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeEndValue core:dateTime ?dateTimeEnd . } - + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName diff --git a/webapp/src/main/webapp/config/listViewConfig-hasRole.xml b/webapp/src/main/webapp/config/listViewConfig-hasRole.xml index 1b9bbbe5..51bf20ec 100644 --- a/webapp/src/main/webapp/config/listViewConfig-hasRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-hasRole.xml @@ -4,25 +4,25 @@ - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass # send the property to the template, since this view supports multiple role properties ?property - ?role - ?roleLabel - ?activity ?activityName + ?role + ?roleLabel + ?activity ?activityName ?activityLabel - ?dateTimeStart ?dateTimeEnd + ?dateTimeStart ?dateTimeEnd ?hideThis ?objectType - WHERE { + WHERE { ?subject ?property ?role . ?role a ?objectType . - + OPTIONAL { ?subject ?property ?role . ?role a ?objectType . @@ -31,17 +31,17 @@ ?activity vitro:mostSpecificType ?subclass . - } + } OPTIONAL { ?subject ?property ?role . ?role a ?objectType . ?role core:roleContributesTo ?activity . ?activity rdfs:label ?activityLabel . - + ?activity vitro:mostSpecificType ?subclass . - } + } OPTIONAL { ?subject ?property ?role . ?role a ?objectType . diff --git a/webapp/src/main/webapp/config/listViewConfig-informationResourceInEditorship.xml b/webapp/src/main/webapp/config/listViewConfig-informationResourceInEditorship.xml index 1b3ef35f..11d43f4a 100644 --- a/webapp/src/main/webapp/config/listViewConfig-informationResourceInEditorship.xml +++ b/webapp/src/main/webapp/config/listViewConfig-informationResourceInEditorship.xml @@ -4,16 +4,16 @@ - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX fn: <http://www.w3.org/2005/xpath-functions#> - + SELECT DISTINCT ?subclass ?editorship - ?person ?personName + ?person ?personName WHERE { ?subject ?property ?editorship . ?editorship a core:Editorship . @@ -42,7 +42,7 @@ FILTER ( bound(?person) ) - } ORDER BY ?subclass ?rank (fn:lower-case(?personName)) + } ORDER BY ?subclass ?rank (fn:lower-case(?personName)) diff --git a/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml b/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml index 0cc27b44..1e741ae9 100644 --- a/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml +++ b/webapp/src/main/webapp/config/listViewConfig-issuedCredential.xml @@ -4,9 +4,9 @@ - + PREFIX foaf: <http://xmlns.com/foaf/0.1/> - + PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX owl: <http://www.w3.org/2002/07/owl#> diff --git a/webapp/src/main/webapp/config/listViewConfig-mailingAddress.xml b/webapp/src/main/webapp/config/listViewConfig-mailingAddress.xml index ac9e40b6..1a5bd4f9 100644 --- a/webapp/src/main/webapp/config/listViewConfig-mailingAddress.xml +++ b/webapp/src/main/webapp/config/listViewConfig-mailingAddress.xml @@ -4,16 +4,16 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - + SELECT DISTINCT ?vcard ?address ?street - ?locality + ?locality ?region ?postalCode - ?country - + ?country + WHERE { ?subject ?property ?vcard . ?vcard vcard:hasAddress ?address . @@ -42,7 +42,7 @@ ?vcard vcard:hasAddress ?address . ?address vcard:country ?country . } - + } ORDER BY ?country ?region ?street diff --git a/webapp/src/main/webapp/config/listViewConfig-orcidId.xml b/webapp/src/main/webapp/config/listViewConfig-orcidId.xml index e9bd44dd..67686c27 100644 --- a/webapp/src/main/webapp/config/listViewConfig-orcidId.xml +++ b/webapp/src/main/webapp/config/listViewConfig-orcidId.xml @@ -1,12 +1,12 @@ - - + SELECT ?value WHERE { ?subject ?property ?value . diff --git a/webapp/src/main/webapp/config/listViewConfig-organizationAdministersGrant.xml b/webapp/src/main/webapp/config/listViewConfig-organizationAdministersGrant.xml index fb960762..fcc09d57 100644 --- a/webapp/src/main/webapp/config/listViewConfig-organizationAdministersGrant.xml +++ b/webapp/src/main/webapp/config/listViewConfig-organizationAdministersGrant.xml @@ -4,7 +4,7 @@ - + PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-organizationAwardsGrant.xml b/webapp/src/main/webapp/config/listViewConfig-organizationAwardsGrant.xml index fd6d2547..522179de 100644 --- a/webapp/src/main/webapp/config/listViewConfig-organizationAwardsGrant.xml +++ b/webapp/src/main/webapp/config/listViewConfig-organizationAwardsGrant.xml @@ -4,7 +4,7 @@ - + PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-organizationForTraining.xml b/webapp/src/main/webapp/config/listViewConfig-organizationForTraining.xml index 45265b9e..4763c9d3 100644 --- a/webapp/src/main/webapp/config/listViewConfig-organizationForTraining.xml +++ b/webapp/src/main/webapp/config/listViewConfig-organizationForTraining.xml @@ -4,20 +4,20 @@ - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - - SELECT DISTINCT ?subclass - ?edTraining - ?person ?personName + + SELECT DISTINCT ?subclass + ?edTraining + ?person ?personName ?awardedDegree ?degree - ?degreeName ?degreeAbbr - ?majorField ?info - ?dateTimeStart ?dateTimeEnd + ?degreeName ?degreeAbbr + ?majorField ?info + ?dateTimeStart ?dateTimeEnd WHERE { ?subject ?property ?edTraining . ?edTraining a core:EducationalProcess . diff --git a/webapp/src/main/webapp/config/listViewConfig-preferredTitle.xml b/webapp/src/main/webapp/config/listViewConfig-preferredTitle.xml index 8f79c172..9cdaa46a 100644 --- a/webapp/src/main/webapp/config/listViewConfig-preferredTitle.xml +++ b/webapp/src/main/webapp/config/listViewConfig-preferredTitle.xml @@ -4,18 +4,18 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - - SELECT DISTINCT ?vcard + + SELECT DISTINCT ?vcard ?title ?preferredTitle WHERE { ?subject ?property ?vcard . ?vcard vcard:hasTitle ?title . ?title vcard:title ?preferredTitle . - - } + + } diff --git a/webapp/src/main/webapp/config/listViewConfig-primaryEmail.xml b/webapp/src/main/webapp/config/listViewConfig-primaryEmail.xml index 0a34cd09..32a26ebe 100644 --- a/webapp/src/main/webapp/config/listViewConfig-primaryEmail.xml +++ b/webapp/src/main/webapp/config/listViewConfig-primaryEmail.xml @@ -4,9 +4,9 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - + SELECT DISTINCT ?vcard ?email ?emailAddress WHERE { @@ -14,8 +14,8 @@ ?vcard vcard:hasEmail ?email . ?email a vcard:Work . ?email vcard:email ?emailAddress . - - } + + } diff --git a/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml b/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml index 236fde80..acca40d3 100644 --- a/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml +++ b/webapp/src/main/webapp/config/listViewConfig-rangeUnion.xml @@ -1,13 +1,13 @@ - - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> diff --git a/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml b/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml index 55bbe9b7..193fa951 100644 --- a/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml +++ b/webapp/src/main/webapp/config/listViewConfig-relatedRole.xml @@ -5,24 +5,24 @@ - + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX core: <http://vivoweb.org/ontology/core#> - + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - + SELECT DISTINCT ?subclass ?vSubclass # send the property to the template, since this view supports multiple role properties ?property - ?role - ?roleLabel ?roleTypeLabel + ?role + ?roleLabel ?roleTypeLabel ?indivInRole (REPLACE(STR(?indivInRole),"^.*(#)(.*)$", "$2") AS ?indivName) ?indivLabel ?dateTimeInterval ?dateTimeStart ?dateTimeEnd ?objectType WHERE { - + ?subject ?property ?role . ?role a ?objectType . @@ -32,7 +32,7 @@ ?role rdfs:label ?roleLabel . } - # We need ?subclass in the uncollated query to get the roleTypeLabel + # We need ?subclass in the uncollated query to get the roleTypeLabel # for roles that have no label. OPTIONAL { ?subject ?property ?role . @@ -83,7 +83,7 @@ bind ( COALESCE(?middleName, "") As ?middleName1) . bind ( COALESCE(?lastName, "") As ?lastName1) . bind (concat(str(?lastName1 + ", "),str(?firstName1 + " "),str(?middleName1)) as ?indivLabel) . - + OPTIONAL { ?subject ?property ?role . ?role a ?objectType . @@ -109,7 +109,7 @@ } FILTER ( bound(?indivInRole) ) - + } ORDER BY ?subclass ?indivLabel ?roleLabel ?roleTypeLabel ?indivName diff --git a/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml b/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml index 79a217e7..549c41d0 100644 --- a/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml +++ b/webapp/src/main/webapp/config/listViewConfig-researchAreaOf.xml @@ -1,29 +1,29 @@ - - + PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - PREFIX fn: <http://www.w3.org/2005/xpath-functions#> + PREFIX fn: <http://www.w3.org/2005/xpath-functions#> SELECT DISTINCT - ?person + ?person ?personName ?posnLabel ?org ?orgLabel - ?title + ?title ?dateTimeEnd - WHERE { + WHERE { ?subject ?property ?person . OPTIONAL { ?subject ?property ?person . @@ -61,7 +61,7 @@ ?dateTimeEndValue core:dateTime ?dateTimeEnd . FILTER ( ?dateTimeEnd < now() ) } - } + } ORDER BY (fn:lower-case(?personName)) (bound(?dateTimeEnd)) desc(?dateTimeEnd) diff --git a/webapp/src/main/webapp/config/listViewConfig-roleContributesTo.xml b/webapp/src/main/webapp/config/listViewConfig-roleContributesTo.xml index 7353486c..dd87a529 100644 --- a/webapp/src/main/webapp/config/listViewConfig-roleContributesTo.xml +++ b/webapp/src/main/webapp/config/listViewConfig-roleContributesTo.xml @@ -1,51 +1,51 @@ - - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass # send the property to the template, since this view supports multiple role properties ?property - ?role - ?roleLabel - ?activity ?activityName + ?role + ?roleLabel + ?activity ?activityName ?activityLabel - ?dateTimeStart ?dateTimeEnd + ?dateTimeStart ?dateTimeEnd ?hideThis ?objectType - WHERE { + WHERE { ?subject ?property ?role . ?role a ?objectType . - + OPTIONAL { ?subject ?property ?role . ?role a ?objectType . ?role core:roleContributesTo ?activity . ?activity rdfs:label ?activityLabel . - + ?activity vitro:mostSpecificType ?subclass . - } + } OPTIONAL { ?subject ?property ?role . ?role a ?objectType . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . ?activity rdfs:label ?activityLabel . - + ?activity vitro:mostSpecificType ?subclass . - } + } OPTIONAL { ?subject ?property ?role . ?role a ?objectType . diff --git a/webapp/src/main/webapp/config/listViewConfig-roleRealizedIn.xml b/webapp/src/main/webapp/config/listViewConfig-roleRealizedIn.xml index 8933676d..4aef99e6 100644 --- a/webapp/src/main/webapp/config/listViewConfig-roleRealizedIn.xml +++ b/webapp/src/main/webapp/config/listViewConfig-roleRealizedIn.xml @@ -4,22 +4,22 @@ - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - + SELECT DISTINCT ?subclass # send the property to the template, since this view supports multiple role properties ?property - ?role - ?roleLabel - ?activity ?activityName + ?role + ?roleLabel + ?activity ?activityName ?activityLabel - ?dateTimeStart ?dateTimeEnd + ?dateTimeStart ?dateTimeEnd ?hideThis ?objectType - WHERE { + WHERE { ?subject ?property ?role . ?role a ?objectType . @@ -47,7 +47,7 @@ ?activity vitro:mostSpecificType ?subclass . - } + } OPTIONAL { ?subject ?property ?role . ?role a ?objectType . diff --git a/webapp/src/main/webapp/config/listViewConfig-scopusId.xml b/webapp/src/main/webapp/config/listViewConfig-scopusId.xml index a508574e..e910dc9e 100644 --- a/webapp/src/main/webapp/config/listViewConfig-scopusId.xml +++ b/webapp/src/main/webapp/config/listViewConfig-scopusId.xml @@ -1,19 +1,19 @@ - - - + + SELECT ?value WHERE { - + ?subject ?property ?value . - FILTER isLiteral(?value) - + FILTER isLiteral(?value) + } ORDER BY ?value diff --git a/webapp/src/main/webapp/config/listViewConfig-telephoneNumber.xml b/webapp/src/main/webapp/config/listViewConfig-telephoneNumber.xml index e4cd4a3f..97ac5991 100644 --- a/webapp/src/main/webapp/config/listViewConfig-telephoneNumber.xml +++ b/webapp/src/main/webapp/config/listViewConfig-telephoneNumber.xml @@ -4,21 +4,21 @@ - + PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - + SELECT DISTINCT ?vcard ?phone ?number WHERE { ?subject ?property ?vcard . - ?vcard vcard:hasTelephone ?phone . + ?vcard vcard:hasTelephone ?phone . ?phone vcard:telephone ?number . MINUS { ?subject ?property ?vcard . ?vcard vcard:hasTelephone ?phone . ?phone a vcard:Fax . } - } + } diff --git a/webapp/src/main/webapp/config/listViewConfig-webpage.xml b/webapp/src/main/webapp/config/listViewConfig-webpage.xml index 9fb75901..d6d4a5c2 100644 --- a/webapp/src/main/webapp/config/listViewConfig-webpage.xml +++ b/webapp/src/main/webapp/config/listViewConfig-webpage.xml @@ -2,20 +2,20 @@ + + See guidelines at https://wiki.duraspace.org/x/eYXVAw --> - - + + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> - SELECT ?vcard ?link - (REPLACE(STR(?link),"^.*(#)(.*)$", "$2") AS ?linkName) + SELECT ?vcard ?link + (REPLACE(STR(?link),"^.*(#)(.*)$", "$2") AS ?linkName) (group_concat(distinct ?linkLabel;separator="/") as ?label) - ?url + ?url ?rank WHERE { ?subject ?property ?vcard . @@ -36,8 +36,8 @@ ?link core:rank ?rank . } - FILTER ( bound(?link) ) - + FILTER ( bound(?link) ) + } GROUP BY ?vcard ?link ?url ?rank ORDER BY ?rank ?linkLabel diff --git a/webapp/src/main/webapp/css/home-page-maps.css b/webapp/src/main/webapp/css/home-page-maps.css index 5a78685e..9e004e03 100644 --- a/webapp/src/main/webapp/css/home-page-maps.css +++ b/webapp/src/main/webapp/css/home-page-maps.css @@ -46,7 +46,7 @@ div#researcherTotal { text-align: center; width: 170px; margin-top:-60px; -} +} .leaflet-popup-content { line-height: 1.4; margin: 8px 8px; diff --git a/webapp/src/main/webapp/css/individual/individual-2column-view.css b/webapp/src/main/webapp/css/individual/individual-2column-view.css index 9478e24b..e1c35dcb 100644 --- a/webapp/src/main/webapp/css/individual/individual-2column-view.css +++ b/webapp/src/main/webapp/css/individual/individual-2column-view.css @@ -3,7 +3,7 @@ /* <------ INDIVIDUAL INTRO */ #individual-intro { margin-top: 15px; - margin-bottom: 0px; + margin-bottom: 0px; position: relative; overflow: hidden; } @@ -13,7 +13,7 @@ width: 166px; float: left; padding-right: 1.5em; - margin-right: 12px; + margin-right: 12px; margin-bottom: 20px; } img.individual-photo { @@ -21,7 +21,7 @@ img.individual-photo { margin-left: 0; float: left; margin-right: 20px; - margin-bottom: 10px; + margin-bottom: 10px; } ul#phone-list { font-size:0.9em; @@ -29,14 +29,14 @@ ul#phone-list { ul#individual-phone { clear: both; list-style-type: circle; - margin-top:-8px; + margin-top:-8px; } #primary-email { - margin-top: 0; + margin-top: 0; } -#primary-email li:last-child, +#primary-email li:last-child, #additional-emails li:last-child { - margin-bottom: 0; + margin-bottom: 0; } /* <------ INDIVIDUAL INTRO - RIGHT SIDE CONTENT */ @@ -59,8 +59,8 @@ div#titleContainer { margin-top:6px; } #individual-info h2 { - padding: 25px 0 10px 0; - clear:both; + padding: 25px 0 10px 0; + clear:both; } #individual-info h2#contactHeading { margin-bottom: 8px; @@ -73,14 +73,14 @@ h3.primary-email { margin-top: -8px !important; } #individual-intro.person { - margin-bottom: 0; + margin-bottom: 0; position: relative; width: 100%; } #individual-info h1.foaf-person { float:left; padding-right:8px; - height:20px; + height:20px; margin:-3px 8px 5px 0; } div#profileTypeContainer { @@ -115,32 +115,32 @@ span.iconControlsEditable { span.iconControlsNotEditable { position:absolute; right:0; - top:3px; + top:3px; } #overview { - clear: both; + clear: both; } /* <------ INDIVIDUAL VISUALIZATION */ #visualization { - padding: 0 0 0 0; - background: #fff; - width:174px; - float:none; + padding: 0 0 0 0; + background: #fff; + width:174px; + float:none; } #visualization h3 { padding-top: 10px; - margin-bottom: 0; + margin-bottom: 0; } p#networks { margin-bottom:10px; } -.collaboratorship-link-separator { +.collaboratorship-link-separator { margin-top: 10px; border-top: 1px solid #DDE4E3; padding-top: 10px; } .sparkline_text { - font-size: .9em; + font-size: .9em; text-align: left; line-height: 1.5em; width: 180px; @@ -148,7 +148,7 @@ p#networks { span.collaboratorship-link a img{ vertical-align:middle; } -td#totalPubs { +td#totalPubs { font-size: 1.35em; background: url(../../images/individual/pub-total-bkgrnd.png) top left no-repeat; text-align:center; @@ -156,7 +156,7 @@ td#totalPubs { width:48px; height:48px; } -td#tenYearCount { +td#tenYearCount { font-size: .85em; padding-left:10px; vertical-align:middle; @@ -165,37 +165,37 @@ td#tenYearCount { padding-right: 0; } div#pub_count_short_sparkline_vis { - margin-top: 4px; - height: 48px; + margin-top: 4px; + height: 48px; margin-bottom: 20px; } /* <------ INDIVIDUAL TEMPORAL GRAPH & MAP O' SCIENCE*/ #temporal-graph { - padding: 0 3px 8px 0; + padding: 0 3px 8px 0; background-color: #fff; - margin-top: -4px; + margin-top: -4px; } #temporal-graph h3 img, #map-of-science h3 img { padding-right: 10px; - vertical-align: middle; + vertical-align: middle; } #map-of-science { - padding: 0 3px 24px 0; + padding: 0 3px 24px 0; background-color: #fff; } /* <------ POSITIONS */ ul#individual-personInPosition { list-style-type: circle; - padding-left: 10px; - margin: 10px 0 0 0; + padding-left: 10px; + margin: 10px 0 0 0; } ul#individual-personInPosition li { line-height: 1em; - padding-bottom:10px; + padding-bottom:10px; } ul#individual-personInPosition li:last-child { - padding-bottom: 3px; + padding-bottom: 3px; } /* <------ CONTACTS AND WEBPAGES */ @@ -234,8 +234,8 @@ div#contactPhoneDiv { ul#individual-hasResearchArea li { float: left; padding-right: 10px; - margin-right: 10px; - padding-left: 0; + margin-right: 10px; + padding-left: 0; border-right: 1px solid #5e6363; } h2#researchAreas { @@ -244,12 +244,12 @@ h2#researchAreas { /* <------ QR Code */ span#qrCodeImage { position: absolute; - top: 30px; - left: -120px !important; - width:180px; + top: 30px; + left: -120px !important; + width:180px; border: solid 2px #ccc; - background: #fff; - text-align:middle; + background: #fff; + text-align:middle; overflow:visible; z-index:1000; } @@ -262,23 +262,23 @@ span#quickViewLink img { margin-top:35px; } /****** FROM WILMA.CSS ******/ -#individual-info h2.mainPropGroup { +#individual-info h2.mainPropGroup { border-bottom: 1px solid #DDE4E3; padding-bottom:1px; margin-bottom:8px; padding-top:18px; } -#individual-info div#contactContainer h3{ - color:#8aa149; +#individual-info div#contactContainer h3{ + color:#8aa149; } ul#individual-personInPosition li { padding-bottom:12px; - margin-left:10px; + margin-left:10px; line-height: 1.25em !important; } -ul#individual-personInPosition li:last-child { +ul#individual-personInPosition li:last-child { padding-bottom: 0; } -td#totalPubs { +td#totalPubs { color: #2485AE; } diff --git a/webapp/src/main/webapp/css/individual/individual-quick-view.css b/webapp/src/main/webapp/css/individual/individual-quick-view.css index 1c674306..fb3e132f 100644 --- a/webapp/src/main/webapp/css/individual/individual-quick-view.css +++ b/webapp/src/main/webapp/css/individual/individual-quick-view.css @@ -47,7 +47,7 @@ section#label-title { margin-left:0 !important; font-size:1em !important; border:none !important; - display:inline-block; + display:inline-block; } div#titleContainer { display:inline-block; @@ -70,12 +70,12 @@ section#label-title h2 { /* <------ QR Code */ span#qrCodeImage { position: absolute; - top: 30px; - left: 76% !important; - width:180px; + top: 30px; + left: 76% !important; + width:180px; border: solid 2px #ccc; - background: #fff; - text-align:middle; + background: #fff; + text-align:middle; overflow:visible; } /* <----- WEBPAGE CONTENT LEFT SIDE -----> */ @@ -93,8 +93,8 @@ span#qrCodeImage { } div#webpage-wrapper { background-color: #e4e8e7; - margin:-7px 0 -16px 0; - padding-bottom:9px; + margin:-7px 0 -16px 0; + padding-bottom:9px; padding-top:3px; display:inline-block; width: 456px; @@ -113,7 +113,7 @@ ul.individual-webpage { padding:18px 0 0 25px ; } ul.individual-webpage li:first-child { - padding: 0 0 0 0; + padding: 0 0 0 0; } ul.individual-webpage li { padding: 5px 5px 0 0; @@ -138,7 +138,7 @@ section#individual-intro { } #individual-intro h1.fn { padding-right:8px; - height:20px; + height:20px; margin:-1px 8px 5px 0; } section.qv-individual-info { @@ -190,14 +190,14 @@ div#profileTypeContainer h2 { /* <------ POSITIONS ------> */ ul#individual-personInPosition { list-style-type: circle; - padding-left: 10px; - margin: 10px 0 0 0; + padding-left: 10px; + margin: 10px 0 0 0; } ul#individual-hasResearchArea li { - float: left; + float: left; padding-right: 10px; - margin-right: 10px; - padding-left: 0; + margin-right: 10px; + padding-left: 0; border-right: 1px solid #5e6363 ; white-space:nowrap !important; } @@ -226,20 +226,20 @@ span#fullViewLink { padding-left:47%; } /****** FROM WILMA.CSS ******/ -#individual-info h2.mainPropGroup { +#individual-info h2.mainPropGroup { border-bottom: 1px solid #DDE4E3; padding-bottom:1px; margin-bottom:8px; } ul#individual-personInPosition li { padding-bottom:12px; - margin-left:10px; + margin-left:10px; line-height: 1.25em !important; } -ul#individual-personInPosition li:last-child { +ul#individual-personInPosition li:last-child { padding-bottom: 0; } #individual-info h2 { - padding: 25px 0 10px 0; - clear:both; + padding: 25px 0 10px 0; + clear:both; } diff --git a/webapp/src/main/webapp/css/individual/individual-vivo.css b/webapp/src/main/webapp/css/individual/individual-vivo.css index 4ae90b79..3881dbcd 100644 --- a/webapp/src/main/webapp/css/individual/individual-vivo.css +++ b/webapp/src/main/webapp/css/individual/individual-vivo.css @@ -211,22 +211,22 @@ h5.qrCode { } span#qrCodeImage { position: absolute; - top: 27px; - left: 175px !important; - width:180px; + top: 27px; + left: 175px !important; + width:180px; border: solid 2px #ccc; - background: #fff; - text-align:middle; + background: #fff; + text-align:middle; overflow:visible; z-index:1000; } span#qrCodeImage img { - padding: 1.7em 1.7em 0 1.7em; + padding: 1.7em 1.7em 0 1.7em; } a.qrCloseLink { - float: right; - padding-right: 1em; - margin-right: 0; + float: right; + padding-right: 1em; + margin-right: 0; font-size: .8em; }/* MISCELLANEOUS------> */ .listDateTime { @@ -246,7 +246,7 @@ a.manageLinks { /* padding-top: 20px; */ } ul#individual-webpage li:first-child { - padding: 0 0 5px 0; + padding: 0 0 5px 0; } ul.webpages-withThumbnails li:nth-child(2) { padding: 105px 0 0 15px; diff --git a/webapp/src/main/webapp/css/jquery_plugins/ui.notify.css b/webapp/src/main/webapp/css/jquery_plugins/ui.notify.css index e699ce1d..ca2775cf 100644 --- a/webapp/src/main/webapp/css/jquery_plugins/ui.notify.css +++ b/webapp/src/main/webapp/css/jquery_plugins/ui.notify.css @@ -1,76 +1,76 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ -.ui-notify { - width: 350px; - position: fixed; - top: 10px; - right: 10px; +.ui-notify { + width: 350px; + position: fixed; + top: 10px; + right: 10px; } -.ui-notify-message { - padding: 10px; - margin-bottom: 15px; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; +.ui-notify-message { + padding: 10px; + margin-bottom: 15px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; } -.ui-notify-message h1 { - font-size: 14px; - margin: 0; - padding: 0; +.ui-notify-message h1 { + font-size: 14px; + margin: 0; + padding: 0; } -.ui-notify-message p { - margin: 3px 0; - padding: 0; - line-height: 18px +.ui-notify-message p { + margin: 3px 0; + padding: 0; + line-height: 18px } -.ui-notify-message:last-child { - margin-bottom: 0; +.ui-notify-message:last-child { + margin-bottom: 0; } -.ui-notify-message-style { - background: #000; - background: rgba(0,0,0,0.8); - -moz-box-shadow: 0 0 6px #000; - -webkit-box-shadow: 0 0 6px #000; - box-shadow: 0 0 6px #000; +.ui-notify-message-style { + background: #000; + background: rgba(0,0,0,0.8); + -moz-box-shadow: 0 0 6px #000; + -webkit-box-shadow: 0 0 6px #000; + box-shadow: 0 0 6px #000; } -.ui-notify-message-style h1 { - color: #fff; +.ui-notify-message-style h1 { + color: #fff; font-weight: bold; } -.ui-notify-message-style p { +.ui-notify-message-style p { color: #fff; } -.ui-notify-close { - color: #fff; +.ui-notify-close { + color: #fff; text-decoration: underline } -.ui-notify-click { +.ui-notify-click { cursor: pointer; } -.ui-notify-cross { - margin-top: -4px; - float: right; - cursor: pointer; - text-decoration: none; - font-size: 12px; - font-weight: bold; - text-shadow: 0 1px 1px #fff; +.ui-notify-cross { + margin-top: -4px; + float: right; + cursor: pointer; + text-decoration: none; + font-size: 12px; + font-weight: bold; + text-shadow: 0 1px 1px #fff; padding: 2px; } -.ui-notify-cross:hover { - color: #ffffab; +.ui-notify-cross:hover { + color: #ffffab; } -.ui-notify-cross:active { - position:relative; +.ui-notify-cross:active { + position:relative; top: 1px; } -.ui-state-error h1 { - font-size: 14px; - margin: 0; - padding: 0; - color: #cd0a0a; - font-weight: bold; +.ui-state-error h1 { + font-size: 14px; + margin: 0; + padding: 0; + color: #cd0a0a; + font-weight: bold; } -.ui-state-error p { - color: #cd0a0a; +.ui-state-error p { + color: #cd0a0a; } diff --git a/webapp/src/main/webapp/css/visualization/capabilitymap/graph.css b/webapp/src/main/webapp/css/visualization/capabilitymap/graph.css index 106a4ec3..51cb46c9 100755 --- a/webapp/src/main/webapp/css/visualization/capabilitymap/graph.css +++ b/webapp/src/main/webapp/css/visualization/capabilitymap/graph.css @@ -50,8 +50,8 @@ body { margin-top:15px; } -#left-container, -#right-container, +#left-container, +#right-container, #center-container { height:600px; position:absolute; diff --git a/webapp/src/main/webapp/css/visualization/coauthorship/style.css b/webapp/src/main/webapp/css/visualization/coauthorship/style.css index ca61f318..ed92ed60 100644 --- a/webapp/src/main/webapp/css/visualization/coauthorship/style.css +++ b/webapp/src/main/webapp/css/visualization/coauthorship/style.css @@ -2,43 +2,43 @@ /* CSS Document */ body { - background: url(../../../site_icons/visualization/coauthorship/bg.gif) repeat-x 0 0 #FDF9EE; + background: url(../../../site_icons/visualization/coauthorship/bg.gif) repeat-x 0 0 #FDF9EE; color: #4E4628; font: normal 14px/19px Arial, Helvetica, sans-serif; margin: 0; padding: 0; } -div, -h1, -h2, -h3, -h4, -h5, -h6, -form, -label, -input, -span, -ul, -li, -p, +div, +h1, +h2, +h3, +h4, +h5, +h6, +form, +label, +input, +span, +ul, +li, +p, a { - margin: 0; + margin: 0; padding: 0; } ul { list-style: none; } .spacer { - font-size:0 ; - line-height: 0; + font-size:0 ; + line-height: 0; clear: both; } /* top navigation */ #topNav { - width: 1000px; + width: 1000px; position: relative; - margin: 0 auto; + margin: 0 auto; padding: 8px 0 0 50px; } #topNav h1 { @@ -51,38 +51,38 @@ ul { } #topNav ul { background: url(../../../site_icons/visualization/coauthorship/top_ul_bg.gif) no-repeat 0 8px; - width: 503px; - height: 23px; - padding: 8px 0 0 8px; - margin: 0 0 0 217px; + width: 503px; + height: 23px; + padding: 8px 0 0 8px; + margin: 0 0 0 217px; } #topNav ul li { - background-color: #E1DBC7; + background-color: #E1DBC7; color: #0B0B0B; float:left; - font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; + font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; text-transform: uppercase; } #topNav ul li a { - background-color: #E1DBC7; + background-color: #E1DBC7; color: #0B0B0B; font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; - text-transform: uppercase; - text-align: center; + text-transform: uppercase; + text-align: center; text-decoration: none; - width: 65px; - height :23px; + width: 65px; + height :23px; display: block; } #topNav ul li a:hover, #topNav ul li a.hover { - background: url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; + background: url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; color: #FFFFFF; font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; - text-transform: uppercase; - text-align: center; + text-transform: uppercase; + text-align: center; text-decoration: none; - width: 65px; - height: 23px; + width: 65px; + height: 23px; display: block; } /* shadow */ @@ -98,16 +98,16 @@ ul { margin-left: 0; } #bottomShadow { - background: url(../../../site_icons/visualization/coauthorship/bottom_shadow.gif) no-repeat 0 0 #FDF9EE; + background: url(../../../site_icons/visualization/coauthorship/bottom_shadow.gif) no-repeat 0 0 #FDF9EE; color: #4E4628; - width: 1000px; - height: 24px; + width: 1000px; + height: 24px; float: left; } /* body start */ #body { - width: 1000px; - margin: 0 auto; + width: 1000px; + margin: 0 auto; position: relative; } #bodyPannel { @@ -121,243 +121,243 @@ ul { padding-left: 28px; } #bodyPannel form.search { - background-color: #FFFFFF; - color: #000000; + background-color: #FFFFFF; + color: #000000; border: #ECE8DB 1px solid; - width: 248px; - padding: 7px 17px 27px 17px; + width: 248px; + padding: 7px 17px 27px 17px; float: left; } #bodyPannel form.search h2 { - background: url(../../../site_icons/visualization/coauthorship/search_h2_bg.gif) no-repeat 0 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/search_h2_bg.gif) no-repeat 0 0 #FFFFFF; color: #786E4E; - width: 197px; padding:0 0 10px 50px; + width: 197px; padding:0 0 10px 50px; float: left; font: normal 24px/42px Georgia, "Times New Roman", Times, serif; } #eventLink h2 span, #bodyPannel form.search h2 span { - background-color: #FFFFFF; + background-color: #FFFFFF; color: #0B0B0B; font: normal 24px/42px Georgia, "Times New Roman", Times, serif; } #bodyPannel form.search input { - background-color: #EFEBDE; - color: #0B0B0B; + background-color: #EFEBDE; + color: #0B0B0B; border: #C3BCA4 1px solid; - width: 158px; - height: 22px; - padding: 2px; + width: 158px; + height: 22px; + padding: 2px; margin: 0 0 8px 0; float: right; font: normal 14px/20px Arial, Helvetica, sans-serif; } #bodyPannel form.search p { - background-color: #FFFFFF; - color: #CC0000; float:left; + background-color: #FFFFFF; + color: #CC0000; float:left; margin: 6px 0 0 0; font: normal 13px/15px Arial, Helvetica, sans-serif; } #bodyPannel form.search input.check { - background-color: #EFEBDE; - color: #0B0B0B; + background-color: #EFEBDE; + color: #0B0B0B; border: #C3BCA4 1px solid; - width: 15px; - height: 15px; - float: left; + width: 15px; + height: 15px; + float: left; margin: 6px 0 0 9px; } #bodyPannel form.search input.submit { - background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 37px 0 #FFFFFF; - color: #0B0B0B; + background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 37px 0 #FFFFFF; + color: #0B0B0B; border: none; - width: 53px; height:13px; - float:right; margin:7px 0 0 0; - padding: 0 23px 0 0; + width: 53px; height:13px; + float:right; margin:7px 0 0 0; + padding: 0 23px 0 0; cursor: pointer; - font:normal 10px/13px Arial, Helvetica, sans-serif; + font:normal 10px/13px Arial, Helvetica, sans-serif; text-transform: uppercase; } #eventLink { - width: 345px; - padding: 0 0 0 70px; + width: 345px; + padding: 0 0 0 70px; float: left; } #eventLink h2 { - background: url(../../../site_icons/visualization/coauthorship/event_link_bg.gif) no-repeat 0 7px #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/event_link_bg.gif) no-repeat 0 7px #FFFFFF; color: #786E4E; padding: 6px 0 10px 48px; font: normal 28px/42px Georgia, "Times New Roman", Times, serif; } #eventLink ul { - float: left; + float: left; padding: 0 0 0 5px; } #eventLink ul li { - font: normal 13px/19px Arial, Helvetica, sans-serif; - background: url(../../../site_icons/visualization/coauthorship/red_arrow.gif) no-repeat 0 7px #FFFFFF; + font: normal 13px/19px Arial, Helvetica, sans-serif; + background: url(../../../site_icons/visualization/coauthorship/red_arrow.gif) no-repeat 0 7px #FFFFFF; color: #4E4628; padding: 0 0 0 6px; } #eventLink ul li a { - font: normal 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color: #FFFFFF; + font: normal 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; + background-color: #FFFFFF; color: #4E4628; - padding: 0 4px; + padding: 0 4px; display: block; } #eventLink ul li a:hover { - font: normal 13px/19px Arial, Helvetica, sans-serif; - text-decoration: none; - background-color: #F4EFDF; + font: normal 13px/19px Arial, Helvetica, sans-serif; + text-decoration: none; + background-color: #F4EFDF; color: #4E4628; - padding: 0 4px; + padding: 0 4px; display: block; } #eventLink a.more { - background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; float: right; - font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration: none; + font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration: none; text-transform: uppercase; - padding: 0 20px 0 0; + padding: 0 20px 0 0; margin: 5px 10px 0 0; } #eventLink a.more:hover { - background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; float: right; - font: bold 10px/13px Arial, Helvetica, sans-serif; - text-decoration: none; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; text-transform: uppercase; - padding: 0 20px 0 0; + padding: 0 20px 0 0; margin:5px 10px 0 0; } #midle { - background: url(../../../site_icons/visualization/coauthorship/picture.gif) no-repeat 0 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/picture.gif) no-repeat 0 0 #FFFFFF; color: #4E4628; padding: 270px 0 0 0; } #midle h2 { - background-color: #FFFFFF; + background-color: #FFFFFF; color: #0B0B0B; font: normal 28px/46px Georgia, "Times New Roman", Times, serif; } #midle h2 span { - background-color: #FFFFFF; + background-color: #FFFFFF; color: #A60101; font: normal 28px/46px Georgia, "Times New Roman", Times, serif; } #midle p { - font: normal 14px/19px Arial, Helvetica, sans-serif; - background-color: #FFFFFF; + font: normal 14px/19px Arial, Helvetica, sans-serif; + background-color: #FFFFFF; color: #4E4628; } #midle a.more { - background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; float:right; - font: bold 10px/13px Arial, Helvetica, sans-serif; - text-decoration: none; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; text-transform: uppercase; - padding: 0 20px 0 0; + padding: 0 20px 0 0; margin: 5px 35px 0 0; } #midle a.more: hover { - background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; color: #0B0B0B; float:right; - font: bold 10px/13px Arial, Helvetica, sans-serif; - text-decoration: none; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; text-transform: uppercase; - padding: 0 20px 0 0; + padding: 0 20px 0 0; margin: 5px 35px 0 0; } #colorBg { - background-color: #FCFAF3; - float: left; + background-color: #FCFAF3; + float: left; color: #0B0B0B; - margin: 18px 0 0 0; - padding: 18px 40px 18px 38px; + margin: 18px 0 0 0; + padding: 18px 40px 18px 38px; width: 642px; } #futurePlans { - width: 298px; + width: 298px; float: left; } #futurePlans h2.text1 { - background-color: #FCFAF3; + background-color: #FCFAF3; color: #0B0B0B; font: normal 28px/40px Georgia, "Times New Roman", Times, serif; } #futurePlans h2.text1 span { - background-color: #FCFAF3; + background-color: #FCFAF3; color: #A60101; font: normal 28px/40px Georgia, "Times New Roman", Times, serif; } -#futurePlans ul { +#futurePlans ul { float: left; } #futurePlans ul li { - font: normal 13px/19px Arial, Helvetica, sans-serif; + font: normal 13px/19px Arial, Helvetica, sans-serif; color: #4E4628; - background: url(../../../site_icons/visualization/coauthorship/red_bullet.gif) no-repeat 0 6px #FCFAF3; + background: url(../../../site_icons/visualization/coauthorship/red_bullet.gif) no-repeat 0 6px #FCFAF3; padding: 0 0 0 10px; } #futurePlans ul li a { font: bold 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color: #FCFAF3; - color: #4E4628; + background-color: #FCFAF3; + color: #4E4628; display: block; } #futurePlans ul li a:hover { - font: bold 13px/19px Arial, Helvetica, sans-serif; + font: bold 13px/19px Arial, Helvetica, sans-serif; text-decoration: none; - background-color: #EAE6D9; - color: #4E4628; + background-color: #EAE6D9; + color: #4E4628; display: block; } #futurePlans p { - background: url(../../../site_icons/visualization/coauthorship/boeder.gif) repeat-x 0 14px #FCFAF3; + background: url(../../../site_icons/visualization/coauthorship/boeder.gif) repeat-x 0 14px #FCFAF3; color: #0B0B0B; - height: 13px; - line-height: 13px; + height: 13px; + line-height: 13px; padding: 14px 0 19px 0; } #futurePlans p a.more { - background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 76px 0 #FCFAF3; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 76px 0 #FCFAF3; + color: #0B0B0B; float: right; - font: bold 10px/13px Arial, Helvetica, sans-serif; - text-decoration: none; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; text-transform: uppercase; - padding: 0 20px 0 10px; + padding: 0 20px 0 10px; margin: 0; } #futurePlans p a.more:hover { - background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 76px 0 #FCFAF3; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 76px 0 #FCFAF3; + color: #0B0B0B; float: right; - font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; + font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform: uppercase; - padding: 0 20px 0 10px; + padding: 0 20px 0 10px; margin: 0; } #newsLetter { margin: 0 auto; } #newsLetter span.nltop { - background: url(../../../site_icons/visualization/coauthorship/newsletter_top.gif) no-repeat 0 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/newsletter_top.gif) no-repeat 0 0 #FFFFFF; color: #000000; - line-height: 0; - font-size: 0; + line-height: 0; + font-size: 0; height: 15px; display: block; } #newsLetter span.nlbottom { - background: url(../../../site_icons/visualization/coauthorship/newsletter_bottom.gif) no-repeat 0 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/newsletter_bottom.gif) no-repeat 0 0 #FFFFFF; color: #000000; - line-height: 0; - font-size: 0; - height: 14px; + line-height: 0; + font-size: 0; + height: 14px; display: block; } #newsLetter .middle { @@ -368,243 +368,243 @@ ul { padding-right: 5px; } #newsLetter form.newsLetter h2.text2 { - background:u rl(../../../site_icons/visualization/coauthorship/newsletter_h2_bg.gif) no-repeat 0 0; + background:u rl(../../../site_icons/visualization/coauthorship/newsletter_h2_bg.gif) no-repeat 0 0; color: #786E4E; - padding: 0 0 10px 65px; - float: left; - width: 228px; + padding: 0 0 10px 65px; + float: left; + width: 228px; height: 37px; font: normal 24px/30px Georgia, "Times New Roman", Times, serif; } #newsLetter form.newsLetter h2.text2 span { - background-color: #FFFFFF; + background-color: #FFFFFF; color: #0B0B0B; font: normal 24px/30px Georgia, "Times New Roman", Times, serif; } #bodyPannel form.search label, #newsLetter form.newsLetter label { - background-color: #FFFFFF; - color: #0B0B0B; - margin: 0 0 8px 0; + background-color: #FFFFFF; + color: #0B0B0B; + margin: 0 0 8px 0; float: left; - font: bold 10px/28px Arial, Helvetica, sans-serif; + font: bold 10px/28px Arial, Helvetica, sans-serif; text-transform: uppercase; } #newsLetter form.newsLetter input { - background-color: #EFEBDE; - color: #0B0B0B; + background-color: #EFEBDE; + color: #0B0B0B; border: #C3BCA4 1px solid; - width: 168px; - height: 22px; - padding: 2px; - margin: 0 0 8px 15px; + width: 168px; + height: 22px; + padding: 2px; + margin: 0 0 8px 15px; float: left; font: normal 14px/20px Arial, Helvetica, sans-serif; } #newsLetter form.newsLetter input.submit { - background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; border: none; - width: 60px; - height: 13px; - float: right; - margin: 7px 34px 0 0; - padding: 0 30px 0 0; + width: 60px; + height: 13px; + float: right; + margin: 7px 34px 0 0; + padding: 0 30px 0 0; cursor: pointer; - font: normal 10px/13px Arial, Helvetica, sans-serif; + font: normal 10px/13px Arial, Helvetica, sans-serif; text-transform: uppercase; } #contact { - width: 312px; + width: 312px; float: right; } #contact span.ctop { - background: url(../../../site_icons/visualization/coauthorship/contact_top.gif) no-repeat 0 0 #FCFAF3; + background: url(../../../site_icons/visualization/coauthorship/contact_top.gif) no-repeat 0 0 #FCFAF3; color: #000000; - line-height: 0; - font-size: 0; - height: 14px; + line-height: 0; + font-size: 0; + height: 14px; display: block; } #contact span.cbottom { - background: url(../../../site_icons/visualization/coauthorship/contact_bottom.gif) no-repeat 0 0 #FCFAF3; + background: url(../../../site_icons/visualization/coauthorship/contact_bottom.gif) no-repeat 0 0 #FCFAF3; color: #000000; - line-height: 0; - font-size: 0; - height: 25px; + line-height: 0; + font-size: 0; + height: 25px; display: block; } #contact form.contact { - background: url(../../../site_icons/visualization/coauthorship/contact_midle.gif) repeat-y 0 0 #FCFAF3; + background: url(../../../site_icons/visualization/coauthorship/contact_midle.gif) repeat-y 0 0 #FCFAF3; color: #000; - width: 272px; - padding: 0 20px; + width: 272px; + padding: 0 20px; float: left; } #contact form.contact h2.text3 { - background: url(../../../site_icons/visualization/coauthorship/contact_h2_bg.gif) no-repeat 0 0 #FFFFFF; + background: url(../../../site_icons/visualization/coauthorship/contact_h2_bg.gif) no-repeat 0 0 #FFFFFF; color: #0B0B0B; - padding: 0 0 10px 55px; - float: left; width:228px; + padding: 0 0 10px 55px; + float: left; width:228px; height: 37px; font: normal 24px/30px Georgia, "Times New Roman", Times, serif; } #contact form.contact h2.text3 span { - background-color: #FFFFFF; + background-color: #FFFFFF; color: #A60101; font: normal 24px/30px Georgia, "Times New Roman", Times, serif; } #contact form.contact label { - background-color: #FFFFFF; - color: #0B0B0B; - margin: 0 0 8px 0; + background-color: #FFFFFF; + color: #0B0B0B; + margin: 0 0 8px 0; float: left; font: bold 10px/28px Arial, Helvetica, sans-serif; text-transform:uppercase; } #contact form.contact input { - background-color: #EFEBDE; - color: #0B0B0B; + background-color: #EFEBDE; + color: #0B0B0B; border: #C3BCA4 1px solid; - width: 168px; - height: 22px; - padding: 2px; - margin: 0 0 8px 15px; + width: 168px; + height: 22px; + padding: 2px; + margin: 0 0 8px 15px; float: right; font: normal 14px/20px Arial, Helvetica, sans-serif; } #contact form.contact textarea { - background-color: #EFEBDE; - color: #0B0B0B; + background-color: #EFEBDE; + color: #0B0B0B; border: #C3BCA4 1px solid; - width: 168px; - height: 66px; - padding: 2px; - margin: 0 0 13px 15px; + width: 168px; + height: 66px; + padding: 2px; + margin: 0 0 13px 15px; float: right; font: normal 14px/20px Arial, Helvetica, sans-serif; } #contact form.contact input.submit { - background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; border: none; - width: 60px; - height: 13px; - float: right; - margin: 0 0 0 10px; - padding: 0 20px 0 0; + width: 60px; + height: 13px; + float: right; + margin: 0 0 0 10px; + padding: 0 20px 0 0; cursor: pointer; - font: normal 10px/13px Arial, Helvetica, sans-serif; + font: normal 10px/13px Arial, Helvetica, sans-serif; text-transform: uppercase; } #contact form.contact input.reset { - background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 45px 0 #FFFFFF; - color: #0B0B0B; + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; border: none; - width: 60px; height:13px; - float: right; - margin: 0; - padding: 0 15px 0 0; + width: 60px; height:13px; + float: right; + margin: 0; + padding: 0 15px 0 0; cursor: pointer; - font: normal 10px/13px Arial, Helvetica, sans-serif; + font: normal 10px/13px Arial, Helvetica, sans-serif; text-transform: uppercase; } /* footer */ #footer { - position: relative; - margin: 0 auto; - width: 678px; + position: relative; + margin: 0 auto; + width: 678px; padding: 12px 0 50px; } #footer a.xhtml { - background-color: #CC0000; - color: #FFFFFF; - width: 49px; - height: 16px; + background-color: #CC0000; + color: #FFFFFF; + width: 49px; + height: 16px; margin: 0 6px 0 0; - font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display: block; - text-align: center; - text-decoration: none; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; + text-align: center; + text-decoration: none; float: left; } #footer a.xhtml:hover { - background-color: #0B0B0B; - color: #FFFFFF; - width: 49px; - height: 16px; + background-color: #0B0B0B; + color: #FFFFFF; + width: 49px; + height: 16px; margin: 0 6px 0 0; - font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display: block; - text-align: center; - text-decoration: none; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; + text-align: center; + text-decoration: none; float: left; } #footer a.css { - background-color: #0B0B0B; - color: #FFFFFF; - width: 38px; + background-color: #0B0B0B; + color: #FFFFFF; + width: 38px; height: 16px; font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display: block; - text-align: center; - text-decoration: none; + display: block; + text-align: center; + text-decoration: none; float: left; } #footer a.css:hover { - background-color: #CC0000; - color: #FFFFFF; - width: 38px; + background-color: #CC0000; + color: #FFFFFF; + width: 38px; height: 16px; font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; display: block; text-align:center; - text-decoration: none; + text-decoration: none; float: left; } #footer ul { float: right; } #footer ul li { - float: left; color:#0B0B0B; + float: left; color:#0B0B0B; background-color: #FDF9EE; font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer ul li a { - color: #0B0B0B; - background-color: #FDF9EE; - padding: 0 8px; + color: #0B0B0B; + background-color: #FDF9EE; + padding: 0 8px; text-decoration: none; font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer ul li a:hover { - color: #0B0B0B; - background-color: #EFEBDE; - padding: 0 8px; + color: #0B0B0B; + background-color: #EFEBDE; + padding: 0 8px; text-decoration: none; font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer p { - color: #A90000; - background-color: #FDF9EE; - padding: 0 8px; + color: #A90000; + background-color: #FDF9EE; + padding: 0 8px; float: right; font: normal 12px/22px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer p.tworld { - color: #0B0B0B; - background-color: #FDF9EE; - padding: 0 8px; + color: #0B0B0B; + background-color: #FDF9EE; + padding: 0 8px; float: right; font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer p.tworld a { - color: #0B0B0B; - background-color: #FDF9EE; + color: #0B0B0B; + background-color: #FDF9EE; text-decoration: none; font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; } #footer p.tworld a:hover { - color: #0B0B0B; - background-color: #EFEBDE; + color: #0B0B0B; + background-color: #EFEBDE; text-decoration: none; font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; } diff --git a/webapp/src/main/webapp/css/visualization/entitycomparison/layout.css b/webapp/src/main/webapp/css/visualization/entitycomparison/layout.css index a09e344a..b0f14b13 100644 --- a/webapp/src/main/webapp/css/visualization/entitycomparison/layout.css +++ b/webapp/src/main/webapp/css/visualization/entitycomparison/layout.css @@ -31,7 +31,7 @@ This is for the overlay that happens when you change the parameter. Somehow the for the message is getting set to 50%, hence we need to override it here. */ .blockElement { - top: 10px !important; + top: 10px !important; } .easy-deselect-label a.temporal-vis-url { @@ -144,7 +144,7 @@ a.clear-selected-entities, } #loading-comparisons img { vertical-align: sub; -} +} #reset-search { color: #2485AE; cursor: pointer; @@ -177,7 +177,7 @@ a.clear-selected-entities, } #functions{ margin-top: 20px; - margin-bottom: -40px; + margin-bottom: -40px; } #bar { height: 20px; @@ -187,7 +187,7 @@ a.clear-selected-entities, margin-left: 10px; } #checkbox{ - float:left; + float:left; } .easy-deselect-label { float: left; @@ -195,7 +195,7 @@ a.clear-selected-entities, width: 160px; text-align: left; } -.easy-deselect-label a, +.easy-deselect-label a, #text { text-decoration: none; color: black; @@ -226,8 +226,8 @@ sans-serif; overflow: hidden; } .entity-label-url { - width: 125px; - margin-left: 10px; + width: 125px; + margin-left: 10px; display: inline-block; text-decoration: underline; color: #2485AE; @@ -240,7 +240,7 @@ sans-serif; } #graphContainer { margin-bottom: 15px; - width: 450px; + width: 450px; height: 250px; margin-left: 23px; } @@ -297,9 +297,9 @@ p.displayCounter{ border-bottom: 1px solid gray; } #comparisonHeader, -#entityHeader, -#entitylevelheading, -#comparisonParameter, +#entityHeader, +#entitylevelheading, +#comparisonParameter, #headerText { color: #2485ae; } diff --git a/webapp/src/main/webapp/css/visualization/mapofscience/layout.css b/webapp/src/main/webapp/css/visualization/mapofscience/layout.css index 4db92f14..16d139da 100644 --- a/webapp/src/main/webapp/css/visualization/mapofscience/layout.css +++ b/webapp/src/main/webapp/css/visualization/mapofscience/layout.css @@ -24,18 +24,18 @@ } #map_area { - width: 640px; + width: 640px; height: 480px; } #subEntityTableArea { clear: both; - width: 100%; - padding-top:5px; + width: 100%; + padding-top:5px; } .subEntityTable { - width: 32%; + width: 32%; padding-top:5px; padding-right: 8px; float: left; @@ -73,33 +73,33 @@ a.clear-selected-entities { /* tooltip */ #tt { - font:11px/1.5 Verdana, Arial, Helvetica, sans-serif; - position:absolute; - display:block; + font:11px/1.5 Verdana, Arial, Helvetica, sans-serif; + position:absolute; + display:block; background:url(../../../images/visualization/mapofscience/tooltip/tt_left.gif) top left no-repeat } #tttop { - display:block; - height:5px; - margin-left:5px; - background:url(../../../images/visualization/mapofscience/tooltip/tt_top.gif) top right no-repeat; + display:block; + height:5px; + margin-left:5px; + background:url(../../../images/visualization/mapofscience/tooltip/tt_top.gif) top right no-repeat; overflow:hidden } #ttcont { - display:block; - padding:2px 12px 3px 7px; - margin-left:5px; - background:#666; + display:block; + padding:2px 12px 3px 7px; + margin-left:5px; + background:#666; color:#FFF } #ttbot { - display:block; - height:5px; - margin-left:5px; - background:url(../../../images/visualization/mapofscience/tooltip/tt_bottom.gif) top right no-repeat; + display:block; + height:5px; + margin-left:5px; + background:url(../../../images/visualization/mapofscience/tooltip/tt_bottom.gif) top right no-repeat; overflow:hidden } @@ -142,7 +142,7 @@ a.clear-selected-entities { } .suborganization-title { - vertical-align: middle; + vertical-align: middle; font-weight: bold; } @@ -200,7 +200,7 @@ hr.subtle-hr { border: 0; } -#main-science-areas-table-container table tr { +#main-science-areas-table-container table tr { min-height: 30px; max-height: 30px; height: 30px; @@ -253,7 +253,7 @@ a.map-of-science-links { margin-top: 0; } -.filterInfo, +.filterInfo, .paginatedtabs { font-size: 0.81em; } @@ -266,7 +266,7 @@ a.map-of-science-links { } .subpaginatedtabs span { - padding-right: 5px; + padding-right: 5px; cursor: pointer; color: #2485AE; } diff --git a/webapp/src/main/webapp/css/visualization/personlevel/page.css b/webapp/src/main/webapp/css/visualization/personlevel/page.css index 8ccee4f7..857983d2 100644 --- a/webapp/src/main/webapp/css/visualization/personlevel/page.css +++ b/webapp/src/main/webapp/css/visualization/personlevel/page.css @@ -63,7 +63,7 @@ p.datatable { } #body h1 { margin: 0; -} +} #ego_profile h1 a { text-decoration: none; } @@ -88,7 +88,7 @@ p.datatable { float: left; margin-right: 10px; } -.toggle_visualization { +.toggle_visualization { max-width: 230px; float: right; display: none; @@ -148,7 +148,7 @@ table.sparkline_wrapper_table td, th { width: 50%; } #visPanel { - float: right; + float: right; width: 600px; } .vis-tables table caption { @@ -164,46 +164,46 @@ table.sparkline_wrapper_table td, th { .vis-tables table thead { text-align: left; } -.vis-tables table thead tr th { - background-color: #eaeaea; - font-size: 14px; - padding: 5px; - vertical-align: top; - text-align: left; +.vis-tables table thead tr th { + background-color: #eaeaea; + font-size: 14px; + padding: 5px; + vertical-align: top; + text-align: left; } -.vis-tables table tbody { - font-size: 12px; +.vis-tables table tbody { + font-size: 12px; } -.vis-tables table tbody td { - text-align: left; - padding: 5px; +.vis-tables table tbody td { + text-align: left; + padding: 5px; } .moniker { margin-top: 0; } .spacer { - font-size: 0; - line-height: 0; + font-size: 0; + line-height: 0; clear: both; } /* <------ BODY START*/ #body { max-width: 900px; - min-width: 800px; - margin: 0 auto; + min-width: 800px; + margin: 0 auto; position: relative; background: white; } #bodyPannel { - background: #FFFFFF; + background: #FFFFFF; height: 840px; width: 100%; clear: both; } -#dataPanel { +#dataPanel { border: 1px solid #e9e9e9; background: #F7F9F9; - width: 250px; + width: 250px; height: 615px; float: left; } @@ -234,7 +234,7 @@ table.sparkline_wrapper_table td, th { } /* <------ CONTAINER OVERRIDE FROM LIQUID.CSS*/ .container { - width: inherit; + width: inherit; } #incomplete-data { line-height: 150%; @@ -257,5 +257,5 @@ table.sparkline_wrapper_table td, th { width: 54px; } #table_heading { - width: 80%; + width: 80%; } diff --git a/webapp/src/main/webapp/css/visualization/visualization.css b/webapp/src/main/webapp/css/visualization/visualization.css index 411199c1..35cba725 100644 --- a/webapp/src/main/webapp/css/visualization/visualization.css +++ b/webapp/src/main/webapp/css/visualization/visualization.css @@ -1,9 +1,9 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ /***************************** - visualization styles + visualization styles ******************************/ - + span.incomplete-data-holder, #incomplete-data { padding: 5px; @@ -67,7 +67,7 @@ span.incomplete-data-holder, } .google-visualization-sparkline-image { border: 1px solid #cfe4ed; - display: block; + display: block; } .google-visualization-sparkline-selected { background-color: blue; diff --git a/webapp/src/main/webapp/i18n/vivo_all.properties b/webapp/src/main/webapp/i18n/vivo_all.properties index c33bf1a8..d54ceaf0 100644 --- a/webapp/src/main/webapp/i18n/vivo_all.properties +++ b/webapp/src/main/webapp/i18n/vivo_all.properties @@ -1,812 +1,812 @@ -# -# Text strings for the controllers and templates -# -# Default (English) -# - -uri_icon = uri icon - -# -# "partial" individual templates ( /templates/freemarker/body/partials/individual ) -# -contact_capitalized = Contact -phone = phone -primary_email = primary email -additional_emails = additional emails -email = email -primary_email_capitalized = Primary Email -additional_emails_capitalized = Additional Emails -contact_info = Contact Info - -active_grants_for = Active Grants for the -department = department -grant_name = Grant Name -close_date = Close Date -no_active_grants = There are currently no active grants for this department. -view_all_active_grants = View all active grants - -individuals_with_researh_area_one = Here are the individuals in {0} who have an interest in this research area. -individuals_with_researh_area_two = Here are the individuals in the {0} who have an interest in this research area. -individuals_with_dept = Here are the individuals with an interest in {0} who are in this organization. -faculty_with_researh_area = Here are the faculty members in the {0} department who have an interest in this research area. -view_all_individuals_in_area = View all individuals with an interest in this area. -view_all_individuals_in_dept = View all individuals in this organization. -view_all_faculty_in_area = View all faculty with an interest in this area. -faculty_research_areas = Faculty Research Areas -affiliated_research_areas = Affiliated Research Areas -affiliated_departments = Associated Departments -organization = individuals with the research area in this organization - -share_the_uri = share the uri - -export_qr_codes = Export QR codes -vcard_qr = vCard QR -vcard_qr_code = vCard QR Code -close_capitalized = Close -qr_icon = qr icon -qr_code = QR Code -invalid_qr_code_parameter = You have passed an invalid value for the qrCode display parameter. - -research_areas = research areas - -publications_in_vivo = Publications in VIVO -co_author = co-author -co_authors = co-authors -co_author_network = Co-author Network -map_of_science = map of science -map_of_science_capitalized = Map of Science -co_investigator_network = co-investigator network -co_investigator_network_capitalized = Co-investigator Network - -networks = Networks -co_authors_capitalized = Co-authors - -temporal_graph = temporal graph -temporal_graph_capitalized = Temporal Graph - -websites = Websites - -advisee_label = advisee label -advisor_label = advisor label -candidate = candidate -candidacy = candidacy -advisingRel_label = advisory label - -editor_abbreviated = Ed. -volume_abbreviated = Ed. -resource_name = resource name -missing_info_resource = missing information resource - -award_receipt_name = award receipt name -award_name = award name -conferred_by = conferred by -conferred_on = conferred on -selected_award = Selected Award - -incomplete_date_time_interval = incomplete date/time interval -incomplete_date_time_value = incomplete date/time value - -in = in -organization_name = organization name -missing_organization = missing organization -middle_organization = middle organization - -concept_name = concept name - -at = at -event_name = event name -missing_event = missing event -event_label = event label - -activity_name = activity name -missing_activity = missing activity -awarded_by = awarded by -administered_by = administered by - -presentation_name = presentation name -missing_presentation = missing presentation -conference = conference -series = series - -author_name = author name -missing_author = missing author - -person_name = person name -missing_person_in_posn = missing person in this position -missing_person_in_role = missing person in this role - -scopus_id_link = Scopus ID Link - -click_to_view_web_page = Click to view the {0} web page -screenshot_of_webpage = screenshot of webpage {0} -click_webpage_icon = click webpage icon -link_text = link text -link_name = link name -no_url_provided = no url provided for link - -# -# individual templates ( /templates/freemarker/body/individual ) -# -standard_view = Standard profile view -quick_view = Quick profile view -quick_view_icon = quick view icon -geographic_focus = Geographic Focus - -background_top_image = background top image -full_view_icon = full view icon -profile_type = Profile Type -# -# body templates ( /templates/freemarker/body/ ) -# -export_qr_code = Export QR code -more_qr_info = More info on QR codes -what_is_this = What is this? -view_this_profile = View this person's profile -vcard = Vcard -hyperlink = Hyperlink - -# -# harvester templates ( /templates/freemarker/body/harvester ) -# -must_be_admin = You must be an administrator to use this tool. -error_no_job_specified = Error: No file harvest job was specified, or an unknown job was specified. -probably_a_bug_so_report = The end user should not see this error under normal circumstances, so this is probably a bug and should be reported. -return_to_ingest_menu = Return to the Data Ingest Tools menu -ingest_menu = Ingest Menu -data_being_harvested = Please wait while your data is harvested. -harvest_complete = Harvest complete. For another, please refresh the page. -error_harvest_cannot_continue = An error has occurred and the file harvest cannot continue. -harvest_error_instructions_one = This is most likely due to an improper Harvester configuration. Please ensure the following: -harvest_error_instructions_two = VIVO Harvester is installed. -the_capitalized = The -harvester_location = harvester.location -harvest_error_instructions_three = property in runtime.properties is pointed to the Harvester installation directory. -harvest_error_instructions_fourA = In VIVO Harvester, the web server user (typically tomcat6) has read and write access to the -harvest_error_instructions_fourB = vivo/ -harvest_error_instructions_fourC = directory and all of its children. -harvest_error_instructions_fiveA = In VIVO Harvester, the -harvest_error_instructions_fiveB = logs/ -harvest_error_instructions_fiveC = directory exists and the web server user has read and write access to it. -harvest_error_instructions_sixA = In VIVO Harvester, the file -harvest_error_instructions_sixB = vivo/config/vivo.xml -harvest_error_instructions_sixC = is properly configured with your database information and namespace. -step_one = Step 1 -download_template = Download template -download = Download -step_two = Step 2 -fill_in_data = Fill in data -help_capitalized = Help -fill_in_template_with_data = Fill in the template with your data. You may fill in multiple templates if you wish to harvest multiple files at once. -step_three = Step 3 -upload_files = Upload file(s) -upload_completed_templates = Upload your completed template(s). -upload_capitalized = Upload -uploaded_files = Uploaded files -step_four = Step 4 -harvest_capitalized = Harvest -click_to_harvest = Click the button to harvest your file(s). -step_five = Step 5 -view_results = View results -script_executed = Script being executed -progress_capitalized = Progress -undefined_runtime_property = property in runtime.properties is undefined. -define_value_for_property = In order to use this feature, please define a value for this property that points to the Harvester installation directory before redeploying and restarting the application. - -# -# lib templates ( /templates/freemarker/body/lib ) -# -faculty_capitalized = Faculty -loading_faculty = Loading faculty . . . -research_capitalized = Research -view_all = View all ... -view_all_research = view all research -no_research_content_found = No research content found. -departments = Departments -loading_map_information = Loading map information . . . -verify_match_capitalized = Verify this match - -# -# custom form templates ( /templates/freemarker/edit/forms ) -# -manage_concepts = Manage Concepts -no_concepts_specified = There are currently no concepts specified. -return_to_profile = Return to Profile Page -external_vocabulary_services = External Vocabulary Services -create_own_concept = Select or create a VIVO-defined concept. -add_selected_concept = Add Selected Concept -cannot_find_concept = Can't find the concept you want? Select or create a VIVO-defined concept. -add_concept = Add Concept - -event_type = event type -attended = attended - -manage_authors = Manage Authors -no_linked_author = no linked author -remove_author_link = remove author link -add_author = Add Author -return_to_publication = Return to publication -add_an_author = Add an Author -person_capitalized = Person -organization_capitalized = Organization -middle_name = Middle name -initial_okay = initial okay -selected_author = Selected Author -organization_name_capitalized = Organization name -selected_organization = Selected Organization - -clinical_activity = clinical activity -clinical_activity_type = clinical activity type -year_hint_format = YYYY - -collection_series_editor_role = collection or series editor role -editor_role_in = editor role in - -edit_wbpage_of = Edit webpage of -add_webpage_for = Add webpage for -add_webpage = Add Web Page -url_type = URL Type -faculty_of_1000 = Faculty of 1000 Link -standard_web_link = Standard Web Link -webpage_name = Webpage Name - -investigator_entry_for = investigator entry for -investigator_capitalized = Investigator -principal_investigator_entry_for = principal investigator entry for -co_principal_investigator_entry_for = co-principal investigator entry for -start_year_must_precede_end = The Start Year must be earlier than the End Year. -end_year_must_be_later = The End Year must be later than the Start Year. -enter_or_select_grant = Please enter or select a value in the Grant Name field. -selected_grant = Selected Grant -years_of_grant_participation = Years of Participation in Grant - -leadership = leadership -organization_type = organization type - -membership = membership -membership_in = membership in -organizations = organizations - -organizer_of = organizer of - -outreach_comm_service = outreach & community service -outreach_comm_service_in = outreach & community service in - -select_or_enter_name = Please select an existing value or enter a new value in the Name field. -presentation_entry_for = presentation entry for -presentation_capitalized = Presentation -presentation_type = Presentation Type -role_in = Role in -presentation_hint = e.g., Moderator, Speaker, Panelist -presented_at = Presented At -selected_conference = Selected Conference - -select_existing_pub_or_enter_new = Please select an existing publication in the Title field or enter a new one. - -publication_entry_for = publication entry for -publication_type = Publication Type -selected_publication = Selected Publication -published_in = Published in -selected_journal = Selected Journal -selected_event = Selected Event -proceedings_of = Proceedings of -editor_capitalized = Editor -required_with_last_name = required with new Last name -selected_editor = Selected Editor -publisher_capitalized = Publisher -selected_publisher = Selected Publisher -volume_capitalized = Volume -number_capitalized = Number -issue_capitalized = Issue -chapter_capitalized = Chapter -start_page = Start Page -end_page = End Page -selected_book = Selected Book -publication_date = Publication Date -place_of_publication = Place of Publication - -research_activity = research activity -research_activity_type = research activity type - -reviewer_of = reviewer of - -entry_for = entry for -specify_role_for_activity = Please specify a role for this activity. -start_year = Start Year - -service_to_profession = service to the profession -service_to_profession_in = service to the profession in - -teaching_activity = teaching activity -teaching_activity_type = teaching activity type -teaching_role_hint = e.g., Instructor, Facilitator, Assistant - -create_own_concept_all_caps = Create Your Own Concept -concept_capitalized = Concept -selected_concept = Selected Concept -create_concept = Create Concept -return_to_manage_concepts = Return to Manage Concepts - -institutional_internal_class = Institutional Internal Class -internal_class_intro_one = This class will be used to designate those individuals internal to your institution. -internal_class_intro_two = This will allow you to limit the individuals displayed on your menu pages (People, Research, etc.) to only those within your institution. -no_local_oncologies = There are currently no recognized local ontologies. -namespace_must_use_this_pattern = In order for a local ontology to be recognized here, its namespace URI must follow this pattern -new_local_oncology = a new local ontology -return_here_to_define_class = and then return here to define the institutional internal class. -select_existing_local_class = Select an existing class from a local extension -cannot_find_class = Can't find an appropriate class? -create_new_class = Create a new class -create_new_one = Create a new one -use_capitals_each_word = use capitals for the first letter of each word -local_namespace = Local Namespace -problematic_section_error = Error: problematic section as above should all have been handled. -new_local_ontology = new local ontology - -manage_grants_and_projects = Manage Grants & Projects for -check_grants_to_exclude = Check those grants and projects you want to exclude from the profile page. - -manage_affiliated_people = Manage People Affiliated with -check_people_to_exclude = Check those people you want to exclude from the profile page. - -manage_publications_for = Manage Publications for -check_pubs_to_exclude = Check those publications you want to exclude from the profile page. - -manage_web_pages = Manage Web Pages -has_no_webpages = This individual currently has no web pages specified. Add a new web page by clicking on the button below. -edit_webpage_link = edit web page link -delete_webpage_link = delete web page link -webpage_url = webpage url -add_new_web_page = Add New Web Page - -enable_internal_class_one = To enable this option, you must first select an -enable_internal_class_two = for your instance -internal_class = institutional internal class -only_display = Only display -within_my_institution = within my institution - -enter_a_name = Please enter a value in the Name field. -enter_last_name = Please enter a Last name for this person. -enter_first_name = Please enter a First name for this person. - -posn_history_entry_for = position history entry for -enter_posn_title_value = Please enter a value in the Position Title field. -enter_posn_type_value = Please select a value in the Position Type field. -enter_or_select_person_value = Please select an existing value or enter a new value in the Person field. -position_title = Position Title -position_type = Position Type -selected_person = Selected Person - -degree_candidacy = Degree Candidacy -subject_area = Subject Area -selected_subject_area = Selected Subject Area -selected_advisee = Selected Advisee -selected_advisor = Selected Advisor -advisee_capitalized = Advisee -advisor_capitalized = Advisor -advising_relationship_type = Advising Relationship Type -select_advising_relationship_type = Please select an Advising Relationship Type. -advisor_relationship_entry_for = advisor relationship entry for -advisee_relationship_entry_for = advisee relationship entry for -years_participating = Years of Participation - -award_or_honor_for = award or honor for -select_Award_or_enter_name = Please select an existing value or enter a new value in the Award or Honor Name field. -award_honor_name = Award or Honor Name -conferred_by_capitalized = Conferred by -selected_conferred = Selected Conferrer -description = Description -year_awarded = Year Awarded -years_inclusive = Years Inclusive -award_hint = (e.g., for multi-year awards) - -educational_training_for = educational training entry for -select_organization_type = Please select a value in the Organization Type field. -select_an_organization_name = Please enter or select a value in the Name field. -select_educational_training_value = Please select a value in the Type of Educational Training field. -org_type_capitalized = Organization Type -educational_training_type = Type of Educational Training -dept_or_school_name = Department or School Name within the -degree = Degree -missing_degree = missing degree -major_field = Major Field of Degree -supplemental_information = Supplemental Information -supplemental_information_hint = (e.g., Thesis title, Transfer info, etc.) -academic_studies_or_other = Academic Studies or Other Training - -create_mailing_address = Create Mailing Address -mailing_address_for = mailing address for -enter_a_country = Please enter a value in the Country field. -enter_street_address = Please enter a value in the Street Address field. -enter_a_locality = Please enter a value in the City/Locality field. -enter_postal_code = Please enter a value in the Postal Code field. -country = Country -street_address = Street Address -city_locality = City/Locality -region = State/Province/Region -postal_code = Postal Code - -posn_entry_for = position entry for - -# -# coauthorship templates ( /templates/freemarker/visualization/coauthorship ) -# -within_last_10_years = within the last 10 years -total = total -from = from -file = file -file_capitalized = File -view_full_timeline_and_network = View full timeline and co-author network. -download_data_as = Download data as -unique_coauthors_per_year = Unique Co-Authors per year -count_capitalized = Count - -# -# copi templates ( /templates/freemarker/visualization/copi ) -# -year_capitalized = Year -unique_coinvestigators = Unique co-investigators -co_investigator = co-investigator -co_investigators = co-investigators -unique_coinvestigators_per_year = Unique Co-Investigators per year -view_timeline_copi_network = View full timeline and co-investigator network. - -# -# entity comparison templates ( /templates/freemarker/visualization/entitycomparison ) -# -parent_organization_of = Parent organization of -temporal_graph_drill_up = temporal graph drill up -how_to_compare = How do you want to compare? -no_view_link = no view link -persistent_link_to_visualization = Persistent link to current visualization -error_notification = error notification -close_me = Close Me -what_to_compare = What do you want to compare? -organizations_capitalized = Organizations -people_capitalized = People -organization_hierarchy_note = Note: the organizations or people listed below are only those which are directly beneath {0} in the organization hierarchy. You may 'drill down' to see the organizations or people below a given sub-organization by selecting the chart icon next to a selected sub-organization's name below the graph on the right. -save_all_as_csv = Save All as CSV -clear_capitalized = Clear -clear_all_selected_entities = Clear all selected entities. -comparing_capitalized = Comparing -of = of -institutions_capitalized = Institutions -info_based_on_vivo_data = This information is based solely on {0} which have been loaded into the VIVO system. -you_have_selected = You have selected -of_a_maximum = of a maximum -schools = schools -legend_capitalized = Legend -with_unknown_year = with unknown year -with_known_year = with known year -from_current_incomplete_year = from current incomplete year - -entity_comp_error_text1 = This organization has neither sub-organizations nor people with -entity_comp_error_text2 = in the system. -entity_comp_error_text3 = Please visit the full -entity_comp_error_text4 = for a more complete overview. -profile_page = profile page - -publication = publication -published = published -publications = publications -by_publications = by Publications -publications_capitalized = Publications -grant = grant -granted = granted -grants = grants -by_grants = by Grants -grants_capitalized = Grants -activity = activity -activities = activities - -# -# grant visualization templates ( /templates/freemarker/visualization/grant ) -# -view_all_grants = view all grants -view_all_grants_text = View all VIVO grants and corresponding co-investigator network. -grant_per_year = Grants per year -link = link - -# -# map of science templates ( /templates/freemarker/visualization/mapOfScience ) -# -parent_entity = parent entity -map_of_science_icon = map of science icon -explore_activity = Explore activity -explore_capitalized = Explore -across_subdisciplines = across 554 scientific subdisciplines -compare_organizations = Compare organizations -mapped = mapped -save_unmapped_publications = Save Unmapped Publications -map_of_science_visualization = Map of Science Visualization -no_publications_for_this_organization = No publications in the system have been attributed to this organization. -please_visit = Please visit the -for_complete_overview = for a complete overview. - -# -# model constructor templates ( /templates/freemarker/visualization/modelconstructor ) -# -cached_models_regenerated = The following cached models will be regenerated. -uri_independent_model = URI Independent Model -currently_no_constructed_models = Currently there are no constructed models for use by visualization. - -# -# person level templates ( /templates/freemarker/visualization/personlevel) -# -co_investigator_icon = co-investigator icon -co_authorship = co-authorship -this_author = this author -in_the_vivo_db = in the VIVO database. -no_papers_for = Currently there are no papers for -publication_s_capitalized = Publication(s) -co_author_s_capitalized = Co-author(s) -incomplete_data_note1 = Note: This information is based solely on publications that have been loaded into the VIVO system. This may only be a small sample of the person's total work. -incomplete_data_note2 = Go to your profile page to enter additional details about your publications. -incomplete_data_note3 = Log in to enter additional details about your publications on your profile page. -tables_capitalized = Tables -publications_per_year = Publications per year - -investigator_name = investigator name -co_author_icon = co-author icon -currently_no_grants_for = Currently there are no {0} grants for -this_investigator = this investigator -grant_s_capitalized = Grant(s) -co_investigator_s_capitalized = Co-investigator(s) -incomplete_grant_data_note1 = Note: This information is based solely on grants that have been loaded into the VIVO system. This may only be a small sample of the person's total work. -incomplete_grant_data_note2 = Go to your profile page to enter additional details about your grants. -incomplete_grant_data_note3 = Log in to enter additional details about your grants on your profile page. -grants_per_year = Grants per year -grant_info_for_all_years = The information in the following tables is for all years. -grant_sparkline_note = The spark lines shown above reflect grants through the last complete calendar year. These tables, however, show the grant information for all years, based on the information loaded in the VIVO system. - -# -# publication templates ( /templates/freemarker/visualization/publication) -# -numbers_based_on_publications_in_vivo = These numbers are based solely on publications that have been loaded into this VIVO application. If this is your profile, you can enter additional publications below. -last_ten_full_years = in the last 10 full years - -last_ten_full = in the last 10 full -download_link = download link -years = years - -# -# miscellaneous visualization templates ( /templates/freemarker/visualization) -# -visualization_tools = Visualization Tools -refresh_cached_vis_models = Refresh Cached Models for Visualization -why_needed = Why is it needed? -vis_tools_note_one = Large-scale visualizations like the Temporal Graph or the Map of Science involve calculating total counts of publications or of grants for some entity. Since this also means checking through all of its sub-entities, the underlying queries can be both memory-intensive and time-consuming. For a faster user experience, we wish to save the results of these queries for later re-use. -vis_caching_process = What's involved in the caching process? -vis_tools_note_two = To this end we have devised a caching solution which will retain information about the hierarchy of organizations -- namely, which publications are attributed to which organizations -- by storing the RDF model. -vis_tools_note_three = We're currently caching these models in memory. The cache is built (only once) on the first user request after a server restart. Because of this, the same model will be served until the next restart. This means that the data in these models may become stale depending upon when it was last created. This works well enough for now. In future releases we will improve this solution so that models are stored on disk and periodically updated. -vis_tools_note_four = The models are refreshed each time the server restarts. Since this is not generally practical on production instances, administrators can instead use the "refresh cache" link above to do this without a restart. - -# -# custom form javascript variables ( /templates/freemarker/edit/js) -# -drag_drop_reorder_authors = Drag and drop to reorder authors -reordering_authors_failed = Reordering of authors failed. -confirm_author_removal = Are you sure you want to remove this author: -error_processing_author_request = Error processing request: author not removed -author_capitalized = Author -or_add_new_one = or add a new one. - -vocabulary_service_unavailable = An error was encountered in executing this search. -no_serch_results_found = No search results were found. -label_type = Label (Type) -label_altLabels = Label (Alternate Labels) -definition_capitalized = Definition -best_match = Best Match -select_term_from_results = Please select at least one term from the search search results. -select_vocabulary_source_to_search = Please select at least one external vocabulary source to search. -confirm_term_deletion = Are you sure you want to remove this term? -error_term_not_deleted = Error processing request: term not removed - -advising = advising -advising_relationship = advising relationship - -select_or_create_organization = Select an existing Organization or create a new one. - -grant_successfully_excluded = The item has been successfully excluded from the profile page. -error_excluding_grant = Error processing request: the item cannot be excluded from the profile page. - -person_successfully_excluded = The person has been successfully excluded from the organization page. -error_excluding_person = Error processing request: the person cannot be excluded from the organization page. - -publication_successfully_excluded = The publication will has been successfully excluded from the profile page. -error_excluding_publication = Error processing request: the publication cannot be excluded from the profile page. - -drag_drop_to_reorder_webpages = Drag and drop to reorder web pages -webpage_reordering_failed = Reordering of web pages failed. -confirm_webpage_deletion = Are you sure you want to remove this web page? -error_removing_webpage = Error processing request: web page not removed. - -# -# miscellaneous javascript variables ( productMods/js) -# -researcher = researcher - -# -# individual javascript variables ( productMods/js/individual) -# -error_processing_type_change = Error processing request: the unchecked labels could not be deleted. - -# -# visualization javascript variables ( productMods/js/visualization) -# -publications_with = Publications with - -co_investigators_capitalized = Co-investigators -grants_with = Grants with - -vis_first_link = First -vis_last_link = Last -vis_previous_link = Prev -vis_next_link = Next - -max_entity_note = A Maximum 10 entities can be compared. Please remove some & try again. -organizations_and_people = Organizations and People -loading_data_for = Loading data for -data_for = Data for -refreshing_data_message = is now being refreshed. The visualization will load as soon as we are done computing, or you can search or browse other data in VIVO and come back in a few minutes. -disclaimer_text_one = This information is based solely on -disclaimer_text_two = which have been loaded into the VIVO system as of -level_undefined_error = ENTITY LEVEL UNDEFINED ERROR - -total_number_of = Total Number of -number_of = Number of -have_an_unknown = have an unknown -year_not_chartered = year (not charted above) -in_completed_year = in a completed year -were = were -in_current_incomplete_year = in the current incomplete year (not charted above) -publication_count = Publication Count -grant_count = Grant Count -entity_type = Entity Type -entity_label = Entity Label -no_matching_entities_found = No matching entities found -clear_search_query = clear search query -short_max_entity_note = A Maximum of 10 entities can be compared. -information_capitalized = Information -content_requires_flash = This content requires the Adobe Flash Player. -get_flash = Get Flash -of_pubs = of pubs. -max_nbr_for_comp = The maximum number of items for comparison is 3. -no_matching_science_areas = No matching science areas found - -subdisciplines = Subdisciplines -disciplines = Disciplines -science_area_level = Level of Science Area -of_activity = of activity - -drill_down = drill down - -disciplines_lower = disciplines -subdisciplines_lower = subdisciplines -show_discipline_labels = Show discipline labels - -no_attributed_publications = No publications in the system have been attributed to this -none_of_the = None of the -publications_attributed_to = publications attributed to this -been_science_located = have been "science-located." -publication_attributed_to = The publication attributed to this -not_science_located = has not been "science-located." -no_journal_information = have no journal information. -no_matching_map_location = could not be matched with a map location using their journal information. - -map_being_refreshed_msg = is now being refreshed. The visualization will load as soon as we are done computing, or you can search or browse other data in VIVO and come back in a few minutes. - -publication_pubs = publications (pubs.) -percent_activity = % activity - -# -# miscellaneous additions -# - -standardview_tooltip_one = Click to display the -standardview_tooltip_two = profile quick view. -research_area_tooltip_one = Click an area to view others -research_area_tooltip_two = with the same interest. -quickview_tooltip = Click to view the standard profile page. -global_research = Global Research -country_wide_research = Country-wide Research -local_research = Local Research -selected_presentation = Selected Presentation -event_capitalized = Event -item_capitalized = Item -telephone_number_for = telephone number for -telephone_number = Telephone Number -enter_telephone_number = Please enter a value in the Telephone Number field. -email_address_for = email address for -enter_email_address = Please enter a value in the Email Address field. -full_name_for = full name for -title_not_found = Title not found. -speeches_capitalized = Speeches -theses_capitalized = Theses -select_document_type = Please select a value in the Document Type field. -select_a_document_name = Please enter or select a value in the Document Name field. -document_type_capitalized = Document Type -document_name_capitalized = Document Name -selected_document = Selected Document -editor_name = editor name -missing_editor = missing editor -drag_drop_reorder_editors = Drag and drop to reorder editors -reordering_editors_failed = Reordering of editors failed. -confirm_editor_removal = Are you sure you want to remove this editor: -error_processing_editor_request = Error processing request: editor not removed -manage_editors = Manage Editors -no_linked_editor = no linked editor -remove_editor_link = remove editor link -add_an_editor = Add an Editor -add_editor = Add Editor -please_select_type = Please select a type from the drop-down list. -preferred_title = Preferred Title -preferred_title_for = preferred title for -enter_preferred_title = Please enter a value in the Preferred Title field. -fax_number_for = fax number for -fax_number = Fax Number -enter_fax_number = Please enter a value in the Fax Number field. -credentials = credentials -select_credential_or_enter_name = Please enter or select a value in the Credential Name field. -type_of_credential = Type of Credential -credential_name = Credential Name -selected_credential = Selected Credential -year_issued = Year Issued -year_awarded_for = year awarded for -create_year_awarded = Create year awarded -edit_year_awarded = Edit year awarded -publication_date_for = publication date for -create_publication_date = Create publication date -edit_publication_date = Edit publication date -name_prefix = Name Prefix -name_suffix = Name Suffix -administering_organization_for = administering organization for -missing_credential = missing credential -grant_administered_by = grant being administered by -missing_grant = missing grant -editor_of_entry = editor of entry for -role_type = Role type -researcher_role = Researcher Role -search_service_btn = Search Service -through_today = Publications through today's date -doi_link=Digital Object Identifier (DOI) - -using_cache_time=Using information cached at - -# -#New Entries for i18n purposes -# -edit_entry_for_head_role=: Edit this "head of" role -edit_entry_for_member_role=: Edit this membership -edit_entry_for_clinical_role=: Edit this clinical activity -edit_entry_for_attendee_role=: Edit this participation -edit_entry_for_organizer_role=: Edit this organizer role -edit_entry_for_editor_role=: Edit this editor role -edit_entry_for_service_provider_role=: Edit this service provider role -edit_entry_for_outreach_provider_role=: Edit this outreach provider role -edit_entry_for_researcher_role=: Edit this researcher role -edit_entry_for_reviewer_role=: Edit this reviewer role -edit_entry_for_teacher_role=: Edit this teaching role - -create_entry_for_head_role=: Add a new "head of" role -create_entry_for_member_role=: Add a new membership -create_entry_for_clinical_role=: Add a new clinical activity -create_entry_for_attendee_role=: Add a new participation -create_entry_for_organizer_role=: Add a new Organizer role -create_entry_for_editor_role=: Add a new editor role -create_entry_for_service_provider_role=: Add a new service provider role -create_entry_for_outreach_provider_role=: Add a new outreach provider role -create_entry_for_researcher_role=: Add a new researcher role -create_entry_for_reviewer_role=: Add a new reviewer role -create_entry_for_teacher_role=: Add a new teaching role - - -save_changes=Save -start_capitalized = Start -end_capitalized = End -institution_name=Name of Institution -role_in_institution=Role in Institution -presentation_name_capitalized=Title of Presentation -role_in_presentation_capitalized=Role in Presentation -advisee_capitalized_first_name=First Name -advisee_capitalized_lastname=Last Name - +# +# Text strings for the controllers and templates +# +# Default (English) +# + +uri_icon = uri icon + +# +# "partial" individual templates ( /templates/freemarker/body/partials/individual ) +# +contact_capitalized = Contact +phone = phone +primary_email = primary email +additional_emails = additional emails +email = email +primary_email_capitalized = Primary Email +additional_emails_capitalized = Additional Emails +contact_info = Contact Info + +active_grants_for = Active Grants for the +department = department +grant_name = Grant Name +close_date = Close Date +no_active_grants = There are currently no active grants for this department. +view_all_active_grants = View all active grants + +individuals_with_researh_area_one = Here are the individuals in {0} who have an interest in this research area. +individuals_with_researh_area_two = Here are the individuals in the {0} who have an interest in this research area. +individuals_with_dept = Here are the individuals with an interest in {0} who are in this organization. +faculty_with_researh_area = Here are the faculty members in the {0} department who have an interest in this research area. +view_all_individuals_in_area = View all individuals with an interest in this area. +view_all_individuals_in_dept = View all individuals in this organization. +view_all_faculty_in_area = View all faculty with an interest in this area. +faculty_research_areas = Faculty Research Areas +affiliated_research_areas = Affiliated Research Areas +affiliated_departments = Associated Departments +organization = individuals with the research area in this organization + +share_the_uri = share the uri + +export_qr_codes = Export QR codes +vcard_qr = vCard QR +vcard_qr_code = vCard QR Code +close_capitalized = Close +qr_icon = qr icon +qr_code = QR Code +invalid_qr_code_parameter = You have passed an invalid value for the qrCode display parameter. + +research_areas = research areas + +publications_in_vivo = Publications in VIVO +co_author = co-author +co_authors = co-authors +co_author_network = Co-author Network +map_of_science = map of science +map_of_science_capitalized = Map of Science +co_investigator_network = co-investigator network +co_investigator_network_capitalized = Co-investigator Network + +networks = Networks +co_authors_capitalized = Co-authors + +temporal_graph = temporal graph +temporal_graph_capitalized = Temporal Graph + +websites = Websites + +advisee_label = advisee label +advisor_label = advisor label +candidate = candidate +candidacy = candidacy +advisingRel_label = advisory label + +editor_abbreviated = Ed. +volume_abbreviated = Ed. +resource_name = resource name +missing_info_resource = missing information resource + +award_receipt_name = award receipt name +award_name = award name +conferred_by = conferred by +conferred_on = conferred on +selected_award = Selected Award + +incomplete_date_time_interval = incomplete date/time interval +incomplete_date_time_value = incomplete date/time value + +in = in +organization_name = organization name +missing_organization = missing organization +middle_organization = middle organization + +concept_name = concept name + +at = at +event_name = event name +missing_event = missing event +event_label = event label + +activity_name = activity name +missing_activity = missing activity +awarded_by = awarded by +administered_by = administered by + +presentation_name = presentation name +missing_presentation = missing presentation +conference = conference +series = series + +author_name = author name +missing_author = missing author + +person_name = person name +missing_person_in_posn = missing person in this position +missing_person_in_role = missing person in this role + +scopus_id_link = Scopus ID Link + +click_to_view_web_page = Click to view the {0} web page +screenshot_of_webpage = screenshot of webpage {0} +click_webpage_icon = click webpage icon +link_text = link text +link_name = link name +no_url_provided = no url provided for link + +# +# individual templates ( /templates/freemarker/body/individual ) +# +standard_view = Standard profile view +quick_view = Quick profile view +quick_view_icon = quick view icon +geographic_focus = Geographic Focus + +background_top_image = background top image +full_view_icon = full view icon +profile_type = Profile Type +# +# body templates ( /templates/freemarker/body/ ) +# +export_qr_code = Export QR code +more_qr_info = More info on QR codes +what_is_this = What is this? +view_this_profile = View this person's profile +vcard = Vcard +hyperlink = Hyperlink + +# +# harvester templates ( /templates/freemarker/body/harvester ) +# +must_be_admin = You must be an administrator to use this tool. +error_no_job_specified = Error: No file harvest job was specified, or an unknown job was specified. +probably_a_bug_so_report = The end user should not see this error under normal circumstances, so this is probably a bug and should be reported. +return_to_ingest_menu = Return to the Data Ingest Tools menu +ingest_menu = Ingest Menu +data_being_harvested = Please wait while your data is harvested. +harvest_complete = Harvest complete. For another, please refresh the page. +error_harvest_cannot_continue = An error has occurred and the file harvest cannot continue. +harvest_error_instructions_one = This is most likely due to an improper Harvester configuration. Please ensure the following: +harvest_error_instructions_two = VIVO Harvester is installed. +the_capitalized = The +harvester_location = harvester.location +harvest_error_instructions_three = property in runtime.properties is pointed to the Harvester installation directory. +harvest_error_instructions_fourA = In VIVO Harvester, the web server user (typically tomcat6) has read and write access to the +harvest_error_instructions_fourB = vivo/ +harvest_error_instructions_fourC = directory and all of its children. +harvest_error_instructions_fiveA = In VIVO Harvester, the +harvest_error_instructions_fiveB = logs/ +harvest_error_instructions_fiveC = directory exists and the web server user has read and write access to it. +harvest_error_instructions_sixA = In VIVO Harvester, the file +harvest_error_instructions_sixB = vivo/config/vivo.xml +harvest_error_instructions_sixC = is properly configured with your database information and namespace. +step_one = Step 1 +download_template = Download template +download = Download +step_two = Step 2 +fill_in_data = Fill in data +help_capitalized = Help +fill_in_template_with_data = Fill in the template with your data. You may fill in multiple templates if you wish to harvest multiple files at once. +step_three = Step 3 +upload_files = Upload file(s) +upload_completed_templates = Upload your completed template(s). +upload_capitalized = Upload +uploaded_files = Uploaded files +step_four = Step 4 +harvest_capitalized = Harvest +click_to_harvest = Click the button to harvest your file(s). +step_five = Step 5 +view_results = View results +script_executed = Script being executed +progress_capitalized = Progress +undefined_runtime_property = property in runtime.properties is undefined. +define_value_for_property = In order to use this feature, please define a value for this property that points to the Harvester installation directory before redeploying and restarting the application. + +# +# lib templates ( /templates/freemarker/body/lib ) +# +faculty_capitalized = Faculty +loading_faculty = Loading faculty . . . +research_capitalized = Research +view_all = View all ... +view_all_research = view all research +no_research_content_found = No research content found. +departments = Departments +loading_map_information = Loading map information . . . +verify_match_capitalized = Verify this match + +# +# custom form templates ( /templates/freemarker/edit/forms ) +# +manage_concepts = Manage Concepts +no_concepts_specified = There are currently no concepts specified. +return_to_profile = Return to Profile Page +external_vocabulary_services = External Vocabulary Services +create_own_concept = Select or create a VIVO-defined concept. +add_selected_concept = Add Selected Concept +cannot_find_concept = Can't find the concept you want? Select or create a VIVO-defined concept. +add_concept = Add Concept + +event_type = event type +attended = attended + +manage_authors = Manage Authors +no_linked_author = no linked author +remove_author_link = remove author link +add_author = Add Author +return_to_publication = Return to publication +add_an_author = Add an Author +person_capitalized = Person +organization_capitalized = Organization +middle_name = Middle name +initial_okay = initial okay +selected_author = Selected Author +organization_name_capitalized = Organization name +selected_organization = Selected Organization + +clinical_activity = clinical activity +clinical_activity_type = clinical activity type +year_hint_format = YYYY + +collection_series_editor_role = collection or series editor role +editor_role_in = editor role in + +edit_wbpage_of = Edit webpage of +add_webpage_for = Add webpage for +add_webpage = Add Web Page +url_type = URL Type +faculty_of_1000 = Faculty of 1000 Link +standard_web_link = Standard Web Link +webpage_name = Webpage Name + +investigator_entry_for = investigator entry for +investigator_capitalized = Investigator +principal_investigator_entry_for = principal investigator entry for +co_principal_investigator_entry_for = co-principal investigator entry for +start_year_must_precede_end = The Start Year must be earlier than the End Year. +end_year_must_be_later = The End Year must be later than the Start Year. +enter_or_select_grant = Please enter or select a value in the Grant Name field. +selected_grant = Selected Grant +years_of_grant_participation = Years of Participation in Grant + +leadership = leadership +organization_type = organization type + +membership = membership +membership_in = membership in +organizations = organizations + +organizer_of = organizer of + +outreach_comm_service = outreach & community service +outreach_comm_service_in = outreach & community service in + +select_or_enter_name = Please select an existing value or enter a new value in the Name field. +presentation_entry_for = presentation entry for +presentation_capitalized = Presentation +presentation_type = Presentation Type +role_in = Role in +presentation_hint = e.g., Moderator, Speaker, Panelist +presented_at = Presented At +selected_conference = Selected Conference + +select_existing_pub_or_enter_new = Please select an existing publication in the Title field or enter a new one. + +publication_entry_for = publication entry for +publication_type = Publication Type +selected_publication = Selected Publication +published_in = Published in +selected_journal = Selected Journal +selected_event = Selected Event +proceedings_of = Proceedings of +editor_capitalized = Editor +required_with_last_name = required with new Last name +selected_editor = Selected Editor +publisher_capitalized = Publisher +selected_publisher = Selected Publisher +volume_capitalized = Volume +number_capitalized = Number +issue_capitalized = Issue +chapter_capitalized = Chapter +start_page = Start Page +end_page = End Page +selected_book = Selected Book +publication_date = Publication Date +place_of_publication = Place of Publication + +research_activity = research activity +research_activity_type = research activity type + +reviewer_of = reviewer of + +entry_for = entry for +specify_role_for_activity = Please specify a role for this activity. +start_year = Start Year + +service_to_profession = service to the profession +service_to_profession_in = service to the profession in + +teaching_activity = teaching activity +teaching_activity_type = teaching activity type +teaching_role_hint = e.g., Instructor, Facilitator, Assistant + +create_own_concept_all_caps = Create Your Own Concept +concept_capitalized = Concept +selected_concept = Selected Concept +create_concept = Create Concept +return_to_manage_concepts = Return to Manage Concepts + +institutional_internal_class = Institutional Internal Class +internal_class_intro_one = This class will be used to designate those individuals internal to your institution. +internal_class_intro_two = This will allow you to limit the individuals displayed on your menu pages (People, Research, etc.) to only those within your institution. +no_local_oncologies = There are currently no recognized local ontologies. +namespace_must_use_this_pattern = In order for a local ontology to be recognized here, its namespace URI must follow this pattern +new_local_oncology = a new local ontology +return_here_to_define_class = and then return here to define the institutional internal class. +select_existing_local_class = Select an existing class from a local extension +cannot_find_class = Can't find an appropriate class? +create_new_class = Create a new class +create_new_one = Create a new one +use_capitals_each_word = use capitals for the first letter of each word +local_namespace = Local Namespace +problematic_section_error = Error: problematic section as above should all have been handled. +new_local_ontology = new local ontology + +manage_grants_and_projects = Manage Grants & Projects for +check_grants_to_exclude = Check those grants and projects you want to exclude from the profile page. + +manage_affiliated_people = Manage People Affiliated with +check_people_to_exclude = Check those people you want to exclude from the profile page. + +manage_publications_for = Manage Publications for +check_pubs_to_exclude = Check those publications you want to exclude from the profile page. + +manage_web_pages = Manage Web Pages +has_no_webpages = This individual currently has no web pages specified. Add a new web page by clicking on the button below. +edit_webpage_link = edit web page link +delete_webpage_link = delete web page link +webpage_url = webpage url +add_new_web_page = Add New Web Page + +enable_internal_class_one = To enable this option, you must first select an +enable_internal_class_two = for your instance +internal_class = institutional internal class +only_display = Only display +within_my_institution = within my institution + +enter_a_name = Please enter a value in the Name field. +enter_last_name = Please enter a Last name for this person. +enter_first_name = Please enter a First name for this person. + +posn_history_entry_for = position history entry for +enter_posn_title_value = Please enter a value in the Position Title field. +enter_posn_type_value = Please select a value in the Position Type field. +enter_or_select_person_value = Please select an existing value or enter a new value in the Person field. +position_title = Position Title +position_type = Position Type +selected_person = Selected Person + +degree_candidacy = Degree Candidacy +subject_area = Subject Area +selected_subject_area = Selected Subject Area +selected_advisee = Selected Advisee +selected_advisor = Selected Advisor +advisee_capitalized = Advisee +advisor_capitalized = Advisor +advising_relationship_type = Advising Relationship Type +select_advising_relationship_type = Please select an Advising Relationship Type. +advisor_relationship_entry_for = advisor relationship entry for +advisee_relationship_entry_for = advisee relationship entry for +years_participating = Years of Participation + +award_or_honor_for = award or honor for +select_Award_or_enter_name = Please select an existing value or enter a new value in the Award or Honor Name field. +award_honor_name = Award or Honor Name +conferred_by_capitalized = Conferred by +selected_conferred = Selected Conferrer +description = Description +year_awarded = Year Awarded +years_inclusive = Years Inclusive +award_hint = (e.g., for multi-year awards) + +educational_training_for = educational training entry for +select_organization_type = Please select a value in the Organization Type field. +select_an_organization_name = Please enter or select a value in the Name field. +select_educational_training_value = Please select a value in the Type of Educational Training field. +org_type_capitalized = Organization Type +educational_training_type = Type of Educational Training +dept_or_school_name = Department or School Name within the +degree = Degree +missing_degree = missing degree +major_field = Major Field of Degree +supplemental_information = Supplemental Information +supplemental_information_hint = (e.g., Thesis title, Transfer info, etc.) +academic_studies_or_other = Academic Studies or Other Training + +create_mailing_address = Create Mailing Address +mailing_address_for = mailing address for +enter_a_country = Please enter a value in the Country field. +enter_street_address = Please enter a value in the Street Address field. +enter_a_locality = Please enter a value in the City/Locality field. +enter_postal_code = Please enter a value in the Postal Code field. +country = Country +street_address = Street Address +city_locality = City/Locality +region = State/Province/Region +postal_code = Postal Code + +posn_entry_for = position entry for + +# +# coauthorship templates ( /templates/freemarker/visualization/coauthorship ) +# +within_last_10_years = within the last 10 years +total = total +from = from +file = file +file_capitalized = File +view_full_timeline_and_network = View full timeline and co-author network. +download_data_as = Download data as +unique_coauthors_per_year = Unique Co-Authors per year +count_capitalized = Count + +# +# copi templates ( /templates/freemarker/visualization/copi ) +# +year_capitalized = Year +unique_coinvestigators = Unique co-investigators +co_investigator = co-investigator +co_investigators = co-investigators +unique_coinvestigators_per_year = Unique Co-Investigators per year +view_timeline_copi_network = View full timeline and co-investigator network. + +# +# entity comparison templates ( /templates/freemarker/visualization/entitycomparison ) +# +parent_organization_of = Parent organization of +temporal_graph_drill_up = temporal graph drill up +how_to_compare = How do you want to compare? +no_view_link = no view link +persistent_link_to_visualization = Persistent link to current visualization +error_notification = error notification +close_me = Close Me +what_to_compare = What do you want to compare? +organizations_capitalized = Organizations +people_capitalized = People +organization_hierarchy_note = Note: the organizations or people listed below are only those which are directly beneath {0} in the organization hierarchy. You may 'drill down' to see the organizations or people below a given sub-organization by selecting the chart icon next to a selected sub-organization's name below the graph on the right. +save_all_as_csv = Save All as CSV +clear_capitalized = Clear +clear_all_selected_entities = Clear all selected entities. +comparing_capitalized = Comparing +of = of +institutions_capitalized = Institutions +info_based_on_vivo_data = This information is based solely on {0} which have been loaded into the VIVO system. +you_have_selected = You have selected +of_a_maximum = of a maximum +schools = schools +legend_capitalized = Legend +with_unknown_year = with unknown year +with_known_year = with known year +from_current_incomplete_year = from current incomplete year + +entity_comp_error_text1 = This organization has neither sub-organizations nor people with +entity_comp_error_text2 = in the system. +entity_comp_error_text3 = Please visit the full +entity_comp_error_text4 = for a more complete overview. +profile_page = profile page + +publication = publication +published = published +publications = publications +by_publications = by Publications +publications_capitalized = Publications +grant = grant +granted = granted +grants = grants +by_grants = by Grants +grants_capitalized = Grants +activity = activity +activities = activities + +# +# grant visualization templates ( /templates/freemarker/visualization/grant ) +# +view_all_grants = view all grants +view_all_grants_text = View all VIVO grants and corresponding co-investigator network. +grant_per_year = Grants per year +link = link + +# +# map of science templates ( /templates/freemarker/visualization/mapOfScience ) +# +parent_entity = parent entity +map_of_science_icon = map of science icon +explore_activity = Explore activity +explore_capitalized = Explore +across_subdisciplines = across 554 scientific subdisciplines +compare_organizations = Compare organizations +mapped = mapped +save_unmapped_publications = Save Unmapped Publications +map_of_science_visualization = Map of Science Visualization +no_publications_for_this_organization = No publications in the system have been attributed to this organization. +please_visit = Please visit the +for_complete_overview = for a complete overview. + +# +# model constructor templates ( /templates/freemarker/visualization/modelconstructor ) +# +cached_models_regenerated = The following cached models will be regenerated. +uri_independent_model = URI Independent Model +currently_no_constructed_models = Currently there are no constructed models for use by visualization. + +# +# person level templates ( /templates/freemarker/visualization/personlevel) +# +co_investigator_icon = co-investigator icon +co_authorship = co-authorship +this_author = this author +in_the_vivo_db = in the VIVO database. +no_papers_for = Currently there are no papers for +publication_s_capitalized = Publication(s) +co_author_s_capitalized = Co-author(s) +incomplete_data_note1 = Note: This information is based solely on publications that have been loaded into the VIVO system. This may only be a small sample of the person's total work. +incomplete_data_note2 = Go to your profile page to enter additional details about your publications. +incomplete_data_note3 = Log in to enter additional details about your publications on your profile page. +tables_capitalized = Tables +publications_per_year = Publications per year + +investigator_name = investigator name +co_author_icon = co-author icon +currently_no_grants_for = Currently there are no {0} grants for +this_investigator = this investigator +grant_s_capitalized = Grant(s) +co_investigator_s_capitalized = Co-investigator(s) +incomplete_grant_data_note1 = Note: This information is based solely on grants that have been loaded into the VIVO system. This may only be a small sample of the person's total work. +incomplete_grant_data_note2 = Go to your profile page to enter additional details about your grants. +incomplete_grant_data_note3 = Log in to enter additional details about your grants on your profile page. +grants_per_year = Grants per year +grant_info_for_all_years = The information in the following tables is for all years. +grant_sparkline_note = The spark lines shown above reflect grants through the last complete calendar year. These tables, however, show the grant information for all years, based on the information loaded in the VIVO system. + +# +# publication templates ( /templates/freemarker/visualization/publication) +# +numbers_based_on_publications_in_vivo = These numbers are based solely on publications that have been loaded into this VIVO application. If this is your profile, you can enter additional publications below. +last_ten_full_years = in the last 10 full years + +last_ten_full = in the last 10 full +download_link = download link +years = years + +# +# miscellaneous visualization templates ( /templates/freemarker/visualization) +# +visualization_tools = Visualization Tools +refresh_cached_vis_models = Refresh Cached Models for Visualization +why_needed = Why is it needed? +vis_tools_note_one = Large-scale visualizations like the Temporal Graph or the Map of Science involve calculating total counts of publications or of grants for some entity. Since this also means checking through all of its sub-entities, the underlying queries can be both memory-intensive and time-consuming. For a faster user experience, we wish to save the results of these queries for later re-use. +vis_caching_process = What's involved in the caching process? +vis_tools_note_two = To this end we have devised a caching solution which will retain information about the hierarchy of organizations -- namely, which publications are attributed to which organizations -- by storing the RDF model. +vis_tools_note_three = We're currently caching these models in memory. The cache is built (only once) on the first user request after a server restart. Because of this, the same model will be served until the next restart. This means that the data in these models may become stale depending upon when it was last created. This works well enough for now. In future releases we will improve this solution so that models are stored on disk and periodically updated. +vis_tools_note_four = The models are refreshed each time the server restarts. Since this is not generally practical on production instances, administrators can instead use the "refresh cache" link above to do this without a restart. + +# +# custom form javascript variables ( /templates/freemarker/edit/js) +# +drag_drop_reorder_authors = Drag and drop to reorder authors +reordering_authors_failed = Reordering of authors failed. +confirm_author_removal = Are you sure you want to remove this author: +error_processing_author_request = Error processing request: author not removed +author_capitalized = Author +or_add_new_one = or add a new one. + +vocabulary_service_unavailable = An error was encountered in executing this search. +no_serch_results_found = No search results were found. +label_type = Label (Type) +label_altLabels = Label (Alternate Labels) +definition_capitalized = Definition +best_match = Best Match +select_term_from_results = Please select at least one term from the search search results. +select_vocabulary_source_to_search = Please select at least one external vocabulary source to search. +confirm_term_deletion = Are you sure you want to remove this term? +error_term_not_deleted = Error processing request: term not removed + +advising = advising +advising_relationship = advising relationship + +select_or_create_organization = Select an existing Organization or create a new one. + +grant_successfully_excluded = The item has been successfully excluded from the profile page. +error_excluding_grant = Error processing request: the item cannot be excluded from the profile page. + +person_successfully_excluded = The person has been successfully excluded from the organization page. +error_excluding_person = Error processing request: the person cannot be excluded from the organization page. + +publication_successfully_excluded = The publication will has been successfully excluded from the profile page. +error_excluding_publication = Error processing request: the publication cannot be excluded from the profile page. + +drag_drop_to_reorder_webpages = Drag and drop to reorder web pages +webpage_reordering_failed = Reordering of web pages failed. +confirm_webpage_deletion = Are you sure you want to remove this web page? +error_removing_webpage = Error processing request: web page not removed. + +# +# miscellaneous javascript variables ( productMods/js) +# +researcher = researcher + +# +# individual javascript variables ( productMods/js/individual) +# +error_processing_type_change = Error processing request: the unchecked labels could not be deleted. + +# +# visualization javascript variables ( productMods/js/visualization) +# +publications_with = Publications with + +co_investigators_capitalized = Co-investigators +grants_with = Grants with + +vis_first_link = First +vis_last_link = Last +vis_previous_link = Prev +vis_next_link = Next + +max_entity_note = A Maximum 10 entities can be compared. Please remove some & try again. +organizations_and_people = Organizations and People +loading_data_for = Loading data for +data_for = Data for +refreshing_data_message = is now being refreshed. The visualization will load as soon as we are done computing, or you can search or browse other data in VIVO and come back in a few minutes. +disclaimer_text_one = This information is based solely on +disclaimer_text_two = which have been loaded into the VIVO system as of +level_undefined_error = ENTITY LEVEL UNDEFINED ERROR + +total_number_of = Total Number of +number_of = Number of +have_an_unknown = have an unknown +year_not_chartered = year (not charted above) +in_completed_year = in a completed year +were = were +in_current_incomplete_year = in the current incomplete year (not charted above) +publication_count = Publication Count +grant_count = Grant Count +entity_type = Entity Type +entity_label = Entity Label +no_matching_entities_found = No matching entities found +clear_search_query = clear search query +short_max_entity_note = A Maximum of 10 entities can be compared. +information_capitalized = Information +content_requires_flash = This content requires the Adobe Flash Player. +get_flash = Get Flash +of_pubs = of pubs. +max_nbr_for_comp = The maximum number of items for comparison is 3. +no_matching_science_areas = No matching science areas found + +subdisciplines = Subdisciplines +disciplines = Disciplines +science_area_level = Level of Science Area +of_activity = of activity + +drill_down = drill down + +disciplines_lower = disciplines +subdisciplines_lower = subdisciplines +show_discipline_labels = Show discipline labels + +no_attributed_publications = No publications in the system have been attributed to this +none_of_the = None of the +publications_attributed_to = publications attributed to this +been_science_located = have been "science-located." +publication_attributed_to = The publication attributed to this +not_science_located = has not been "science-located." +no_journal_information = have no journal information. +no_matching_map_location = could not be matched with a map location using their journal information. + +map_being_refreshed_msg = is now being refreshed. The visualization will load as soon as we are done computing, or you can search or browse other data in VIVO and come back in a few minutes. + +publication_pubs = publications (pubs.) +percent_activity = % activity + +# +# miscellaneous additions +# + +standardview_tooltip_one = Click to display the +standardview_tooltip_two = profile quick view. +research_area_tooltip_one = Click an area to view others +research_area_tooltip_two = with the same interest. +quickview_tooltip = Click to view the standard profile page. +global_research = Global Research +country_wide_research = Country-wide Research +local_research = Local Research +selected_presentation = Selected Presentation +event_capitalized = Event +item_capitalized = Item +telephone_number_for = telephone number for +telephone_number = Telephone Number +enter_telephone_number = Please enter a value in the Telephone Number field. +email_address_for = email address for +enter_email_address = Please enter a value in the Email Address field. +full_name_for = full name for +title_not_found = Title not found. +speeches_capitalized = Speeches +theses_capitalized = Theses +select_document_type = Please select a value in the Document Type field. +select_a_document_name = Please enter or select a value in the Document Name field. +document_type_capitalized = Document Type +document_name_capitalized = Document Name +selected_document = Selected Document +editor_name = editor name +missing_editor = missing editor +drag_drop_reorder_editors = Drag and drop to reorder editors +reordering_editors_failed = Reordering of editors failed. +confirm_editor_removal = Are you sure you want to remove this editor: +error_processing_editor_request = Error processing request: editor not removed +manage_editors = Manage Editors +no_linked_editor = no linked editor +remove_editor_link = remove editor link +add_an_editor = Add an Editor +add_editor = Add Editor +please_select_type = Please select a type from the drop-down list. +preferred_title = Preferred Title +preferred_title_for = preferred title for +enter_preferred_title = Please enter a value in the Preferred Title field. +fax_number_for = fax number for +fax_number = Fax Number +enter_fax_number = Please enter a value in the Fax Number field. +credentials = credentials +select_credential_or_enter_name = Please enter or select a value in the Credential Name field. +type_of_credential = Type of Credential +credential_name = Credential Name +selected_credential = Selected Credential +year_issued = Year Issued +year_awarded_for = year awarded for +create_year_awarded = Create year awarded +edit_year_awarded = Edit year awarded +publication_date_for = publication date for +create_publication_date = Create publication date +edit_publication_date = Edit publication date +name_prefix = Name Prefix +name_suffix = Name Suffix +administering_organization_for = administering organization for +missing_credential = missing credential +grant_administered_by = grant being administered by +missing_grant = missing grant +editor_of_entry = editor of entry for +role_type = Role type +researcher_role = Researcher Role +search_service_btn = Search Service +through_today = Publications through today's date +doi_link=Digital Object Identifier (DOI) + +using_cache_time=Using information cached at + +# +#New Entries for i18n purposes +# +edit_entry_for_head_role=: Edit this "head of" role +edit_entry_for_member_role=: Edit this membership +edit_entry_for_clinical_role=: Edit this clinical activity +edit_entry_for_attendee_role=: Edit this participation +edit_entry_for_organizer_role=: Edit this organizer role +edit_entry_for_editor_role=: Edit this editor role +edit_entry_for_service_provider_role=: Edit this service provider role +edit_entry_for_outreach_provider_role=: Edit this outreach provider role +edit_entry_for_researcher_role=: Edit this researcher role +edit_entry_for_reviewer_role=: Edit this reviewer role +edit_entry_for_teacher_role=: Edit this teaching role + +create_entry_for_head_role=: Add a new "head of" role +create_entry_for_member_role=: Add a new membership +create_entry_for_clinical_role=: Add a new clinical activity +create_entry_for_attendee_role=: Add a new participation +create_entry_for_organizer_role=: Add a new Organizer role +create_entry_for_editor_role=: Add a new editor role +create_entry_for_service_provider_role=: Add a new service provider role +create_entry_for_outreach_provider_role=: Add a new outreach provider role +create_entry_for_researcher_role=: Add a new researcher role +create_entry_for_reviewer_role=: Add a new reviewer role +create_entry_for_teacher_role=: Add a new teaching role + + +save_changes=Save +start_capitalized = Start +end_capitalized = End +institution_name=Name of Institution +role_in_institution=Role in Institution +presentation_name_capitalized=Title of Presentation +role_in_presentation_capitalized=Role in Presentation +advisee_capitalized_first_name=First Name +advisee_capitalized_lastname=Last Name + diff --git a/webapp/src/main/webapp/images/placeholders/placeholders.properties b/webapp/src/main/webapp/images/placeholders/placeholders.properties index 32168afd..5452a10c 100644 --- a/webapp/src/main/webapp/images/placeholders/placeholders.properties +++ b/webapp/src/main/webapp/images/placeholders/placeholders.properties @@ -12,7 +12,7 @@ # means that any individual of type foaf:Person will be represented by # person.thumbnail.jpg # -# NOTE: a colon is a special character in a properties file, and must be escaped +# NOTE: a colon is a special character in a properties file, and must be escaped # by a backslash. http\://xmlns.com/foaf/0.1/Person = /images/placeholders/person.thumbnail.jpg diff --git a/webapp/src/main/webapp/js/d3.min.js b/webapp/src/main/webapp/js/d3.min.js index 6ba6b41e..6059ff69 100644 --- a/webapp/src/main/webapp/js/d3.min.js +++ b/webapp/src/main/webapp/js/d3.min.js @@ -5,4 +5,4 @@ i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7}return"Z"in i?(i.H+=i.Z/10 var n,e,r=t.event.changedTouches,i=r.length;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),n=0;n=240?t-240:t+120,i,r),Rt(t,i,r),Rt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Bl=Math.PI/180,jl=180/Math.PI,Hl=.95047,Xl=1,Vl=1.08883,$l=4/29,Wl=6/29,Zl=3*Wl*Wl,Gl=Wl*Wl*Wl;Al(Dt,Ut,wt(Mt,{brighter:function(t){return new Dt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Dt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=Xl*Ft(t),n=Hl*Ft(n),e=Vl*Ft(e),new At(It(3.2404542*n-1.5371385*t-.4985314*e),It(-.969266*n+1.8760108*t+.041556*e),It(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Al(Ht,jt,wt(Mt,{brighter:function(t){return new Ht(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Ht(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return qt(this).rgb()}}));var Jl=-.14861,Ql=1.78277,Kl=-.29227,th=-.90649,nh=1.97294,eh=nh*th,rh=nh*Ql,ih=Ql*Kl-th*Jl;Al($t,Vt,wt(Mt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $t(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $t(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Bl,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new At(255*(n+e*(Jl*r+Ql*i)),255*(n+e*(Kl*r+th*i)),255*(n+e*(nh*r)),this.opacity)}}));var oh,uh,ah,ch,sh,fh,lh=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=ro&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:mh(e,r)})),o=wh.lastIndex;return onp&&e.statetp&&e.name===n)return new Kn([[t]],td,n,+r)}return null},ed=function(t){return function(){return t}},rd=function(t,n,e){this.target=t,this.type=n,this.selection=e},id=function(){t.event.preventDefault(),t.event.stopImmediatePropagation()},od={name:"drag"},ud={name:"space"},ad={name:"handle"},cd={name:"center"},sd={name:"x",handles:["e","w"].map(Me),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},fd={name:"y",handles:["n","s"].map(Me),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},ld={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(Me),input:function(t){return t},output:function(t){return t}},hd={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},pd={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},dd={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},vd={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},_d={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1},gd=function(){return ze(ld)},yd=Math.cos,md=Math.sin,xd=Math.PI,bd=xd/2,wd=2*xd,Md=Math.max,Td=function(){function t(t){var o,u,a,c,s,f,l=t.length,h=[],p=Gs(l),d=[],v=[],_=v.groups=new Array(l),g=new Array(l*l);for(o=0,s=-1;++s1e-6)if(Math.abs(f*a-c*s)>1e-6&&i){var h=e-o,p=r-u,d=a*a+c*c,v=h*h+p*p,_=Math.sqrt(d),g=Math.sqrt(l),y=i*Math.tan((Nd-Math.acos((d+l-v)/(2*_*g)))/2),m=y/g,x=y/_;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*s)+","+(n+m*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>s*p)+","+(this._x1=t+x*a)+","+(this._y1=n+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),c=t+u,s=n+a,f=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+s:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-s)>1e-6)&&(this._+="L"+c+","+s),e&&(l<0&&(l=l%Ed+Ed),l>Ad?this._+="A"+e+","+e+",0,1,"+f+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+f+","+(this._x1=c)+","+(this._y1=s):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Nd)+","+f+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Cd=function(){function t(){var t,a=kd.call(arguments),c=n.apply(this,a),s=e.apply(this,a),f=+r.apply(this,(a[0]=c,a)),l=i.apply(this,a)-bd,h=o.apply(this,a)-bd,p=f*yd(l),d=f*md(l),v=+r.apply(this,(a[0]=s,a)),_=i.apply(this,a)-bd,g=o.apply(this,a)-bd;if(u||(u=t=Re()),u.moveTo(p,d),u.arc(0,0,f,l,h),l===_&&h===g||(u.quadraticCurveTo(0,0,v*yd(_),v*md(_)),u.arc(0,0,v,_,g)),u.quadraticCurveTo(0,0,p,d),u.closePath(),t)return u=null,t+""||null}var n=qe,e=Ue,r=De,i=Oe,o=Fe,u=null;return t.radius=function(n){return arguments.length?(r="function"==typeof n?n:Sd(+n),t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:Sd(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:Sd(+n),t):o},t.source=function(e){return arguments.length?(n=e,t):n},t.target=function(n){return arguments.length?(e=n,t):e},t.context=function(n){return arguments.length?(u=null==n?null:n,t):u},t};Ie.prototype=Ye.prototype={constructor:Ie,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var zd=function(){function t(n,i,u,a){if(i>=o.length)return null!=r?r(n):null!=e?n.sort(e):n;for(var c,s,f,l=-1,h=n.length,p=o[i++],d=Ye(),v=u();++lo.length)return t;var i,a=u[e-1];return null!=r&&e>=o.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=a?i.sort(function(t,n){return a(t.key,n.key)}):i}var e,r,i,o=[],u=[];return i={object:function(n){return t(n,0,Be,je)},map:function(n){return t(n,0,He,Xe)},entries:function(e){return n(t(e,0,He,Xe),0)},key:function(t){return o.push(t),i},sortKeys:function(t){return u[o.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}},Pd=Ye.prototype;Ve.prototype=$e.prototype={constructor:Ve,has:Pd.has,add:function(t){return t+="",this["$"+t]=t,this},remove:Pd.remove,clear:Pd.clear,values:Pd.keys,size:Pd.size,empty:Pd.empty,each:Pd.each};var Ld=function(t){var n=[];for(var e in t)n.push(e);return n},Rd=function(t){var n=[];for(var e in t)n.push(t[e]);return n},qd=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},Ud=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?Ze(t,n):We(t)});return o.columns=i,o}function e(t,n){function e(){if(f>=s)return u;if(i)return i=!1,o;var n,e=f;if(34===t.charCodeAt(e)){for(var r=e;r++t||t>i||r>n||n>o))return this;var u,a,c=i-e,s=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,o=r+c,t>i||n>o);break;case 1:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,o=r+c,e>t||n>o);break;case 2:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,r=o-c,t>i||r>n);break;case 3:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,r=o-c,e>t||r>n)}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},Qd=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},Kd=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},tv=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},nv=function(t,n,e){var r,i,o,u,a,c,s,f=this._x0,l=this._y0,h=this._x1,p=this._y1,d=[],v=this._root;for(v&&d.push(new tv(v,f,l,h,p)),null==e?e=1/0:(f=t-e,l=n-e,h=t+e,p=n+e,e*=e);c=d.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>p||(u=c.x1)=g)<<1|t>=_)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-s],d[d.length-1-s]=c)}else{var y=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=y*y+m*m;if(x=(a=(d+_)/2))?d=a:_=a,(f=u>=(c=(v+g)/2))?v=c:g=c,n=p,!(p=p[l=f<<1|s]))return this;if(!p.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[h]=p:this._root=p),this):(this._root=i,this)},rv=function(){return this._root},iv=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},ov=function(t){var n,e,r,i,o,u,a=[],c=this._root;for(c&&a.push(new tv(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&c.length){var s=(r+o)/2,f=(i+u)/2;(e=c[3])&&a.push(new tv(e,s,f,o,u)),(e=c[2])&&a.push(new tv(e,r,f,s,u)),(e=c[1])&&a.push(new tv(e,s,i,o,f)),(e=c[0])&&a.push(new tv(e,r,i,s,f))}return this},uv=function(t){var n,e=[],r=[];for(this._root&&e.push(new tv(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,c=n.x1,s=n.y1,f=(u+c)/2,l=(a+s)/2;(o=i[0])&&e.push(new tv(o,u,a,f,l)),(o=i[1])&&e.push(new tv(o,f,a,c,l)),(o=i[2])&&e.push(new tv(o,u,l,f,s)),(o=i[3])&&e.push(new tv(o,f,l,c,s))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},av=function(t){return arguments.length?(this._x=t,this):this._x},cv=function(t){return arguments.length?(this._y=t,this):this._y},sv=er.prototype=rr.prototype;sv.copy=function(){var t,n,e=new rr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ir(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ir(n));return e},sv.add=Gd,sv.addAll=Qe,sv.cover=Jd,sv.data=Qd,sv.extent=Kd,sv.find=nv,sv.remove=ev,sv.removeAll=Ke,sv.root=rv,sv.size=iv,sv.visit=ov,sv.visitAfter=uv,sv.x=av,sv.y=cv;var fv,lv=function(t){function n(){function t(t,n,e,r,i){var o=t.data,a=t.r,p=l+a;{if(!o)return n>s+p||rf+p||ic.index){var d=s-o.x-o.vx,v=f-o.y-o.vy,_=d*d+v*v;_t.r&&(t.r=t[n].r)}function r(){if(i){var n,e,r=i.length;for(o=new Array(r),n=0;n1?(null==n?l.remove(t):l.set(t,i(n)),o):l.get(t)},find:function(n,e,r){var i,o,u,a,c,s=0,f=t.length;for(null==r?r=1/0:r*=r,s=0;s1?(p.on(t,n),o):p.on(t)}}},_v=function(){function t(t){var n,a=i.length,c=er(i,sr,fr).visitAfter(e);for(u=t,n=0;n=f)){(t.data!==o||t.next)&&(0===i&&(i=Zd(),p+=i*i),0===c&&(c=Zd(),p+=c*c),p1?r[0]+r.slice(2):r,+t.slice(e+1)]},xv=function(t){return t=mv(Math.abs(t)),t?t[1]:NaN},bv=function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(e.substring(i-=a,i+a)),!((c+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}},wv=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},Mv=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},Tv=function(t,n){var e=mv(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(fv=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+mv(t,Math.max(0,n+o-1))[0]},kv=function(t,n){var e=mv(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Sv={"":Mv,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return kv(100*t,n)},r:kv,s:Tv,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Nv=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;lr.prototype=hr.prototype,hr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Ev,Av=function(t){return t},Cv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],zv=function(t){function n(t){function n(t){var n,i,s,m=v,x=_;if("c"===d)x=g(t)+x,t="";else{t=+t;var b=t<0;if(t=g(Math.abs(t),p),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=x+("s"===d?Cv[8+fv/3]:"")+(b&&"("===c?")":""),y)for(n=-1,i=t.length;++n(s=t.charCodeAt(n))||s>57){x=(46===s?o+t.slice(n+1):t.slice(n))+x,t=t.slice(0,n);break}}h&&!f&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return u(t)}t=lr(t);var e=t.fill,a=t.align,c=t.sign,s=t.symbol,f=t.zero,l=t.width,h=t.comma,p=t.precision,d=t.type,v="$"===s?i[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",_="$"===s?i[1]:/[%p]/.test(d)?"%":"",g=Sv[d],y=!d||/[defgprs%]/.test(d);return p=null==p?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=lr(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(xv(e)/3))),o=Math.pow(10,-i),u=Cv[8+i/3];return function(t){return r(o*t)+u}}var r=t.grouping&&t.thousands?bv(t.grouping,t.thousands):Av,i=t.currency,o=t.decimal,u=t.numerals?wv(t.numerals):Av;return{format:n,formatPrefix:e}};pr({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Pv=function(t){return Math.max(0,-xv(Math.abs(t)))},Lv=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(xv(n)/3)))-xv(Math.abs(t)))},Rv=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,xv(n)-xv(t))+1},qv=function(){return new dr};dr.prototype={constructor:dr,reset:function(){this.s=this.t=0},add:function(t){vr(p_,t,this.t),vr(this,p_.s,this.s),this.s?this.t+=p_.t:this.s=p_.t},valueOf:function(){return this.s}};var Uv,Dv,Ov,Fv,Iv,Yv,Bv,jv,Hv,Xv,Vv,$v,Wv,Zv,Gv,Jv,Qv,Kv,t_,n_,e_,r_,i_,o_,u_,a_,c_,s_,f_,l_,h_,p_=new dr,d_=1e-6,v_=Math.PI,__=v_/2,g_=v_/4,y_=2*v_,m_=180/v_,x_=v_/180,b_=Math.abs,w_=Math.atan,M_=Math.atan2,T_=Math.cos,k_=Math.ceil,S_=Math.exp,N_=Math.log,E_=Math.pow,A_=Math.sin,C_=Math.sign||function(t){return t>0?1:t<0?-1:0},z_=Math.sqrt,P_=Math.tan,L_={Feature:function(t,n){xr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rd_?Hv=90:I_<-d_&&(Bv=-90),Gv[0]=Yv,Gv[1]=jv}},B_=function(t){var n,e,r,i,o,u,a;if(Hv=jv=-(Yv=Bv=1/0),Zv=[],q_(t,Y_),e=Zv.length){for(Zv.sort(Br),n=1,r=Zv[0],o=[r];nYr(r[0],r[1])&&(r[1]=i[1]),Yr(i[0],r[1])>Yr(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-(1/0),e=o.length-1,n=0,r=o[e];n<=e;r=i,++n)i=o[n],(a=Yr(r[1],i[0]))>u&&(u=a,Yv=i[0],jv=r[1])}return Zv=Gv=null,Yv===1/0||Bv===1/0?[[NaN,NaN],[NaN,NaN]]:[[Yv,Bv],[jv,Hv]]},j_={sphere:mr,point:Hr,lineStart:Vr,lineEnd:Zr,polygonStart:function(){j_.lineStart=Gr,j_.lineEnd=Jr},polygonEnd:function(){j_.lineStart=Vr,j_.lineEnd=Zr}},H_=function(t){Jv=Qv=Kv=t_=n_=e_=r_=i_=o_=u_=a_=0,q_(t,j_);var n=o_,e=u_,r=a_,i=n*n+e*e+r*r;return i<1e-12&&(n=e_,e=r_,r=i_,Qv2?t[2]*x_:0),n.invert=function(n){return n=t.invert(n[0]*x_,n[1]*x_),n[0]*=m_,n[1]*=m_,n},n},og=function(){function t(t,n){e.push(t=r(t,n)),t[0]*=m_,t[1]*=m_}function n(){var t=i.apply(this,arguments),n=o.apply(this,arguments)*x_,c=u.apply(this,arguments)*x_;return e=[],r=ni(-t[0]*x_,-t[1]*x_,0).invert,oi(a,n,c,1),t={type:"Polygon",coordinates:[e]},e=r=null,t}var e,r,i=X_([0,0]),o=X_(90),u=X_(6),a={point:t};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:X_([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(o="function"==typeof t?t:X_(+t),n):o},n.precision=function(t){return arguments.length?(u="function"==typeof t?t:X_(+t),n):u},n},ug=function(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:mr,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},ag=function(t,n,e,r,i,o){var u,a=t[0],c=t[1],s=n[0],f=n[1],l=0,h=1,p=s-a,d=f-c;if(u=e-a,p||!(u>0)){if(u/=p,p<0){if(u0){if(u>h)return;u>l&&(l=u)}if(u=i-a,p||!(u<0)){if(u/=p,p<0){if(u>h)return;u>l&&(l=u)}else if(p>0){if(u0)){if(u/=d,d<0){if(u0){if(u>h)return;u>l&&(l=u)}if(u=o-c,d||!(u<0)){if(u/=d,d<0){if(u>h)return;u>l&&(l=u)}else if(d>0){if(u0&&(t[0]=a+l*p,t[1]=c+l*d),h<1&&(n[0]=a+h*p,n[1]=c+h*d),!0}}}}},cg=function(t,n){return b_(t[0]-n[0])=0;--o)i.point((f=s[o])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,s=h.z,p=!p}while(!h.v);i.lineEnd()}}},fg=1e9,lg=-fg,hg=function(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=si(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}},pg=qv(),dg=function(t,n){var e=n[0],r=n[1],i=[A_(e),-T_(e),0],o=0,u=0;pg.reset();for(var a=0,c=t.length;a=0?1:-1,T=M*w,k=T>v_,S=d*x;if(pg.add(M_(S*M*A_(T),v*b+S*T_(T))),o+=k?w+M*y_:w,k^h>=e^y>=e){var N=Cr(Er(l),Er(g));Lr(N);var E=Cr(i,N);Lr(E);var A=(k^w>=0?-1:1)*gr(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(u+=k^w>=0?1:-1)}}return(o<-d_||o0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&u.push(u.pop().concat(u.shift())),d.push(u.filter(ji))}var p,d,v,_=n(o),g=i.invert(r[0],r[1]),y=ug(),m=n(y),x=!1,b={point:u,lineStart:c,lineEnd:s,polygonStart:function(){b.point=f,b.lineStart=l,b.lineEnd=h,d=[],p=[]},polygonEnd:function(){b.point=u,b.lineStart=c,b.lineEnd=s,d=ff(d);var t=dg(p,g);d.length?(x||(o.polygonStart(),x=!0),sg(d,Hi,t,e,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}},Kg=Qg(function(){return!0},Xi,$i,[-v_,-__]),ty=function(t,n){function e(e,r,i,o){oi(o,t,n,i,e,r)}function r(t,n){return T_(t)*T_(n)>a}function i(t){var n,e,i,a,f;return{lineStart:function(){a=i=!1,f=1},point:function(l,h){var p,d=[l,h],v=r(l,h),_=c?v?0:u(l,h):v?u(l+(l<0?v_:-v_),h):0;if(!n&&(a=i=v)&&t.lineStart(),v!==i&&(p=o(n,d),(cg(n,p)||cg(d,p))&&(d[0]+=d_,d[1]+=d_,v=r(d[0],d[1]))),v!==i)f=0,v?(t.lineStart(),p=o(d,n),t.point(p[0],p[1])):(p=o(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(s&&n&&c^v){var g;_&e||!(g=o(d,n,!0))||(f=0,c?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!v||n&&cg(n,d)||t.point(d[0],d[1]),n=d,i=v,e=_},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return f|(a&&i)<<1}}}function o(t,n,e){var r=Er(t),i=Er(n),o=[1,0,0],u=Cr(r,i),c=Ar(u,u),s=u[0],f=c-s*s;if(!f)return!e&&t;var l=a*c/f,h=-a*s/f,p=Cr(o,u),d=Pr(o,l);zr(d,Pr(u,h));var v=p,_=Ar(d,v),g=Ar(v,v),y=_*_-g*(Ar(d,d)-1);if(!(y<0)){var m=z_(y),x=Pr(v,(-_-m)/g);if(zr(x,d),x=Nr(x),!e)return x;var b,w=t[0],M=n[0],T=t[1],k=n[1];M0^x[1]<(b_(x[0]-w)v_^(w<=x[0]&&x[0]<=M)){var A=Pr(v,(-_+m)/g);return zr(A,d),[x,Nr(A)]}}}function u(n,e){var r=c?t:v_-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=T_(t),c=a>0,s=b_(a)>d_;return Qg(r,i,e,c?[0,-t]:[-v_,t-v_])},ny=function(t){return{stream:Wi(t)}};Zi.prototype={constructor:Zi,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ey=16,ry=T_(30*x_),iy=function(t,n){return+n?Ki(t,n):Qi(t)},oy=Wi({point:function(t,n){this.stream.point(t*x_,n*x_)}}),uy=function(){return eo(io).scale(155.424).center([0,33.6442])},ay=function(){return uy().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},cy=function(){function t(t){var n=t[0],e=t[1];return a=null,i.point(n,e),a||(o.point(n,e),a)||(u.point(n,e),a)}function n(){return e=r=null,t}var e,r,i,o,u,a,c=ay(),s=uy().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=uy().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){a=[t,n]}};return t.invert=function(t){var n=c.scale(),e=c.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?f:c).invert(t)},t.stream=function(t){return e&&r===t?e:e=oo([c.stream(r=t),s.stream(t),f.stream(t)])},t.precision=function(t){return arguments.length?(c.precision(t),s.precision(t),f.precision(t),n()):c.precision()},t.scale=function(n){return arguments.length?(c.scale(n),s.scale(.35*n),f.scale(n),t.translate(c.translate())):c.scale()},t.translate=function(t){if(!arguments.length)return c.translate();var e=c.scale(),r=+t[0],a=+t[1];return i=c.translate(t).clipExtent([[r-.455*e,a-.238*e],[r+.455*e,a+.238*e]]).stream(l),o=s.translate([r-.307*e,a+.201*e]).clipExtent([[r-.425*e+d_,a+.12*e+d_],[r-.214*e-d_,a+.234*e-d_]]).stream(l),u=f.translate([r-.205*e,a+.212*e]).clipExtent([[r-.214*e+d_,a+.166*e+d_],[r-.115*e-d_,a+.234*e-d_]]).stream(l),n()},t.fitExtent=function(n,e){return Gi(t,n,e)},t.fitSize=function(n,e){return Ji(t,n,e)},t.scale(1070)},sy=uo(function(t){return z_(2/(1+t))});sy.invert=ao(function(t){return 2*gr(t/2)});var fy=function(){return to(sy).scale(124.75).clipAngle(179.999)},ly=uo(function(t){return(t=_r(t))&&t/A_(t)});ly.invert=ao(function(t){return t});var hy=function(){return to(ly).scale(79.4188).clipAngle(179.999)};co.invert=function(t,n){return[t,2*w_(S_(n))-__]};var py=function(){return so(co).scale(961/y_)},dy=function(){return eo(lo).scale(109.5).parallels([30,30])};ho.invert=ho;var vy=function(){return to(ho).scale(152.63)},_y=function(){return eo(po).scale(131.154).center([0,13.9389])};vo.invert=ao(w_);var gy=function(){return to(vo).scale(144.049).clipAngle(60)},yy=function(){function t(){return i=o=null,u}var n,e,r,i,o,u,a=1,c=0,s=0,f=1,l=1,h=kg,p=null,d=kg;return u={stream:function(t){return i&&o===t?i:i=h(d(o=t))},clipExtent:function(i){return arguments.length?(d=null==i?(p=n=e=r=null,kg):si(p=+i[0][0],n=+i[0][1],e=+i[1][0],r=+i[1][1]),t()):null==p?null:[[p,n],[e,r]]},scale:function(n){return arguments.length?(h=_o((a=+n)*f,a*l,c,s),t()):a},translate:function(n){return arguments.length?(h=_o(a*f,a*l,c=+n[0],s=+n[1]),t()):[c,s]},reflectX:function(n){return arguments.length?(h=_o(a*(f=n?-1:1),a*l,c,s),t()):f<0},reflectY:function(n){return arguments.length?(h=_o(a*f,a*(l=n?-1:1),c,s),t()):l<0},fitExtent:function(t,n){return Gi(u,t,n)},fitSize:function(t,n){return Ji(u,t,n)}}};go.invert=ao(gr);var my=function(){return to(go).scale(249.5).clipAngle(90+d_)};yo.invert=ao(function(t){return 2*w_(t)});var xy=function(){return to(yo).scale(250).clipAngle(142)};mo.invert=function(t,n){return[-n,2*w_(S_(t))-__]};var by=function(){var t=so(mo),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90]).scale(159.155)},wy=function(){function t(t){var o,u=0;t.eachAfter(function(t){var e=t.children;e?(t.x=bo(e),t.y=Mo(e)):(t.x=o?u+=n(t,o):0,t.y=0,o=t)});var a=ko(t),c=So(t),s=a.x-n(a,c)/2,f=c.x+n(c,a)/2;return t.eachAfter(i?function(n){n.x=(n.x-t.x)*e,n.y=(t.y-n.y)*r}:function(n){n.x=(n.x-s)/(f-s)*e,n.y=(1-(t.y?n.y/t.y:1))*r})}var n=xo,e=1,r=1,i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(n){return arguments.length?(i=!1,e=+n[0],r=+n[1],t):i?null:[e,r]},t.nodeSize=function(n){return arguments.length?(i=!0,e=+n[0],r=+n[1],t):i?[e,r]:null},t},My=function(){return this.eachAfter(No)},Ty=function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},Sy=function(t){for(var n,e,r,i=this,o=[i],u=[];i=o.pop();)if(u.push(i),n=i.children)for(e=0,r=n.length;e=0;)e+=r[i].value;n.value=e})},Ey=function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},Ay=function(t){for(var n=this,e=Eo(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},Cy=function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},zy=function(){var t=[];return this.each(function(n){t.push(n)}),t},Py=function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},Ly=function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n};Ro.prototype=Ao.prototype={constructor:Ro,count:My,each:Ty,eachAfter:Sy,eachBefore:ky,sum:Ny,sort:Ey,path:Ay,ancestors:Cy,descendants:zy,leaves:Py,links:Ly,copy:Co};var Ry=function(t){for(var n=(t=t.slice()).length,e=null,r=e;n;){var i=new qo(t[n-1]);r=r?r.next=i:e=i,t[void 0]=t[--n]}return{head:e,tail:r}},qy=function(t){return Do(Ry(t),[])},Uy=function(t){return Xo(t),t},Dy=function(t){return function(){return t}},Oy=function(){function t(t){return t.x=e/2,t.y=r/2,n?t.eachBefore(Go(n)).eachAfter(Jo(i,.5)).eachBefore(Qo(1)):t.eachBefore(Go(Zo)).eachAfter(Jo(Wo,1)).eachAfter(Jo(i,t.r/Math.min(e,r))).eachBefore(Qo(Math.min(e,r)/(2*t.r))),t}var n=null,e=1,r=1,i=Wo;return t.radius=function(e){return arguments.length?(n=Vo(e),t):n},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i="function"==typeof n?n:Dy(+n),t):i},t},Fy=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},Iy=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(r-n)/t.value;++a0)throw new Error("cycle");return o}var n=Ko,e=tu;return t.id=function(e){return arguments.length?(n=$o(e),t):n},t.parentId=function(n){return arguments.length?(e=$o(n),t):e},t};au.prototype=Object.create(Ro.prototype);var Vy=function(){function t(t){var r=cu(t);if(r.eachAfter(n),r.parent.m=-r.z,r.eachBefore(e),c)t.eachBefore(i);else{var s=t,f=t,l=t;t.eachBefore(function(t){t.xf.x&&(f=t),t.depth>l.depth&&(l=t)});var h=s===f?1:o(s,f)/2,p=h-s.x,d=u/(f.x+h+p),v=a/(l.depth||1);t.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return t}function n(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){ou(t);var u=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+o(t._,i._),t.m=t.z-u):t.z=u}else i&&(t.z=i.z+o(t._,i._));t.parent.A=r(t,i,t.parent.A||e[0])}function e(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,n,e){if(n){for(var r,i=t,u=t,a=n,c=i.parent.children[0],s=i.m,f=u.m,l=a.m,h=c.m;a=ru(a),i=eu(i),a&&i;)c=eu(c),u=ru(u),u.a=t,r=a.z+l-i.z-s+o(a._,i._),r>0&&(iu(uu(a,t,e),t,r),s+=r,f+=r),l+=a.m,s+=i.m,h+=c.m,f+=u.m;a&&!ru(u)&&(u.t=a,u.m+=l-f),i&&!eu(c)&&(c.t=i,c.m+=s-h,e=t)}return e}function i(t){t.x*=u,t.y=t.depth*a}var o=nu,u=1,a=1,c=null;return t.separation=function(n){return arguments.length?(o=n,t):o},t.size=function(n){return arguments.length?(c=!1,u=+n[0],a=+n[1],t):c?null:[u,a]},t.nodeSize=function(n){return arguments.length?(c=!0,u=+n[0],a=+n[1],t):c?[u,a]:null},t},$y=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++a1?n:1)},e}(Wy),Gy=function(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=o,t.eachBefore(n),u=[0],r&&t.eachBefore(Fy),t}function n(t){var n=u[t.depth],r=t.x0+n,i=t.y0+n,o=t.x1-n,h=t.y1-n;o=n-1){var s=c[t];return s.x0=r,s.y0=i,s.x1=u,s.y1=a,void 0}for(var l=f[t],h=e/2+l,p=t+1,d=n-1;p>>1;f[v]a-i){var y=(r*g+u*_)/e;o(t,p,_,r,i,y,a),o(p,n,g,y,i,u,a)}else{var m=(i*g+a*_)/e;o(t,p,_,r,i,u,m),o(p,n,g,r,m,u,a)}}var u,a,c=t.children,s=c.length,f=new Array(s+1);for(f[0]=a=u=0;u1?n:1)},e }(Wy),tm=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e=0;--n)s.push(t[r[o[n]][2]]);for(n=+a;na!=s>a&&u<(c-e)*(a-r)/(s-r)+e&&(f=!f),c=e,s=r;return f},om=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r1);return t+n*i*Math.sqrt(-2*Math.log(r)/r)}},fm=function(){var t=sm.apply(this,arguments);return function(){return Math.exp(t())}},lm=function(t){return function(){for(var n=0,e=0;e=200&&e<300||304===e){if(o)try{n=o.call(r,s)}catch(t){return void a.call("error",r,t)}else n=s;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=d("beforesend","progress","load","error"),c=Ye(),s=new XMLHttpRequest,f=null,l=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=s.ontimeout=e:s.onreadystatechange=function(t){s.readyState>3&&e(t)},s.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?c.get(t):(null==n?c.remove(t):c.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return s.open(n,t,!0,f,l),null==i||c.has("accept")||c.set("accept",i+",*/*"),s.setRequestHeader&&c.each(function(t,n){s.setRequestHeader(n,t)}),null!=i&&s.overrideMimeType&&s.overrideMimeType(i),null!=u&&(s.responseType=u),h>0&&(s.timeout=h),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=mu(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,s),s.send(null==e?null:e),r},abort:function(){return s.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},vm=function(t,n){return function(e,r){var i=dm(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},_m=vm("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),gm=vm("application/json",function(t){return JSON.parse(t.responseText)}),ym=vm("text/plain",function(t){return t.responseText}),mm=vm("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),xm=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=dm(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(bu(n,r=t)):r},o.row(r),i?o.get(i):o}},bm=xm("text/csv",Od),wm=xm("text/tab-separated-values",jd),Mm=Array.prototype,Tm=Mm.map,km=Mm.slice,Sm={name:"implicit"},Nm=function(t){return function(){return t}},Em=function(t){return+t},Am=[0,1],Cm=function(n,e,i){var o,u=n[0],a=n[n.length-1],c=r(u,a,null==e?10:e);switch(i=lr(null==i?",f":i),i.type){case"s":var s=Math.max(Math.abs(u),Math.abs(a));return null!=i.precision||isNaN(o=Lv(c,s))||(i.precision=o),t.formatPrefix(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Rv(c,Math.max(Math.abs(u),Math.abs(a))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=Pv(c))||(i.precision=o-2*("%"===i.type))}return t.format(i)},zm=function(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],u=t[i];return u0?t>1?Zu(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Rm:null};var qm=Rm.range,Um=6e4,Dm=6048e5,Om=Zu(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),Fm=Om.range,Im=Zu(function(t){t.setTime(Math.floor(t/Um)*Um)},function(t,n){t.setTime(+t+n*Um)},function(t,n){return(n-t)/Um},function(t){return t.getMinutes()}),Ym=Im.range,Bm=Zu(function(t){var n=t.getTimezoneOffset()*Um%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),jm=Bm.range,Hm=Zu(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Um)/864e5},function(t){return t.getDate()-1}),Xm=Hm.range,Vm=Gu(0),$m=Gu(1),Wm=Gu(2),Zm=Gu(3),Gm=Gu(4),Jm=Gu(5),Qm=Gu(6),Km=Vm.range,tx=$m.range,nx=Wm.range,ex=Zm.range,rx=Gm.range,ix=Jm.range,ox=Qm.range,ux=Zu(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),ax=ux.range,cx=Zu(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});cx.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zu(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var sx=cx.range,fx=Zu(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Um)},function(t,n){return(n-t)/Um},function(t){return t.getUTCMinutes()}),lx=fx.range,hx=Zu(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),px=hx.range,dx=Zu(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),vx=dx.range,_x=Ju(0),gx=Ju(1),yx=Ju(2),mx=Ju(3),xx=Ju(4),bx=Ju(5),wx=Ju(6),Mx=_x.range,Tx=gx.range,kx=yx.range,Sx=mx.range,Nx=xx.range,Ex=bx.range,Ax=wx.range,Cx=Zu(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),zx=Cx.range,Px=Zu(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Px.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zu(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Lx,Rx=Px.range,qx={"-":"",_:" ",0:"0"},Ux=/^\s*\d+/,Dx=/^%/,Ox=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Za({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Fx=Date.prototype.toISOString?Ga:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ"),Ix=+new Date("2000-01-01T00:00:00.000Z")?Ja:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),Yx=1e3,Bx=60*Yx,jx=60*Bx,Hx=24*jx,Xx=7*Hx,Vx=30*Hx,$x=365*Hx,Wx=function(){return tc(cx,ux,Vm,Hm,Bm,Im,Om,Rm,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},Zx=function(){return tc(Px,Cx,_x,dx,hx,fx,Om,Rm,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},Gx=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})},Jx=Gx("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Qx=Gx("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),Kx=Gx("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),tb=Gx("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),nb=Oh(Vt(300,.5,0),Vt(-240,.5,1)),eb=Oh(Vt(-100,.75,.35),Vt(80,1.5,.8)),rb=Oh(Vt(260,.75,.35),Vt(80,1.5,.8)),ib=Vt(),ob=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return ib.h=360*t-100,ib.s=1.5-1.5*n,ib.l=.8-.9*n,ib+""},ub=nc(Gx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ab=nc(Gx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),cb=nc(Gx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),sb=nc(Gx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),fb=function(t){return function(){return t}},lb=Math.abs,hb=Math.atan2,pb=Math.cos,db=Math.max,vb=Math.min,_b=Math.sin,gb=Math.sqrt,yb=1e-12,mb=Math.PI,xb=mb/2,bb=2*mb,wb=function(){function t(){var t,s,f=+n.apply(this,arguments),l=+e.apply(this,arguments),h=o.apply(this,arguments)-xb,p=u.apply(this,arguments)-xb,d=lb(p-h),v=p>h;if(c||(c=t=Re()),lyb)if(d>bb-yb)c.moveTo(l*pb(h),l*_b(h)),c.arc(0,0,l,h,p,!v),f>yb&&(c.moveTo(f*pb(p),f*_b(p)),c.arc(0,0,f,p,h,v));else{var _,g,y=h,m=p,x=h,b=p,w=d,M=d,T=a.apply(this,arguments)/2,k=T>yb&&(i?+i.apply(this,arguments):gb(f*f+l*l)),S=vb(lb(l-f)/2,+r.apply(this,arguments)),N=S,E=S;if(k>yb){var A=ic(k/f*_b(T)),C=ic(k/l*_b(T));(w-=2*A)>yb?(A*=v?1:-1,x+=A,b-=A):(w=0,x=b=(h+p)/2),(M-=2*C)>yb?(C*=v?1:-1,y+=C,m-=C):(M=0,y=m=(h+p)/2)}var z=l*pb(y),P=l*_b(y),L=f*pb(b),R=f*_b(b);if(S>yb){var q=l*pb(m),U=l*_b(m),D=f*pb(x),O=f*_b(x);if(dyb?fc(z,P,D,O,q,U,L,R):[L,R],I=z-F[0],Y=P-F[1],B=q-F[0],j=U-F[1],H=1/_b(rc((I*B+Y*j)/(gb(I*I+Y*Y)*gb(B*B+j*j)))/2),X=gb(F[0]*F[0]+F[1]*F[1]);N=vb(S,(f-X)/(H-1)),E=vb(S,(l-X)/(H+1))}}M>yb?E>yb?(_=lc(D,O,z,P,l,E,v),g=lc(q,U,L,R,l,E,v),c.moveTo(_.cx+_.x01,_.cy+_.y01),Eyb&&w>yb?N>yb?(_=lc(L,R,q,U,f,-N,v),g=lc(z,P,D,O,f,-N,v),c.lineTo(_.cx+_.x01,_.cy+_.y01),N=f;--l)s.point(_[l],g[l]);s.lineEnd(),s.areaEnd()}v&&(_[n]=+e(h,n,t),g[n]=+i(h,n,t),s.point(r?+r(h,n,t):_[n],o?+o(h,n,t):g[n]))}if(p)return s=null,p+""||null}function n(){return Tb().defined(u).curve(c).context(a)}var e=pc,r=null,i=fb(0),o=dc,u=fb(!0),a=null,c=Mb,s=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:fb(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:fb(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:fb(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:fb(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:fb(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:fb(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(u="function"==typeof n?n:fb(!!n),t):u},t.curve=function(n){return arguments.length?(c=n,null!=a&&(s=c(a)),t):c},t.context=function(n){return arguments.length?(null==n?a=s=null:s=c(a=n),t):a},t},Sb=function(t,n){return nt?1:n>=t?0:NaN},Nb=function(t){return t},Eb=function(){function t(t){var a,c,s,f,l,h=t.length,p=0,d=new Array(h),v=new Array(h),_=+i.apply(this,arguments),g=Math.min(bb,Math.max(-bb,o.apply(this,arguments)-_)),y=Math.min(Math.abs(g)/h,u.apply(this,arguments)),m=y*(g<0?-1:1);for(a=0;a0&&(p+=l);for(null!=e?d.sort(function(t,n){return e(v[t],v[n])}):null!=r&&d.sort(function(n,e){return r(t[n],t[e])}),a=0,s=p?(g-h*m)/p:0;a0?l*s:0)+m,v[c]={data:t[c],index:a,value:l,startAngle:_,endAngle:f,padAngle:y};return v}var n=Nb,e=Sb,r=null,i=fb(0),o=fb(bb),u=fb(0);return t.value=function(e){return arguments.length?(n="function"==typeof e?e:fb(+e),t):n},t.sortValues=function(n){return arguments.length?(e=n,r=null,t):e},t.sort=function(n){return arguments.length?(r=n,e=null,t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:fb(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:fb(+n),t):o},t.padAngle=function(n){return arguments.length?(u="function"==typeof n?n:fb(+n),t):u},t},Ab=_c(Mb);vc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Cb=function(){return gc(Tb().curve(Ab))},zb=function(){var t=kb().curve(Ab),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return gc(e())},delete t.lineX0,t.lineEndAngle=function(){return gc(r())},delete t.lineX1,t.lineInnerRadius=function(){return gc(i())},delete t.lineY0,t.lineOuterRadius=function(){return gc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(_c(t)):n()._curve},t},Pb={draw:function(t,n){var e=Math.sqrt(n/mb);t.moveTo(e,0),t.arc(0,0,e,0,bb)}},Lb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Rb=Math.sqrt(1/3),qb=2*Rb,Ub={draw:function(t,n){var e=Math.sqrt(n/qb),r=e*Rb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Db=Math.sin(mb/10)/Math.sin(7*mb/10),Ob=Math.sin(bb/10)*Db,Fb=-Math.cos(bb/10)*Db,Ib={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Ob*e,i=Fb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=bb*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},Yb={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Bb=Math.sqrt(3),jb={draw:function(t,n){var e=-Math.sqrt(n/(3*Bb));t.moveTo(0,2*e),t.lineTo(-Bb*e,-e),t.lineTo(Bb*e,-e),t.closePath()}},Hb=-.5,Xb=Math.sqrt(3)/2,Vb=1/Math.sqrt(12),$b=3*(Vb/2+1),Wb={draw:function(t,n){var e=Math.sqrt(n/$b),r=e/2,i=e*Vb,o=r,u=e*Vb+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(Hb*r-Xb*i,Xb*r+Hb*i),t.lineTo(Hb*o-Xb*u,Xb*o+Hb*u),t.lineTo(Hb*a-Xb*c,Xb*a+Hb*c),t.lineTo(Hb*r+Xb*i,Hb*i-Xb*r),t.lineTo(Hb*o+Xb*u,Hb*u-Xb*o),t.lineTo(Hb*a+Xb*c,Hb*c-Xb*a),t.closePath()}},Zb=[Pb,Lb,Ub,Yb,Ib,jb,Wb],Gb=function(){function t(){var t;if(r||(r=t=Re()),n.apply(this,arguments).draw(r,+e.apply(this,arguments)),t)return r=null,t+""||null}var n=fb(Pb),e=fb(64),r=null;return t.type=function(e){return arguments.length?(n="function"==typeof e?e:fb(e),t):n},t.size=function(n){return arguments.length?(e="function"==typeof n?n:fb(+n),t):e},t.context=function(n){return arguments.length?(r=null==n?null:n,t):r},t},Jb=function(){};mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:yc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:yc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Qb=function(t){return new mc(t)};xc.prototype={areaStart:Jb,areaEnd:Jb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:yc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Kb=function(t){return new xc(t)};bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:yc(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var tw=function(t){return new bc(t)};wc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var nw=function t(n){function e(t){return 1===n?new mc(t):new wc(t,n)}return e.beta=function(n){return t(+n)},e}(.85);Tc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Mc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Mc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ew=function t(n){function e(t){return new Tc(t,n)}return e.tension=function(n){return t(+n)},e}(0);kc.prototype={areaStart:Jb,areaEnd:Jb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Mc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var rw=function t(n){function e(t){return new kc(t,n)}return e.tension=function(n){return t(+n)},e}(0);Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var iw=function t(n){function e(t){return new Sc(t,n)}return e.tension=function(n){return t(+n)},e}(0);Ec.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0: -this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Nc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ow=function t(n){function e(t){return n?new Ec(t,n):new Tc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Ac.prototype={areaStart:Jb,areaEnd:Jb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Nc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var uw=function t(n){function e(t){return n?new Ac(t,n):new kc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Nc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var aw=function t(n){function e(t){return n?new Cc(t,n):new Sc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);zc.prototype={areaStart:Jb,areaEnd:Jb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var cw=function(t){return new zc(t)};Uc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qc(this,this._t0,Rc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,qc(this,Rc(this,e=Lc(this,t,n)),e);break;default:qc(this,this._t0,e=Lc(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(Dc.prototype=Object.create(Uc.prototype)).point=function(t,n){Uc.prototype.point.call(this,n,t)},Oc.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}},Yc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=Bc(t),i=Bc(n),o=0,u=1;u=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var fw=function(t){return new jc(t,.5)},lw=Array.prototype.slice,hw=function(t,n){if((r=t.length)>1)for(var e,r,i=1,o=t[n[0]],u=o.length;i=0;)e[n]=n;return e},dw=function(){function t(t){var o,u,a=n.apply(this,arguments),c=t.length,s=a.length,f=new Array(s);for(o=0;o0){for(var e,r,i,o=0,u=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u=a)return null;var c=t-i.site[0],s=n-i.site[1],f=c*c+s*s;do{i=o.cells[r=u],u=null,i.halfedges.forEach(function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],s=n-a[1],l=c*c+s*s;le?(e+r)/2:Math.min(0,e)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function o(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function u(t,n,e){t.on("start.zoom",function(){a(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){a(this,arguments).end()}).tween("zoom",function(){var t=this,r=arguments,i=a(t,r),u=m.apply(t,r),c=e||o(u),s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,r):n,h=N(f.invert(c).concat(s/f.k),l.invert(c).concat(s/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=s/n[2];t=new Ns(e,c[0]-n[0]*e,c[1]-n[1]*e)}i.zoom(null,t)}})}function a(t,n){for(var e,r=0,i=A.length;r0?bl(this).transition().duration(S).call(u,f,a):bl(this).call(n.transform,f)}}function h(){if(y.apply(this,arguments)){var n,e,r,i,o=a(this,arguments),u=t.event.changedTouches,c=u.length;for(As(),e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var fw=function(t){return new jc(t,.5)},lw=Array.prototype.slice,hw=function(t,n){if((r=t.length)>1)for(var e,r,i=1,o=t[n[0]],u=o.length;i=0;)e[n]=n;return e},dw=function(){function t(t){var o,u,a=n.apply(this,arguments),c=t.length,s=a.length,f=new Array(s);for(o=0;o0){for(var e,r,i,o=0,u=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u=a)return null;var c=t-i.site[0],s=n-i.site[1],f=c*c+s*s;do{i=o.cells[r=u],u=null,i.halfedges.forEach(function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],s=n-a[1],l=c*c+s*s;le?(e+r)/2:Math.min(0,e)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function o(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function u(t,n,e){t.on("start.zoom",function(){a(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){a(this,arguments).end()}).tween("zoom",function(){var t=this,r=arguments,i=a(t,r),u=m.apply(t,r),c=e||o(u),s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,r):n,h=N(f.invert(c).concat(s/f.k),l.invert(c).concat(s/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=s/n[2];t=new Ns(e,c[0]-n[0]*e,c[1]-n[1]*e)}i.zoom(null,t)}})}function a(t,n){for(var e,r=0,i=A.length;r0?bl(this).transition().duration(S).call(u,f,a):bl(this).call(n.transform,f)}}function h(){if(y.apply(this,arguments)){var n,e,r,i,o=a(this,arguments),u=t.event.changedTouches,c=u.length;for(As(),e=0;e" - + displayCount - + " " + researcherText + " " + $('div#researcherTotal').html("" + + displayCount + + " " + researcherText + " " + areaCount + "" + text); } function appendLegendToLeafletContainer() { if ( !this.legendIsVisible ) { var htmlString = "
  • " - + "" + i18nStrings.regionsString + "" - + i18nStrings.countriesString + "
  • " + i18nStrings.regionsString 
-                        + "" + + "" + i18nStrings.regionsString + "" + + i18nStrings.countriesString + "
  • " + i18nStrings.regionsString
+                        + "" + i18nStrings.regionsString + "
"; $('div.leaflet-control-container').append(htmlString); this.legendIsVisible = true; } } - -}); + +}); diff --git a/webapp/src/main/webapp/js/homePageUtils.js b/webapp/src/main/webapp/js/homePageUtils.js index ef6809a1..c2bdb68d 100644 --- a/webapp/src/main/webapp/js/homePageUtils.js +++ b/webapp/src/main/webapp/js/homePageUtils.js @@ -1,39 +1,39 @@ /* $This file is distributed under the terms of the license in LICENSE$ */ $(document).ready(function(){ - + $.extend(this, urlsBase); $.extend(this, facultyMemberCount); $.extend(this, i18nStrings); var retryCount = 0; - + // this will ensure that the hidden classgroup input is cleared if the back button is used // to return to th ehome page from the search results - $('input[name="classgroup"]').val(""); + $('input[name="classgroup"]').val(""); - getFacultyMembers(); - buildAcademicDepartments(); + getFacultyMembers(); + buildAcademicDepartments(); if ( $('section#home-geo-focus').length == 0 ) { $('section#home-stats').css("display","inline-block").css("margin-top","20px"); - } - + } + function getFacultyMembers() { var individualList = ""; - if ( facultyMemberCount > 0 ) { + if ( facultyMemberCount > 0 ) { // determine the row at which to start the search query var rowStart = Math.floor((Math.random()*facultyMemberCount)); var diff; var pageSize = 4; // the number of faculty to display on the home page - + // could have fewer than 4 in a test or dev environment if ( facultyMemberCount < pageSize ) { pageSize = facultyMemberCount; } - // in case the random number is equal to or within 3 of the facultyMemberCount + // in case the random number is equal to or within 3 of the facultyMemberCount // subtract 1 from the facultyMemberCount because the search rows begin at 0, not 1 if ( (rowStart + (pageSize-1)) > (facultyMemberCount-1) ) { diff = (rowStart + (pageSize-1)) - (facultyMemberCount-1); @@ -53,7 +53,7 @@ $(document).ready(function(){ url += "&page=" + rowStart + "&pageSize=" + pageSize; $.getJSON(url, function(results) { - + if ( results == null || results.individuals.length == 0 ) { if ( retryCount < 5 ) { retryCount = retryCount + 1; @@ -64,7 +64,7 @@ $(document).ready(function(){ $('div#tempSpacing').hide(); $('div#research-faculty-mbrs ul#facultyThumbs').append(individualList); } - } + } else { var vclassName = results.vclass.name; $.each(results.individuals, function(i, item) { @@ -73,13 +73,13 @@ $(document).ready(function(){ }); $('div#tempSpacing').hide(); $('div#research-faculty-mbrs ul#facultyThumbs').append(individualList); - + $.each($('div#research-faculty-mbrs ul#facultyThumbs li.individual'), function() { if ( $(this).children('img').length == 0 ) { var imgHtml = "" + i18nStrings.placeholderImage + ""; $(this).prepend(imgHtml); } - else { + else { $(this).children('img').on("load", function() { adjustImageHeight($(this)); }); @@ -87,7 +87,7 @@ $(document).ready(function(){ }); var viewMore = "
  • " + i18nStrings.viewAllString + ""; $('div#research-faculty-mbrs').append(viewMore); @@ -117,7 +117,7 @@ $(document).ready(function(){ var deptNbr = academicDepartments.length; var html = "
      "; var index = Math.floor((Math.random()*deptNbr)+1)-1; - + if ( deptNbr == 0 ) { html = "

      • " + i18nStrings.noDepartmentsFound + "
      "; @@ -134,8 +134,8 @@ $(document).ready(function(){ //Check to see if this index hasn't already been employed if(!indexFound) { //if this index hasn't already been employed then utilize it - html += "
    • " + html += "
    • " + academicDepartments[index].name + "
    • "; //add this index to the set of already used indices indicesUsed[index] = true; @@ -146,20 +146,20 @@ $(document).ready(function(){ } else { for ( var i=0;i" + html += "
    • " + academicDepartments[i].name + "
    • "; } } if ( deptNbr > 0 ) { html += "
    "; } $('div#academic-depts').html(html); } - -}); + +}); diff --git a/webapp/src/main/webapp/js/individual/individualProfilePageType.js b/webapp/src/main/webapp/js/individual/individualProfilePageType.js index 17a6d018..2758549e 100644 --- a/webapp/src/main/webapp/js/individual/individualProfilePageType.js +++ b/webapp/src/main/webapp/js/individual/individualProfilePageType.js @@ -3,14 +3,14 @@ var profilePageType = { /* *** Initial page setup *** */ - + onLoad: function() { - - this.mixIn(); + + this.mixIn(); // in the event that the individual does not have a profile type set, // the controller returns "none" and the select is set to "standard". // we need to distinguish these when it comes time to do a retraction or - // not. So "default" = the type defined by the triple; "selected" = + // not. So "default" = the type defined by the triple; "selected" = // the selected option. var selectedProfileType = ""; this.initPage(); @@ -25,14 +25,14 @@ var profilePageType = { // Initial page setup. Called only at page load. initPage: function() { - + profilePageType.selectedProfileType = $('select#profilePageType').val(); this.bindEventListeners(); - + }, - + bindEventListeners: function() { - + $('select#profilePageType').change( function() { profilePageType.processSelection($('select#profilePageType').val()) }); @@ -45,7 +45,7 @@ var profilePageType = { var retract = ""; var add = "<" + profilePageType.individualUri + "> " + " ."; - + if ( profilePageType.defaultProfileType != "none" ) { retract = "<" + profilePageType.individualUri + "> " + " ."; @@ -53,7 +53,7 @@ var profilePageType = { $.ajax({ url: profilePageType.processingUrl, - type: 'POST', + type: 'POST', data: { additions: add, retractions: retract @@ -61,7 +61,7 @@ var profilePageType = { dataType: 'json', context: newType, // context for callback complete: function(request, status) { - + if (status == 'success') { location.reload(true); } @@ -70,10 +70,10 @@ var profilePageType = { $('select#profilePageType').val(profilePageType.selectedProfileType); } } - }); + }); } }; -$(document).ready(function() { +$(document).ready(function() { profilePageType.onLoad(); -}); +}); diff --git a/webapp/src/main/webapp/js/individual/individualQtipBubble.js b/webapp/src/main/webapp/js/individual/individualQtipBubble.js index 974acafe..78d484ac 100644 --- a/webapp/src/main/webapp/js/individual/individualQtipBubble.js +++ b/webapp/src/main/webapp/js/individual/individualQtipBubble.js @@ -2,14 +2,14 @@ $(document).ready(function(){ // This function creates and styles the "qTip" tooltip that displays the bubble text when the user hovers - // over the research area "group" icon. - + // over the research area "group" icon. + $.extend(this, i18nStrings); $('head').append(''); $('#researchAreaIcon').each(function() - { + { $(this).qtip( { prerender: true, diff --git a/webapp/src/main/webapp/js/individual/individualUtils.js b/webapp/src/main/webapp/js/individual/individualUtils.js index 430cf057..85014189 100644 --- a/webapp/src/main/webapp/js/individual/individualUtils.js +++ b/webapp/src/main/webapp/js/individual/individualUtils.js @@ -14,16 +14,16 @@ $(document).ready(function(){ // "more"/"less" HTML truncator for showing more or less content in data property core:overview $('.overview-value').truncate({max_length: 500}); - + // Change background color button when verbose mode is off $('a#verbosePropertySwitch:contains("' + i18nStrings.verboseTurnOff + '")').addClass('verbose-off'); - + // Reveal vCard QR code when QR icon is clicked $('#qrIcon, .qrCloseLink').click(function() { - - + + // only create the img the first time, so check if it already exists - if ( !$('img#codeImage').length ) { + if ( !$('img#codeImage').length ) { $.ajax({ url: baseUrl + "/qrCodeAjax", dataType: "json", @@ -63,38 +63,38 @@ $(document).ready(function(){ vcard += "PHOTO;VALUE=URL;TYPE=JPG:" + individualPhoto + String.fromCharCode(13); } vcard += "END:VCARD"; - + spanStr = "" + "" + ""; - + $('#qrCodeImage').prepend(spanStr); $('#qrCodeImage').toggleClass('hidden'); } } } - }); - } - else { + }); + } + else { $('#qrCodeImage').toggleClass('hidden'); } }); // For pubs and grants on the foaf:person profile, and affiliated people - // on the foaf:organization profile -- if a pub/grant/person has been hidden + // on the foaf:organization profile -- if a pub/grant/person has been hidden // via the "manage" link, we need to ensure that the subclass heading gets removed // if there are no items to display for that subclass. $.each($('h3'), function() { if ( $(this).next().attr('class') == "subclass-property-list hideThis" ) { - if ( $(this).next().children().length == 0 ) { + if ( $(this).next().children().length == 0 ) { $(this).closest('li').remove(); } } }); - + // if there are no selected pubs, hide the manage link; same for grants // and affiliated people on the org profile page if ( $('ul#relatedBy-Authorship-List').children('li').length < 1 && $('h3#relatedBy-Authorship').attr('class') != "hiddenPubs" ) { @@ -112,12 +112,12 @@ $(document).ready(function(){ if ( $('ul#relatedBy-Position-List').children('li').length < 1 && $('h3#relatedBy-Position').attr('class') != "hiddenPeople" ) { $('a#managePeopleLink').hide(); } - + // if there are webpages but no contacts (email/phone), extend // the webpage border the full width. Used with "2 column" profile view. if ( $('h2#contactHeading').length < 1 ) { if ( $('div#webpagesContainer').length ) { $('div#webpagesContainer').css('width', '100%').css('clear','both'); } - } + } }); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap.js index 417aec3d..6276732f 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap.js @@ -155,7 +155,7 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu }; // IE9 throws an 'unknown error' if document.activeElement is used - // inside an iframe or frame. + // inside an iframe or frame. var activeEl; try { @@ -179,4 +179,4 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu return DataTable; -})); \ No newline at end of file +})); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap4.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap4.js index e49d95f3..992d7619 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap4.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.bootstrap4.js @@ -157,7 +157,7 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu }; // IE9 throws an 'unknown error' if document.activeElement is used - // inside an iframe or frame. + // inside an iframe or frame. var activeEl; try { @@ -181,4 +181,4 @@ DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, bu return DataTable; -})); \ No newline at end of file +})); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.material.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.material.js index 93d62aaa..559173b7 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.material.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.material.js @@ -164,7 +164,7 @@ DataTable.ext.renderer.pageButton.material = function ( settings, host, idx, but }; // IE9 throws an 'unknown error' if document.activeElement is used - // inside an iframe or frame. + // inside an iframe or frame. var activeEl; try { @@ -188,4 +188,4 @@ DataTable.ext.renderer.pageButton.material = function ( settings, host, idx, but return DataTable; -})); \ No newline at end of file +})); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.semanticui.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.semanticui.js index 97f797ec..ffb7074f 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.semanticui.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.semanticui.js @@ -166,7 +166,7 @@ DataTable.ext.renderer.pageButton.semanticUI = function ( settings, host, idx, b }; // IE9 throws an 'unknown error' if document.activeElement is used - // inside an iframe or frame. + // inside an iframe or frame. var activeEl; try { @@ -205,4 +205,4 @@ $(document).on( 'init.dt', function (e, ctx) { return DataTable; -})); \ No newline at end of file +})); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.uikit.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.uikit.js index 2e617613..e5749d4c 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.uikit.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/dataTables.uikit.js @@ -149,7 +149,7 @@ DataTable.ext.renderer.pageButton.uikit = function ( settings, host, idx, button }; // IE9 throws an 'unknown error' if document.activeElement is used - // inside an iframe or frame. + // inside an iframe or frame. var activeEl; try { @@ -173,4 +173,4 @@ DataTable.ext.renderer.pageButton.uikit = function ( settings, host, idx, button return DataTable; -})); \ No newline at end of file +})); diff --git a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/jquery.dataTables.js b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/jquery.dataTables.js index 5b032aee..c66b3d96 100644 --- a/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/jquery.dataTables.js +++ b/webapp/src/main/webapp/js/jquery_plugins/datatable/1.10.12/jquery.dataTables.js @@ -133,8 +133,8 @@ { return this.api(true).$( sSelector, oOpts ); }; - - + + /** * Almost identical to $ in operation, but in this case returns the data for the matched * rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes @@ -187,8 +187,8 @@ { return this.api(true).rows( sSelector, oOpts ).data(); }; - - + + /** * Create a DataTables Api instance, with the currently selected tables for * the Api's context. @@ -206,8 +206,8 @@ ) : new _Api( this ); }; - - + + /** * Add a single new row or multiple rows of data to the table. Please note * that this is suitable for client-side processing only - if you are using @@ -249,20 +249,20 @@ this.fnAddData = function( data, redraw ) { var api = this.api( true ); - + /* Check if we want to add multiple rows or not */ var rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ? api.rows.add( data ) : api.row.add( data ); - + if ( redraw === undefined || redraw ) { api.draw(); } - + return rows.flatten().toArray(); }; - - + + /** * This function will make DataTables recalculate the column sizes, based on the data * contained in the table and the sizes applied to the columns (in the DOM, CSS or @@ -289,7 +289,7 @@ var api = this.api( true ).columns.adjust(); var settings = api.settings()[0]; var scroll = settings.oScroll; - + if ( bRedraw === undefined || bRedraw ) { api.draw( false ); } @@ -298,8 +298,8 @@ _fnScrollDraw( settings ); } }; - - + + /** * Quickly and simply clear a table * @param {bool} [bRedraw=true] redraw the table or not @@ -317,13 +317,13 @@ this.fnClearTable = function( bRedraw ) { var api = this.api( true ).clear(); - + if ( bRedraw === undefined || bRedraw ) { api.draw(); } }; - - + + /** * The exact opposite of 'opening' a row, this function will close any rows which * are currently 'open'. @@ -352,8 +352,8 @@ { this.api( true ).row( nTr ).child.hide(); }; - - + + /** * Remove a row for the table * @param {mixed} target The index of the row from aoData to be deleted, or @@ -378,21 +378,21 @@ var rows = api.rows( target ); var settings = rows.settings()[0]; var data = settings.aoData[ rows[0][0] ]; - + rows.remove(); - + if ( callback ) { callback.call( this, settings, data ); } - + if ( redraw === undefined || redraw ) { api.draw(); } - + return data; }; - - + + /** * Restore the table to it's original state in the DOM by removing all of DataTables * enhancements, alterations to the DOM structure of the table and event listeners. @@ -411,8 +411,8 @@ { this.api( true ).destroy( remove ); }; - - + + /** * Redraw the table * @param {bool} [complete=true] Re-filter and resort (if enabled) the table before the draw. @@ -433,8 +433,8 @@ // into account the new data, but can hold position. this.api( true ).draw( complete ); }; - - + + /** * Filter the input based on data * @param {string} sInput String to filter the table on @@ -457,18 +457,18 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive ) { var api = this.api( true ); - + if ( iColumn === null || iColumn === undefined ) { api.search( sInput, bRegex, bSmart, bCaseInsensitive ); } else { api.column( iColumn ).search( sInput, bRegex, bSmart, bCaseInsensitive ); } - + api.draw(); }; - - + + /** * Get the data for the whole table, an individual row or an individual cell based on the * provided parameters. @@ -509,19 +509,19 @@ this.fnGetData = function( src, col ) { var api = this.api( true ); - + if ( src !== undefined ) { var type = src.nodeName ? src.nodeName.toLowerCase() : ''; - + return col !== undefined || type == 'td' || type == 'th' ? api.cell( src, col ).data() : api.row( src ).data() || null; } - + return api.data().toArray(); }; - - + + /** * Get an array of the TR nodes that are used in the table's body. Note that you will * typically want to use the '$' API method in preference to this as it is more @@ -543,13 +543,13 @@ this.fnGetNodes = function( iRow ) { var api = this.api( true ); - + return iRow !== undefined ? api.row( iRow ).node() : api.rows().nodes().flatten().toArray(); }; - - + + /** * Get the array indexes of a particular cell from it's DOM element * and column index including hidden columns @@ -582,13 +582,13 @@ { var api = this.api( true ); var nodeName = node.nodeName.toUpperCase(); - + if ( nodeName == 'TR' ) { return api.row( node ).index(); } else if ( nodeName == 'TD' || nodeName == 'TH' ) { var cell = api.cell( node ).index(); - + return [ cell.row, cell.columnVisible, @@ -597,8 +597,8 @@ } return null; }; - - + + /** * Check to see if a row is 'open' or not. * @param {node} nTr the table row to check @@ -626,8 +626,8 @@ { return this.api( true ).row( nTr ).child.isShown(); }; - - + + /** * This function will place a new row directly after a row which is currently * on display on the page, with the HTML contents that is passed into the @@ -666,8 +666,8 @@ .show() .child()[0]; }; - - + + /** * Change the pagination - provides the internal logic for pagination in a simple API * function. With this function you can have a DataTables table go to the next, @@ -687,13 +687,13 @@ this.fnPageChange = function ( mAction, bRedraw ) { var api = this.api( true ).page( mAction ); - + if ( bRedraw === undefined || bRedraw ) { api.draw(false); } }; - - + + /** * Show a particular column * @param {int} iCol The column whose display should be changed @@ -713,13 +713,13 @@ this.fnSetColumnVis = function ( iCol, bShow, bRedraw ) { var api = this.api( true ).column( iCol ).visible( bShow ); - + if ( bRedraw === undefined || bRedraw ) { api.columns.adjust().draw(); } }; - - + + /** * Get the settings for a particular table for external manipulation * @returns {object} DataTables settings object. See @@ -740,8 +740,8 @@ { return _fnSettingsFromNode( this[_ext.iApiIndex] ); }; - - + + /** * Sort the table by a particular column * @param {int} iCol the data index to sort on. Note that this will not match the @@ -761,8 +761,8 @@ { this.api( true ).order( aaSort ).draw(); }; - - + + /** * Attach a sort listener to an element for a given column * @param {node} nNode the element to attach the sort listener to @@ -783,8 +783,8 @@ { this.api( true ).order.listener( nNode, iColumn, fnCallback ); }; - - + + /** * Update a table cell or row - this method will accept either a single value to * update the cell with, an array of values with one element for each column or @@ -810,25 +810,25 @@ this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction ) { var api = this.api( true ); - + if ( iColumn === undefined || iColumn === null ) { api.row( mRow ).data( mData ); } else { api.cell( mRow, iColumn ).data( mData ); } - + if ( bAction === undefined || bAction ) { api.columns.adjust(); } - + if ( bRedraw === undefined || bRedraw ) { api.draw(); } return 0; }; - - + + /** * Provide a common method for plug-ins to check the version of DataTables being used, in order * to ensure compatibility. @@ -847,7 +847,7 @@ * } ); */ this.fnVersionCheck = _ext.fnVersionCheck; - + var _that = this; var emptyInit = options === undefined; @@ -880,40 +880,40 @@ var bInitHandedOff = false; var defaults = DataTable.defaults; var $this = $(this); - - + + /* Sanity check */ if ( this.nodeName.toLowerCase() != 'table' ) { _fnLog( null, 0, 'Non-table node initialisation ('+this.nodeName+')', 2 ); return; } - + /* Backwards compatibility for the defaults */ _fnCompatOpts( defaults ); _fnCompatCols( defaults.column ); - + /* Convert the camel-case defaults to Hungarian */ _fnCamelToHungarian( defaults, defaults, true ); _fnCamelToHungarian( defaults.column, defaults.column, true ); - + /* Setting up the initialisation object */ _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ) ); - - - + + + /* Check to see if we are re-initialising a table */ var allSettings = DataTable.settings; for ( i=0, iLen=allSettings.length ; i').appendTo(this); } oSettings.nTHead = thead[0]; - + var tbody = $this.children('tbody'); if ( tbody.length === 0 ) { tbody = $('').appendTo(this); } oSettings.nTBody = tbody[0]; - + var tfoot = $this.children('tfoot'); if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") ) { @@ -1299,7 +1299,7 @@ // a tfoot element for the caption element to be appended to tfoot = $('').appendTo(this); } - + if ( tfoot.length === 0 || tfoot.children().length === 0 ) { $this.addClass( oClasses.sNoFooter ); } @@ -1307,7 +1307,7 @@ oSettings.nTFoot = tfoot[0]; _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot ); } - + /* Check if there is data passing into the constructor */ if ( oInit.aaData ) { @@ -1324,13 +1324,13 @@ */ _fnAddTr( oSettings, $(oSettings.nTBody).children('tr') ); } - + /* Copy the data index array */ oSettings.aiDisplay = oSettings.aiDisplayMaster.slice(); - + /* Initialisation complete - table can be drawn */ oSettings.bInitialised = true; - + /* Check if we need to initialise the table (it might not have been handed off to the * language processor) */ @@ -1343,7 +1343,7 @@ return this; }; - + /* * It is useful to have variables which are scoped locally so only the * DataTables functions can access them and they don't leak into global space. @@ -1352,28 +1352,28 @@ * by DataTables as private variables here. This also ensures that there is no * clashing of variable names and that they can easily referenced for reuse. */ - - + + // Defined else where // _selector_run // _selector_opts // _selector_first // _selector_row_indexes - + var _ext; // DataTable.ext var _Api; // DataTable.Api var _api_register; // DataTable.Api.register var _api_registerPlural; // DataTable.Api.registerPlural - + var _re_dic = {}; var _re_new_lines = /[\r\n]/g; var _re_html = /<.*?>/g; var _re_date_start = /^[\w\+\-]/; var _re_date_end = /[\w\+\-]$/; - + // Escape regular expression special characters var _re_escape_regex = new RegExp( '(\\' + [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ].join('|\\') + ')', 'g' ); - + // http://en.wikipedia.org/wiki/Foreign_exchange_market // - \u20BD - Russian ruble. // - \u20a9 - South Korean Won @@ -1385,18 +1385,18 @@ // - \u2009 is thin space and \u202F is narrow no-break space, both used in many // standards as thousands separators. var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi; - - + + var _empty = function ( d ) { return !d || d === true || d === '-' ? true : false; }; - - + + var _intVal = function ( s ) { var integer = parseInt( s, 10 ); return !isNaN(integer) && isFinite(s) ? integer : null; }; - + // Convert from a formatted number with characters other than `.` as the // decimal place, to a Javascript number var _numToDecimal = function ( num, decimalPoint ) { @@ -1408,41 +1408,41 @@ num.replace( /\./g, '' ).replace( _re_dic[ decimalPoint ], '.' ) : num; }; - - + + var _isNumber = function ( d, decimalPoint, formatted ) { var strType = typeof d === 'string'; - + // If empty return immediately so there must be a number if it is a // formatted string (this stops the string "k", or "kr", etc being detected // as a formatted number for currency if ( _empty( d ) ) { return true; } - + if ( decimalPoint && strType ) { d = _numToDecimal( d, decimalPoint ); } - + if ( formatted && strType ) { d = d.replace( _re_formatted_numeric, '' ); } - + return !isNaN( parseFloat(d) ) && isFinite( d ); }; - - + + // A string without HTML in it can be considered to be HTML still var _isHtml = function ( d ) { return _empty( d ) || typeof d === 'string'; }; - - + + var _htmlNumeric = function ( d, decimalPoint, formatted ) { if ( _empty( d ) ) { return true; } - + var html = _isHtml( d ); return ! html ? null : @@ -1450,12 +1450,12 @@ true : null; }; - - + + var _pluck = function ( a, prop, prop2 ) { var out = []; var i=0, ien=a.length; - + // Could have the test in the loop for slightly smaller code, but speed // is essential here if ( prop2 !== undefined ) { @@ -1472,18 +1472,18 @@ } } } - + return out; }; - - + + // Basically the same as _pluck, but rather than looping over `a` we use `order` // as the indexes to pick from `a` var _pluck_order = function ( a, order, prop, prop2 ) { var out = []; var i=0, ien=order.length; - + // Could have the test in the loop for slightly smaller code, but speed // is essential here if ( prop2 !== undefined ) { @@ -1498,16 +1498,16 @@ out.push( a[ order[i] ][ prop ] ); } } - + return out; }; - - + + var _range = function ( len, start ) { var out = []; var end; - + if ( start === undefined ) { start = 0; end = len; @@ -1516,34 +1516,34 @@ end = start; start = len; } - + for ( var i=start ; i') .css( { @@ -1874,10 +1874,10 @@ ) ) .appendTo( 'body' ); - + var outer = n.children(); var inner = outer.children(); - + // Numbers below, in order, are: // inner.offsetWidth, inner.clientWidth, outer.offsetWidth, outer.clientWidth // @@ -1887,30 +1887,30 @@ // Evergreen Windows: 83 83 100 83 // Evergreen Mac with scrollbars: 85 85 100 85 // Evergreen Mac without scrollbars: 100 100 100 100 - + // Get scrollbar width browser.barWidth = outer[0].offsetWidth - outer[0].clientWidth; - + // IE6/7 will oversize a width 100% element inside a scrolling element, to // include the width of the scrollbar, while other browsers ensure the inner // element is contained without forcing scrolling browser.bScrollOversize = inner[0].offsetWidth === 100 && outer[0].clientWidth !== 100; - + // In rtl text layout, some browsers (most, but not all) will place the // scrollbar on the left, rather than the right. browser.bScrollbarLeft = Math.round( inner.offset().left ) !== 1; - + // IE8- don't provide height and width for getBoundingClientRect browser.bBounding = n[0].getBoundingClientRect().width ? true : false; - + n.remove(); } - + $.extend( settings.oBrowser, DataTable.__browser ); settings.oScroll.iBarWidth = DataTable.__browser.barWidth; } - - + + /** * Array.prototype reduce[Right] method, used for browsers which don't support * JS 1.6. Done this way to reduce code size, since we iterate either way @@ -1923,28 +1923,28 @@ i = start, value, isSet = false; - + if ( init !== undefined ) { value = init; isSet = true; } - + while ( i !== end ) { if ( ! that.hasOwnProperty(i) ) { continue; } - + value = isSet ? fn( value, that[i], i, that ) : that[i]; - + isSet = true; i += inc; } - + return value; } - + /** * Add a column to the list used for the table with default values * @param {object} oSettings dataTables settings object @@ -1964,18 +1964,18 @@ idx: iCol } ); oSettings.aoColumns.push( oCol ); - + // Add search object for column specific search. Note that the `searchCols[ iCol ]` // passed into extend can be undefined. This allows the user to give a default // with only some of the parameters defined, and also not give a default var searchCols = oSettings.aoPreSearchCols; searchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch, searchCols[ iCol ] ); - + // Use the default column options function to initialise classes etc _fnColumnOptions( oSettings, iCol, $(nTh).data() ); } - - + + /** * Apply options for a column * @param {object} oSettings dataTables settings object @@ -1988,50 +1988,50 @@ var oCol = oSettings.aoColumns[ iCol ]; var oClasses = oSettings.oClasses; var th = $(oCol.nTh); - + // Try to get width information from the DOM. We can't get it from CSS // as we'd need to parse the CSS stylesheet. `width` option can override if ( ! oCol.sWidthOrig ) { // Width attribute oCol.sWidthOrig = th.attr('width') || null; - + // Style attribute var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%]+)/); if ( t ) { oCol.sWidthOrig = t[1]; } } - + /* User specified column options */ if ( oOptions !== undefined && oOptions !== null ) { // Backwards compatibility _fnCompatCols( oOptions ); - + // Map camel case parameters to their Hungarian counterparts _fnCamelToHungarian( DataTable.defaults.column, oOptions ); - + /* Backwards compatibility for mDataProp */ if ( oOptions.mDataProp !== undefined && !oOptions.mData ) { oOptions.mData = oOptions.mDataProp; } - + if ( oOptions.sType ) { oCol._sManualType = oOptions.sType; } - + // `class` is a reserved word in Javascript, so we need to provide // the ability to use a valid name for the camel case input if ( oOptions.className && ! oOptions.sClass ) { oOptions.sClass = oOptions.className; } - + $.extend( oCol, oOptions ); _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); - + /* iDataSort to be applied (backwards compatibility), but aDataSort will take * priority if defined */ @@ -2041,12 +2041,12 @@ } _fnMap( oCol, oOptions, "aDataSort" ); } - + /* Cache the data get and set functions for speed */ var mDataSrc = oCol.mData; var mData = _fnGetObjectDataFn( mDataSrc ); var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null; - + var attrTest = function( src ) { return typeof src === 'string' && src.indexOf('@') !== -1; }; @@ -2054,10 +2054,10 @@ attrTest(mDataSrc.sort) || attrTest(mDataSrc.type) || attrTest(mDataSrc.filter) ); oCol._setter = null; - + oCol.fnGetData = function (rowData, type, meta) { var innerData = mData( rowData, type, undefined, meta ); - + return mRender && type ? mRender( innerData, type, rowData, meta ) : innerData; @@ -2065,20 +2065,20 @@ oCol.fnSetData = function ( rowData, val, meta ) { return _fnSetObjectDataFn( mDataSrc )( rowData, val, meta ); }; - + // Indicate if DataTables should read DOM data as an object or array // Used in _fnGetRowElements if ( typeof mDataSrc !== 'number' ) { oSettings._rowReadObject = true; } - + /* Feature sorting overrides column specific when off */ if ( !oSettings.oFeatures.bSort ) { oCol.bSortable = false; th.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called } - + /* Check that the class assignment is correct for sorting */ var bAsc = $.inArray('asc', oCol.asSorting) !== -1; var bDesc = $.inArray('desc', oCol.asSorting) !== -1; @@ -2103,8 +2103,8 @@ oCol.sSortingClassJUI = oClasses.sSortJUI; } } - - + + /** * Adjust the table column widths for new data. Note: you would probably want to * do a redraw after calling this function! @@ -2117,24 +2117,24 @@ if ( settings.oFeatures.bAutoWidth !== false ) { var columns = settings.aoColumns; - + _fnCalculateColumnWidths( settings ); for ( var i=0 , iLen=columns.length ; i