PoolParty Default Reports
PoolParty Default Reports
The PoolParty Thesaurus Manager offers four default reports:
Full Details Report
Generates a list of all concepts in alphabetical order along with their metadata and relations to other concepts. For multilingual thesauri you can choose the language for the report.The named query in the PoolParty configuration (SesameSetup.xml
) for the report looks like the following:
<namedQueries> ... <entry> <key>FullDetails</key> <value> <sparqlQueryParameterMap> <entry> <key>Language</key> <value>en</value> </entry> </sparqlQueryParameterMap> <sparqlQueryTemplate> PREFIX skos:<http://www.w3.org/2004/02/skos/core#> PREFIX dcterms:<http://purl.org/dc/terms/> SELECT ?concept ?label ?date ?updated ?changeNote ?type ?altTerm ?broaderTerm ?narrowerTerm ?relatedTerm WHERE { { ?concept a ?type. ?concept skos:prefLabel ?label. FILTER (lang(?label) = "%%%Language%%%") OPTIONAL { ?concept dcterms:date ?date. } OPTIONAL { ?concept dcterms:modified ?updated. } OPTIONAL { ?concept skos:altLabel ?altTerm. FILTER (lang(?altTerm) = "%%%Language%%%") } OPTIONAL { ?concept skos:hiddenLabel ?altTerm. FILTER (lang(?altTerm) = "%%%Language%%%") } OPTIONAL { ?concept skos:changeNote ?changeNote. } } UNION { ?concept skos:prefLabel ?label. FILTER (lang(?label) = "%%%Language%%%") ?concept skos:broader ?b. ?b skos:prefLabel ?broaderTerm. FILTER (lang(?broaderTerm) = "%%%Language%%%") } UNION { ?concept skos:prefLabel ?label. FILTER (lang(?label) = "%%%Language%%%") ?concept skos:narrower ?n. ?n skos:prefLabel ?narrowerTerm. FILTER (lang(?narrowerTerm) = "%%%Language%%%") } UNION { ?concept skos:prefLabel ?label. FILTER (lang(?label) = "%%%Language%%%") ?concept skos:related ?r. ?r skos:prefLabel ?relatedTerm. FILTER (lang(?relatedTerm) = "%%%Language%%%") } } ORDER BY ?label ?concept ?relatedTerm ?narrowerTerm ?broaderTerm ?altTerm </sparqlQueryTemplate> </value> </entry> ... </namedQueries>
The velocity template for the report looks like the following:
FULL CONCEPT DETAILS REPORT --------------------------- #set($total = 0) ## Iterate through the results #foreach($r in $result) #if (!$r.get("concept").equals($currConcept)) ####### Term ####### #set($total = $total + 1) $r.get("label").getLabel() Term ID $r.get("concept") #set($currConcept = $r.get("concept")) #set($changeNote = false) #set($status = false) #set($date = false) #set($updated = false) #set($altTerms = false) #set($altTerm = '') #set($broaderTerms = false) #set($broaderTerm = '') #set($narrowerTerms = false) #set($narrowerTerm = '') #set($relatedTerms = false) #set($relatedTerm = '') #end ####### Change Note ####### #if (!$changeNote && $r.get("changeNote")) Change Note $r.get("changeNote").getLabel() #set($changeNote = true) #end ####### Input Date ####### #if (!$date && $r.get("date")) Input Date $r.get("date").calendarValue().getDay()/$r.get("date").calendarValue().getMonth()/$r.get("date").calendarValue().getYear() #set($date = true) #end ####### Last Updated ####### #if (!$updated && $r.get("updated")) Last Updated $r.get("updated").calendarValue().getDay()/$r.get("updated").calendarValue().getMonth()/$r.get("updated").calendarValue().getYear() #set($updated = true) #end ####### Status ####### #if (!$status && $r.get("type")) Status #if ($r.get("type").stringValue().equals("http://www.w3.org/2004/02/skos/core#Concept")) Approved #else Free #end #set($status = true) #end ####### Alternative Terms ####### #if (!$altTerms && $r.get("altTerm")) Alternative Term #set($altTerms = true) #end #if($r.get("altTerm") && !$altTerm.equals($r.get("altTerm").getLabel())) $r.get("altTerm").getLabel() #set($altTerm = $r.get("altTerm").getLabel()) #end ####### Broader Term ####### #if (!$broaderTerms && $r.get("broaderTerm")) Broader Term #set($broaderTerms = true) #end #if($r.get("broaderTerm") && !$broaderTerm.equals($r.get("broaderTerm").getLabel())) $r.get("broaderTerm").getLabel() #set($broaderTerm = $r.get("broaderTerm").getLabel()) #end ####### Narrower Term ####### #if (!$narrowerTerms && $r.get("narrowerTerm")) Narrower Term #set($narrowerTerms = true) #end #if($r.get("narrowerTerm") && !$narrowerTerm.equals($r.get("narrowerTerm").getLabel())) $r.get("narrowerTerm").getLabel() #set($narrowerTerm = $r.get("narrowerTerm").getLabel()) #end ####### Related Term ####### #if (!$relatedTerms && $r.get("relatedTerm")) Related Term #set($relatedTerms = true) #end #if($r.get("relatedTerm") && !$relatedTerm.equals($r.get("relatedTerm").getLabel())) $r.get("relatedTerm").getLabel() #set($relatedTerm = $r.get("relatedTerm").getLabel()) #end #end --------------------------------------- $total concepts
The report entry in the PoolParty configuration (SesameSetup.xml
) for the report looks like the following:
<reports> ... <entry> <key>Full Details Report</key> <value> <contentType>text/plain</contentType> <namedQuery>FullDetails</namedQuery> <template>fulldetails.vm</template> </value> </entry> ... </reports>
Google Custom Synonyms Report
The report creates a synonym list which can be used to extend Google's Customized Search Engine (CSE) . The named query in the PoolParty configuration (SesameSetup.xml) for the report looks like the following:
<namedQueries> ... <entry> <key>GoogleSynonyms</key> <value> <sparqlQueryParameterMap/> <sparqlQueryTemplate> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?term ?synonym WHERE { ?x a ?Concept. ?x skos:prefLabel ?term. OPTIONAL { ?x skos:altLabel ?synonym } OPTIONAL { ?x skos:hiddenLabel ?synonym } FILTER (bound(?synonym) && lang(?term) = lang(?synonym)) } </sparqlQueryTemplate> </value> </entry> ... </namedQueries>
The velocity template for the report looks like the following:
<?xml version="1.0" encoding="UTF-8"?> <Synonyms> #set ($lastTerm = '') #set ($numVariants = 0) #set ($firstTerm = true) #foreach ($row in $result) #if ($lastTerm != $row.get('term').getLabel()) #if ($firstTerm) #set ($firstTerm = false) #else </Synonym> #end <Synonym term="$row.get('term').getLabel().replaceAll('&','&')"> #set ($numVariants = 0) #end #if ($numVariants < 10) <Variant>$row.get('synonym').getLabel().replaceAll('&','&')</Variant> #set($lastTerm = $row.get('term').getLabel()) #set($numVariants = $numVariants + 1) #end #end </Synonym> </Synonyms>
The report entry in the PoolParty configuration (SesameSetup.xml) for the report looks like the following:
<reports> ... <entry> <key>Google Custom Synonyms</key> <value> <contentType>application/xml</contentType> <namedQuery>GoogleSynonyms</namedQuery> <template>synonyms.vm</template> </value> </entry> ... </reports>
Oracle Text Thesaurus (ISO-2788)
This report creates a thesaurus to improve the query application in Oracle text. The named query in the PoolParty configuration (SesameSetup.xml
) for the report looks like the following:
<namedQueries> ... <entry> <key>OracleReport</key> <value> <sparqlQueryParameterMap> <entry> <key>language</key> <value>en</value> </entry> </sparqlQueryParameterMap> <sparqlQueryTemplate> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX skos:<http://www.w3.org/2004/02/skos/core#> SELECT ?cLabel (GROUP_CONCAT(DISTINCT ?aLabel ; separator=" | ") AS ?aLabels) (GROUP_CONCAT(DISTINCT ?nLabel ; separator=" | ") AS ?nLabels) (GROUP_CONCAT(DISTINCT ?bLabel ; separator=" | ") AS ?bLabels) (GROUP_CONCAT(DISTINCT ?rLabel ; separator=" | ") AS ?rLabels) (GROUP_CONCAT(DISTINCT ?def ; separator=" | ") AS ?definition) WHERE { ?c a skos:Concept . ?c skos:prefLabel ?cLabel FILTER(lang(?cLabel)="%%%language%%%") OPTIONAL { ?c skos:altLabel ?aLabel FILTER(lang(?aLabel)="%%%language%%%"). } OPTIONAL { ?c skos:narrower/skos:prefLabel ?nLabel FILTER(lang(?nLabel)="%%%language%%%"). } OPTIONAL { ?c skos:broader/skos:prefLabel ?bLabel FILTER(lang(?bLabel)="%%%language%%%"). } OPTIONAL { ?c skos:related/skos:prefLabel ?rLabel FILTER(lang(?rLabel)="%%%language%%%"). } OPTIONAL { ?c skos:definition ?def FILTER(lang(?def)="%%%language%%%"). } } GROUP BY ?cLabel </sparqlQueryTemplate> </value> </entry> ... </namedQueries>
The velocity template for the report looks like the following:
Key,Synonym,Language #foreach($row in $result) $row.get("pref").stringValue(),$row.get("alt").stringValue(),$parameters.get('Lang').get(0) #end
The report entry in the PoolParty configuration (SesameSetup.xml) for the report looks like the following:
<reports> ... <entry> <key>Oracle Text Report</key> <value> <contentType>text/plain;charset=UTF-8</contentType> <namedQuery>OracleReport</namedQuery> <suffix>.txt</suffix> <template>oracle.vm</template> </value> </entry> ... </reports>
Thesaurus Hierarchy Report
Generates an overview of the thesauri in a project and their hierarchies displaying up to four levels. For multilingual thesauri you can choose the language for the report. The named query in the PoolParty configuration (SesameSetup.xml
) for the report looks like the following:
<namedQueries> ... <entry> <key>Hierarchy</key> <value> <sparqlQueryParameterMap> <entry> <key>Language</key> <value>en</value> </entry> </sparqlQueryParameterMap> <sparqlQueryTemplate> PREFIX skos:<http://www.w3.org/2004/02/skos/core#> PREFIX dcterms:<http://purl.org/dc/terms/> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?scheme ?schemeLabel ?n1 ?n2 ?n3 ?n4 ?n5 WHERE { { ?scheme a skos:ConceptScheme. ?scheme skos:hasTopConcept ?c1. ?c1 skos:prefLabel ?n1. FILTER (lang(?n1) = "%%%Language%%%") ?scheme dcterms:title ?schemeLabel. FILTER (lang(?schemeLabel)="%%%Language%%%") } OPTIONAL { ?c1 skos:narrower ?c2. ?c2 skos:prefLabel ?n2. FILTER (lang(?n2) = "%%%Language%%%") OPTIONAL { ?c2 skos:narrower ?c3. ?c3 skos:prefLabel ?n3. FILTER (lang(?n3) = "%%%Language%%%") OPTIONAL { ?c3 skos:narrower ?c4. ?c4 skos:prefLabel ?n4. FILTER (lang(?n4) = "%%%Language%%%") OPTIONAL { ?c4 skos:narrower ?c5. ?c5 skos:prefLabel ?n5. FILTER (lang(?n5) = "%%%Language%%%") } } } } } ORDER BY ?schemeLabel ?n1 ?n2 ?n3 ?n4 ?n5 </sparqlQueryTemplate> </value> </entry> ... </namedQueries>
The velocity template for the report looks like the following:
THESAURUS HIERARCHY REPORT -------------------------- #set($total = 0) #foreach($r in $result) #if (!$currScheme.equals($r.get("scheme"))) #set($total = $total + 1) #set($currScheme = $r.get("scheme")) $r.get("schemeLabel").getLabel() #set($n1 = '') #set($n2 = '') #set($n3 = '') #set($n4 = '') #set($n5 = '') #end #if($r.get("n1") && !$n1.equals($r.get("n1").getLabel())) #set($n1 = $r.get("n1").getLabel()) TOP: $n1 #end #if($r.get("n2") && !$n2.equals($r.get("n2").getLabel())) #set($n2 = $r.get("n2").getLabel()) NT1: $n2 #end #if($r.get("n3") && !$n3.equals($r.get("n3").getLabel())) #set($n3 = $r.get("n3").getLabel()) NT2: $n3 #end #if($r.get("n4") && !$n4.equals($r.get("n4").getLabel())) #set($n4 = $r.get("n4").getLabel()) NT3: $n4 #end #if($r.get("n5") && !$n5.equals($r.get("n5").getLabel())) #set($n5 = $r.get("n5").getLabel()) NT4: $n5 #end #end --------------------------------------- $total Thesauri
The report entry in the PoolParty configuration (SesameSetup.xml
) for the report looks like the following:
<reports> ... <entry> <key>Thesaurus Hierarchy Report</key> <value> <contentType>text/plain</contentType> <namedQuery>Hierarchy</namedQuery> <template>hierarchy.vm</template> </value> </entry> ... </reports>