NIHVIVO-3303 - showing the defining source for a concept

This commit is contained in:
stellamit 2011-11-10 17:19:32 +00:00
parent bb4b5af2b3
commit 337249e90c
2 changed files with 43 additions and 4 deletions

View file

@ -10,14 +10,25 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT ?concept ?conceptLabel ?conceptName SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName
WHERE { WHERE {
?subject ?property ?concept . ?subject ?property ?concept .
LET (?conceptName := afn:localname(?concept)) LET (?conceptName := afn:localname(?concept))
optional {?concept rdfs:label ?conceptLabel} optional {?concept rdfs:label ?conceptLabel}
optional {?concept rdfs:isDefinedBy ?vocabularySource
optional { ?vocabularySource rdfs:label ?vocabularySourceName}}
} ORDER BY ?conceptLabel ?conceptName } ORDER BY ?conceptLabel ?conceptName
</query-select> </query-select>
<query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subject ?property ?concept .
} WHERE {
?subject ?property ?concept .
}
</query-construct>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT { CONSTRUCT {
@ -25,8 +36,33 @@
?concept rdfs:label ?conceptLabel ?concept rdfs:label ?conceptLabel
} WHERE { } WHERE {
?subject ?property ?concept . ?subject ?property ?concept .
optional {?concept rdfs:label ?conceptLabel} ?concept rdfs:label ?conceptLabel
} }
</query-construct> </query-construct>
<query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subject ?property ?concept .
?concept rdfs:isDefinedBy ?vocabularySource
} WHERE {
?subject ?property ?concept .
?concept rdfs:isDefinedBy ?vocabularySource
}
</query-construct>
<query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subject ?property ?concept .
?concept rdfs:isDefinedBy ?vocabularySource .
?vocabularySource rdfs:label ?vocabularySourceName
} WHERE {
?subject ?property ?concept .
?concept rdfs:isDefinedBy ?vocabularySource .
?vocabularySource rdfs:label ?vocabularySourceName
}
</query-construct>
<template>propStatement-hasAssociatedConcept.ftl</template> <template>propStatement-hasAssociatedConcept.ftl</template>
</list-view-config> </list-view-config>

View file

@ -6,11 +6,14 @@
is also used to generate the property statement during a deletion. is also used to generate the property statement during a deletion.
--> -->
<@showConcept statement /> <@showConcept statement />
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement --> next statement -->
<#macro showConcept statement> <#macro showConcept statement>
<a href="${statement.concept}">${statement.conceptLabel!statement.conceptName}</a> <#if statement.vocabularySourceName??>
<a href="${statement.concept}">${statement.conceptLabel!statement.conceptName}</a> (<a href="${statement.vocabularySource}">${statement.vocabularySourceName}</a>)
<#else>
<a href="${statement.concept}">${statement.conceptLabel!statement.conceptName}</a>
</#if>
</#macro> </#macro>