From 6ce1e4be338141c44923fce697486618b1e0c529 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 21 May 2014 13:03:39 -0400 Subject: [PATCH 01/10] new list view for grants and contracts awarded by organizations --- ...listViewConfig-organizationAwardsGrant.xml | 48 +++++++++++++++++++ .../propStatement-organizationAwardsGrant.ftl | 22 +++++++++ rdf/display/everytime/PropertyConfig.n3 | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 productMods/config/listViewConfig-organizationAwardsGrant.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl diff --git a/productMods/config/listViewConfig-organizationAwardsGrant.xml b/productMods/config/listViewConfig-organizationAwardsGrant.xml new file mode 100644 index 00000000..24d98362 --- /dev/null +++ b/productMods/config/listViewConfig-organizationAwardsGrant.xml @@ -0,0 +1,48 @@ + + + + + + + + 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#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + SELECT DISTINCT ?grantOrContract + ?label + + WHERE { + ?subject ?property ?grantOrContract . + OPTIONAL { ?grantOrContract rdfs:label ?label . + } + } ORDER BY ?label + + + + 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#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + CONSTRUCT { + ?subject ?property ?grantOrContract . + ?grantOrContract rdfs:label ?label . + } WHERE { + { + ?subject ?property ?grantOrContract . + } UNION { + ?subject ?property ?grantOrContract . + ?grantOrContract a core:Grant . + ?grantOrContract rdfs:label ?label . + } UNION { + ?subject ?property ?grantOrContract . + ?grantOrContract a core:Contract . + ?grantOrContract rdfs:label ?label . + } + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl new file mode 100644 index 00000000..ea43f9a9 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationAwardsGrant.ftl @@ -0,0 +1,22 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> +<@showAwardsGrant statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showAwardsGrant statement> + + <#local linkedIndividual> + <#if statement.grantOrContract??> + ${statement.label!""} + + + + ${linkedIndividual!} + + diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 1b0cc716..8c3295e9 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -1635,7 +1635,7 @@ local:orgAwardsGrantContext a :ConfigContext ; :qualifiedBy . local:orgAwardsGrantConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-organizationAwardsGrant.xml"^^xsd:string ; :displayName "awards grant" ; vitro:displayRankAnnot 60; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; From 24a4c2c56d71e85b410b6f3fdd09aa6fe4c0d288 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 21 May 2014 15:39:22 -0400 Subject: [PATCH 02/10] add class group check to list view --- productMods/config/listViewConfig-default.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/productMods/config/listViewConfig-default.xml b/productMods/config/listViewConfig-default.xml index be2ea6ba..6cf10968 100644 --- a/productMods/config/listViewConfig-default.xml +++ b/productMods/config/listViewConfig-default.xml @@ -33,6 +33,9 @@ ?object a foaf:Person . ?object vitro:mostSpecificType ?typeUri . ?typeUri rdfs:label ?type . + # Display only a mostSpecificType that belongs to a classgroup. + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup } OPTIONAL { ?object obo:ARG_2000028 ?vcard . @@ -82,6 +85,8 @@ CONSTRUCT { ?subject ?property ?object . ?object vitro:mostSpecificType ?typeUri . + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup . ?typeUri rdfs:label ?type . ?object obo:ARG_2000028 ?vcard . ?vcard vcard:hasTitle ?titleObj . @@ -93,6 +98,8 @@ ?subject ?property ?object . ?object vitro:mostSpecificType ?typeUri . ?typeUri rdfs:label ?type . + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup } UNION { ?subject ?property ?object . ?object obo:ARG_2000028 ?vcard . From 5168e188f808883d367057e363b30ae61bcdc23e Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 21 May 2014 16:26:41 -0400 Subject: [PATCH 03/10] VIVO-749: fixed double quotes problem on webpage form --- .../templates/freemarker/edit/forms/addEditWebpageForm.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl index bf818392..b4655a15 100644 --- a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl +++ b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl @@ -67,7 +67,7 @@ - + <#if editMode="add"> From 269b38b5d7f77abd8e7df1ad65d4a87ed5ba68ef Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 10:01:03 -0400 Subject: [PATCH 04/10] VIVO-763: any subclass of vcard:URL will now display in the picklist when creating or editing a webpage --- .../templates/freemarker/edit/forms/addEditWebpageForm.ftl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl index b4655a15..5912cb61 100644 --- a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl +++ b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl @@ -57,8 +57,10 @@ @@ -67,7 +69,7 @@ - + ${label} <#if editMode="add"> From eb802e2c6a0dcf2aa965cfc23d4bb54210b49342 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 10:48:09 -0400 Subject: [PATCH 05/10] needed to filter out most specific types where the type is not in a class group --- productMods/config/listViewConfig-fauxPropertyDefault.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/productMods/config/listViewConfig-fauxPropertyDefault.xml b/productMods/config/listViewConfig-fauxPropertyDefault.xml index 5d54b0e0..560f0a65 100644 --- a/productMods/config/listViewConfig-fauxPropertyDefault.xml +++ b/productMods/config/listViewConfig-fauxPropertyDefault.xml @@ -34,6 +34,9 @@ ?object a foaf:Person . ?object vitro:mostSpecificType ?typeUri . ?typeUri rdfs:label ?type . + # Display only a mostSpecificType that belongs to a classgroup. + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup } OPTIONAL { ?object obo:ARG_2000028 ?vcard . @@ -83,6 +86,8 @@ CONSTRUCT { ?subject ?property ?object . ?object vitro:mostSpecificType ?typeUri . + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup . ?typeUri rdfs:label ?type . ?object obo:ARG_2000028 ?vcard . ?vcard vcard:hasTitle ?titleObj . @@ -94,6 +99,8 @@ ?subject ?property ?object . ?object vitro:mostSpecificType ?typeUri . ?typeUri rdfs:label ?type . + ?typeUri vitro:inClassGroup ?classGroup . + ?classGroup a vitro:ClassGroup } UNION { ?subject ?property ?object . ?object obo:ARG_2000028 ?vcard . From 3dba210af22e23ad948c37e22520591cc5f8b0c3 Mon Sep 17 00:00:00 2001 From: j2blake Date: Thu, 22 May 2014 13:08:04 -0400 Subject: [PATCH 06/10] VIVO-773 clean up some of the queries used in building the search index The new JENA libraries won't allow a clause of the form (str(?result) as ?result), since the variable "result" is already bound. --- .../VivoISFAdvisingFields.java | 4 +-- .../documentBuilding/VivoISFBasicFields.java | 4 +-- .../VivoISFEducationFields.java | 8 ++--- .../documentBuilding/VivoISFGrantFields.java | 32 +++++++++---------- .../documentBuilding/VivoISFMemberFields.java | 8 ++--- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java index ac08fa1a..c2f26778 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java @@ -42,12 +42,12 @@ public class VivoISFAdvisingFields extends ContextNodeFields { private static String makeQueryForPeople(){ return prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri core:relatedBy ?rel . \n" + " ?rel rdf:type core:AdvisingRelationship . \n" + " ?rel core:relates ?other . \n" + - " ?other rdfs:label ?result . \n" + + " ?other rdfs:label ?rawresult . \n" + " FILTER( ?other != ?uri ) \n" + "}"; } diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java index 3675f67f..23856b5a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java @@ -60,12 +60,12 @@ public class VivoISFBasicFields extends ContextNodeFields { queries.add( prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri core:relatedBy ?rel . \n" + " ?rel rdf:type ?type . \n" + " ?rel core:relates ?other . \n" + - " ?other rdfs:label ?result . \n" + + " ?other rdfs:label ?rawresult . \n" + " FILTER ( ?type IN ( " + types + " ) )\n" + "}" ); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java index 6a9aa443..8ba9cc3e 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java @@ -28,11 +28,11 @@ public class VivoISFEducationFields extends ContextNodeFields { private static String queryForDegree = prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri core:relates ?deg . \n" + " ?deg rdf:type core:AwardedDegree . \n" + - " ?deg rdfs:label ?result . \n" + + " ?deg rdfs:label ?rawresult . \n" + "}"; /** @@ -41,12 +41,12 @@ public class VivoISFEducationFields extends ContextNodeFields { private static String queryForOrganization = prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri core:relates ?deg . \n" + " ?deg rdf:type core:AwardedDegree . \n" + " ?deg core:assignedBy ?org . \n" + - " ?org rdfs:label ?result . \n" + + " ?org rdfs:label ?rawresult . \n" + "}"; static List queries = new ArrayList(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java index 1ffb164f..c36fde17 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java @@ -40,11 +40,11 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String peopleForGrant = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type core:Grant . \n" + " ?uri core:relates ?person . \n" + " ?person rdf:type foaf:Person . \n" + - " ?person rdfs:label ?result . \n" + + " ?person rdfs:label ?rawresult . \n" + "}"; /** @@ -54,12 +54,12 @@ public class VivoISFGrantFields extends ContextNodeFields { private static String grantsForPerson = prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri rdf:type foaf:Person . \n" + " ?grant core:relates ?uri . \n" + " ?grant rdf:type core:Grant . \n" + - " ?grant rdfs:label ?result . \n" + + " ?grant rdfs:label ?rawresult . \n" + "}"; /** @@ -68,11 +68,11 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String grantsForOrganization = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type foaf:Organization . \n" + " ?grant core:relates ?uri . \n" + " ?grant rdf:type core:Grant . \n" + - " ?grant rdfs:label ?result . \n" + + " ?grant rdfs:label ?rawresult . \n" + "}"; /** @@ -81,11 +81,11 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String organizationsForGrant = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type core:Grant . \n" + " ?uri core:relates ?org . \n" + " ?org rdf:type foaf:Organization . \n" + - " ?org rdfs:label ?result . \n" + + " ?org rdfs:label ?rawresult . \n" + "}"; /** @@ -94,12 +94,12 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String grantsForProject = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type core:Project . \n" + " ?role obo:BFO_0000054 ?uri . \n" + " ?grant core:relates ?role . \n" + " ?grant rdf:type core:Grant . \n" + - " ?grant rdfs:label ?result . \n" + + " ?grant rdfs:label ?rawresult . \n" + "}"; /** @@ -108,12 +108,12 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String peopleForProject = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type core:Project . \n" + " ?role obo:BFO_0000054 ?uri . \n" + " ?role obo:RO_0000053 ?person . \n" + " ?person rdf:type foaf:Person . \n" + - " ?person rdfs:label ?result . \n" + + " ?person rdfs:label ?rawresult . \n" + "}"; /** @@ -123,13 +123,13 @@ public class VivoISFGrantFields extends ContextNodeFields { private static String projectsForGrant = prefix + "SELECT \n" + - "(str(?result) as ?result) WHERE \n" + + "(str(?rawresult) as ?result) WHERE \n" + "{\n" + " ?uri rdf:type core:Grant. \n" + " ?uri core:relates ?role . \n" + " ?role obo:BFO_0000054 ?project . \n" + " ?project rdf:type core:Project . \n" + - " ?project rdfs:label ?result . \n" + + " ?project rdfs:label ?rawresult . \n" + "}"; /** @@ -138,12 +138,12 @@ public class VivoISFGrantFields extends ContextNodeFields { */ private static String projectsForPerson = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type foaf:Person . \n" + " ?uri obo:RO_0000053 ?role . \n" + " ?role obo:BFO_0000054 ?project . \n" + " ?project rdf:type core:Project . \n" + - " ?project rdfs:label ?result . \n" + + " ?project rdfs:label ?rawresult . \n" + "}"; static List queries = new ArrayList(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java index 6ea535d1..9ae1c566 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java @@ -35,11 +35,11 @@ public class VivoISFMemberFields extends ContextNodeFields { */ private static String peopleForOrganization = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type foaf:Organization . \n" + " ?role core:roleContrigutesTo ?uri . \n" + " ?person obo:RO_0000053 ?role . \n" + - " ?person rdfs:label ?result .\n" + + " ?person rdfs:label ?rawresult .\n" + "}"; /** @@ -47,9 +47,9 @@ public class VivoISFMemberFields extends ContextNodeFields { */ private static String organizationForPeople = prefix + - "SELECT (str(?result) as ?result) WHERE {\n" + + "SELECT (str(?rawresult) as ?result) WHERE {\n" + " ?uri rdf:type foaf:Person . \n" + - " ?uri obo:RO_0000053 / core:roleContrigutesTo / rdfs:label ?result . \n" + + " ?uri obo:RO_0000053 / core:roleContrigutesTo / rdfs:label ?rawresult . \n" + "}"; From 4d85cf2cf59eaaa580b4ee23a0aff4bd30a4e242 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 12:15:04 -0400 Subject: [PATCH 07/10] added contract faux properties --- rdf/display/everytime/PropertyConfig.n3 | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 8c3295e9..ba067d46 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -624,6 +624,21 @@ local:grantAdministeredByConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantAdministeredByGenerator"^^ ; :propertyGroup . +local:contractAdministeredByContext a :ConfigContext ; + :hasConfiguration local:contractAdministeredByConfig ; + :configContextFor vivo:relates ; + :qualifiedByDomain vivo:Contract ; + :qualifiedBy vivo:AdministratorRole . + +local:contractAdministeredByConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-grantAdministeredBy.xml"^^xsd:string ; + :displayName "administered by" ; + vitro:displayRankAnnot 16; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantAdministeredByGenerator"^^ ; + :propertyGroup . + local:orgAdministersGrantContext a :ConfigContext ; :hasConfiguration local:orgAdministersGrantConfig ; :configContextFor ; @@ -1496,6 +1511,21 @@ local:grantAwardedByConfig a :ObjectPropertyDisplayConfig ; vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ; :propertyGroup . +local:contractAwardedByContext a :ConfigContext ; + :hasConfiguration local:contractAwardedByConfig ; + :configContextFor vivo:assignedBy ; + :qualifiedByDomain vivo:Contract ; + :qualifiedBy . + +local:contractAwardedByConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :displayName "awarded by" ; + vitro:displayRankAnnot 14; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ; + :propertyGroup . + local:grantSubjectAreaContext a :ConfigContext ; :hasConfiguration local:grantSubjectAreaConfig ; :configContextFor vivo:hasSubjectArea ; @@ -1689,6 +1719,20 @@ local:grantRelatesConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody ; :propertyGroup . +local:contractRelatesContext a :ConfigContext ; + :hasConfiguration local:contractRelatesConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:contractRelatesConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ; + :displayName "contributor" ; + vitro:displayRankAnnot 55; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody ; + :propertyGroup . + ### faux properties for dateTimeValue ### local:publicationDateContext a :ConfigContext ; From 032b12d414dc97f0062d6a513118d8954e5fbba3 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 12:46:41 -0400 Subject: [PATCH 08/10] added educational process faux properties --- rdf/display/everytime/PropertyConfig.n3 | 46 ++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index ba067d46..016e33fd 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -500,6 +500,51 @@ local:educationalTrainingConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining"^^ ; :propertyGroup . +local:educationalProcessPersonContext a :ConfigContext ; + :hasConfiguration local:educationalProcessPersonConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:educationalProcessPersonConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :displayName "education and training of" ; + vitro:displayRankAnnot 10; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; + :propertyGroup . + +local:educationalProcessOrgContext a :ConfigContext ; + :hasConfiguration local:educationalProcessOrgConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:educationalProcessOrgConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :displayName "educational organization" ; + vitro:displayRankAnnot 15; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; + :propertyGroup . + +local:educationalProcessDegreeContext a :ConfigContext ; + :hasConfiguration local:educationalProcessDegreeConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:educationalProcessDegreeConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :displayName "degree earned" ; + vitro:displayRankAnnot 20; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; + :propertyGroup . + local:organizationForTrainingContext a :ConfigContext ; :hasConfiguration local:organizationForTrainingConfig ; :configContextFor ; @@ -636,7 +681,6 @@ local:contractAdministeredByConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 16; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; - vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantAdministeredByGenerator"^^ ; :propertyGroup . local:orgAdministersGrantContext a :ConfigContext ; From 8cfaaa25c7fde8d8ed9bb200b75192da9a267b19 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 13:25:28 -0400 Subject: [PATCH 09/10] new list view to display degrees on educational process objects --- .../themes/wilma/i18n/all_es_GO.properties | 1 + .../config/listViewConfig-degreeEarned.xml | 60 +++++++++++++++++++ .../individual/propStatement-degreeEarned.ftl | 38 ++++++++++++ rdf/display/everytime/PropertyConfig.n3 | 2 +- themes/wilma/i18n/all.properties | 1 + 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 productMods/config/listViewConfig-degreeEarned.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl diff --git a/languages/es_GO/themes/wilma/i18n/all_es_GO.properties b/languages/es_GO/themes/wilma/i18n/all_es_GO.properties index 15e845cc..bcc8f557 100644 --- a/languages/es_GO/themes/wilma/i18n/all_es_GO.properties +++ b/languages/es_GO/themes/wilma/i18n/all_es_GO.properties @@ -484,6 +484,7 @@ org_type_capitalized = Tipo de Organización educational_training_type = Tipo de Formación Educativa dept_or_school_name = Departamento o Nombre de la escuela en el degree = Grado +missing_degree = falta de grado major_field = Importante sobre el terreno de Grado supplemental_information = Información Complementaria supplemental_information_hint = (Por ejemplo, título de la tesis, la información de transferencia, etc) diff --git a/productMods/config/listViewConfig-degreeEarned.xml b/productMods/config/listViewConfig-degreeEarned.xml new file mode 100644 index 00000000..7abddc27 --- /dev/null +++ b/productMods/config/listViewConfig-degreeEarned.xml @@ -0,0 +1,60 @@ + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?degree + ?degreeName + ?degreeAbbr + WHERE { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess + OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } + OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName . + ?degree core:abbreviation ?degreeAbbr + } WHERE { + { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess . + ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } UNION { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess . + ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl new file mode 100644 index 00000000..b3d90908 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl @@ -0,0 +1,38 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Custom object property statement view for faux property "education and training". See the PropertyConfig.3 file for details. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> + +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> +<#-- Coming from propDelete, individual is not defined, but we are editing. --> +<@showEducationalTraining statement=statement editable=(!individual?? || individual.editable) /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showEducationalTraining statement editable> + + <#local degree> + <#if statement.degreeName??> + ${statement.degreeAbbr!statement.degreeName} + <#if statement.majorField??> ${i18n().in} ${statement.majorField} + <#elseif statement.typeName??> + ${statement.typeName!} + + + + <#local linkedIndividual> + <#if statement.degree??> + ${statement.degreeAbbr!statement.degreeName} + <#else> + <#-- Show the link to the context node only if the user is editing the page. --> + ${i18n().missing_degree} + + + + ${linkedIndividual} + + diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 016e33fd..79f702e5 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -537,7 +537,7 @@ local:educationalProcessDegreeContext a :ConfigContext ; :qualifiedBy . local:educationalProcessDegreeConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-degreeEarned.xml"^^xsd:string ; :displayName "degree earned" ; vitro:displayRankAnnot 20; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 8143af61..d1c4bd51 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -490,6 +490,7 @@ 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.) From d33e48114f3bd121757fb02851ccfc010444d833 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 13:52:51 -0400 Subject: [PATCH 10/10] list view update --- .../config/listViewConfig-degreeEarned.xml | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/productMods/config/listViewConfig-degreeEarned.xml b/productMods/config/listViewConfig-degreeEarned.xml index 7abddc27..ad80eef3 100644 --- a/productMods/config/listViewConfig-degreeEarned.xml +++ b/productMods/config/listViewConfig-degreeEarned.xml @@ -10,23 +10,17 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - SELECT DISTINCT ?degree + SELECT DISTINCT ?awardedDegree + ?degree ?degreeName ?degreeAbbr WHERE { - ?subject ?property ?edProcess . - ?edProcess a core:EducationalProcess - OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . - ?awardedDegree core:relates ?degree . - ?degree a core:AcademicDegree . - ?degree rdfs:label ?degreeName - } - OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . - ?awardedDegree core:relates ?degree . - ?degree a core:AcademicDegree . - ?degree core:abbreviation ?degreeAbbr - } - } + ?subject ?property ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree rdfs:label ?degreeName + + OPTIONAL { ?degree core:abbreviation ?degreeAbbr } + } @@ -34,21 +28,20 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { - ?degree a core:AcademicDegree . + ?subject ?property ?awardedDegree . + ?awardedDegree core:relates ?degree . ?degree rdfs:label ?degreeName . ?degree core:abbreviation ?degreeAbbr } WHERE { { - ?subject ?property ?edProcess . - ?edProcess a core:EducationalProcess . - ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?subject ?property ?awardedDegree . + ?awardedDegree a core:AwardedDegree . ?awardedDegree core:relates ?degree . ?degree a core:AcademicDegree . ?degree rdfs:label ?degreeName } UNION { - ?subject ?property ?edProcess . - ?edProcess a core:EducationalProcess . - ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?subject ?property ?awardedDegree . + ?awardedDegree a core:AwardedDegree . ?awardedDegree core:relates ?degree . ?degree a core:AcademicDegree . ?degree core:abbreviation ?degreeAbbr