From 2db6e37522ae28b8be5db5402ddb7f88b160e4db Mon Sep 17 00:00:00 2001 From: rjy7 Date: Wed, 5 Jan 2011 21:45:57 +0000 Subject: [PATCH] NIHVIVO-1334 Fixes to queries to prevent incorrect solutions --- .../listViewConfig-authorInAuthorship.xml | 17 +++++++++-------- .../listViewConfig-educationalTraining.xml | 17 +++++++++-------- ...ewConfig-informationResourceInAuthorship.xml | 2 +- .../listViewConfig-organizationForPosition.xml | 16 +++++++++------- .../config/listViewConfig-personInPosition.xml | 16 +++++++++------- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 77c19f5d..94bd87cf 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -14,14 +14,15 @@ GRAPH ?g1 { ?subject ?property ?authorship } OPTIONAL { GRAPH ?g2 { ?authorship core:linkedInformationResource ?infoResource } GRAPH ?g3 { ?infoResource rdfs:label ?infoResourceName } - } - OPTIONAL { GRAPH ?g4 { ?subclass rdfs:subClassOf core:InformationResource } - GRAPH ?g5 { ?infoResource a ?subclass } - FILTER (?g5 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && - ?g5 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) - } - OPTIONAL { GRAPH ?g6 { ?infoResource core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime . } } + OPTIONAL { GRAPH ?g4 { ?subclass rdfs:subClassOf core:InformationResource } + GRAPH ?g5 { ?infoResource a ?subclass } + FILTER (?g5 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && + ?g5 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) + } + OPTIONAL { GRAPH ?g6 { ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime . } + } + } } ORDER BY ?subclass DESC(?dateTime) ?infoResourceName diff --git a/productMods/config/listViewConfig-educationalTraining.xml b/productMods/config/listViewConfig-educationalTraining.xml index 748e7cf2..8b77cf55 100644 --- a/productMods/config/listViewConfig-educationalTraining.xml +++ b/productMods/config/listViewConfig-educationalTraining.xml @@ -12,20 +12,21 @@ SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime WHERE { - GRAPH ?g1 { ?subject ?property ?edTraining } OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org . - ?org rdfs:label ?orgName . } } - OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } } - OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } } - OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } } + ?org rdfs:label ?orgName . } + } + OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } + OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } } + OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } } + } OPTIONAL { GRAPH ?g6 { ?edTraining core:majorField ?majorField } } OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } } OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } } OPTIONAL { GRAPH ?g9 { ?edTraining core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime } } - - } ORDER BY DESC(?dateTime) + ?dateTimeValue core:dateTime ?dateTime } + } + } ORDER BY DESC(?dateTime) diff --git a/productMods/config/listViewConfig-informationResourceInAuthorship.xml b/productMods/config/listViewConfig-informationResourceInAuthorship.xml index 3cf4370d..2e7b2e2b 100644 --- a/productMods/config/listViewConfig-informationResourceInAuthorship.xml +++ b/productMods/config/listViewConfig-informationResourceInAuthorship.xml @@ -15,7 +15,7 @@ OPTIONAL { GRAPH ?g2 { ?authorship core:authorRank ?rank } } OPTIONAL { GRAPH ?g3 { ?authorship core:linkedAuthor ?person } GRAPH ?g4 { ?person rdfs:label ?personName } - } + } } ORDER BY ?rank ?personName diff --git a/productMods/config/listViewConfig-organizationForPosition.xml b/productMods/config/listViewConfig-organizationForPosition.xml index 7fa34459..e039600b 100644 --- a/productMods/config/listViewConfig-organizationForPosition.xml +++ b/productMods/config/listViewConfig-organizationForPosition.xml @@ -14,14 +14,16 @@ GRAPH ?g1 { ?subject ?property ?position } OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person } GRAPH ?g3 { ?person rdfs:label ?personName } - } + } OPTIONAL { GRAPH ?g4 { ?position rdfs:label ?positionTitle } } - OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } } - OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } } + OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval } + OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } + } + OPTIONAL { GRAPH ?g7 { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } + } + } } ORDER BY DESC(?dateTimeStart) DESC(?dateTimeEnd) ?personName diff --git a/productMods/config/listViewConfig-personInPosition.xml b/productMods/config/listViewConfig-personInPosition.xml index b2a8be08..2c04e62d 100644 --- a/productMods/config/listViewConfig-personInPosition.xml +++ b/productMods/config/listViewConfig-personInPosition.xml @@ -14,14 +14,16 @@ GRAPH ?g1 { ?subject ?property ?position } OPTIONAL { GRAPH ?g2 { ?position core:positionInOrganization ?org } GRAPH ?g3 { ?org rdfs:label ?orgName } - } + } OPTIONAL { GRAPH ?g4 { ?position rdfs:label ?positionTitle } } - OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } } - OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } } + OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval } + OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } + } + OPTIONAL { GRAPH ?g7 { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } + } + } } ORDER BY DESC(?dateTimeStart) DESC(?dateTimeEnd) ?orgName