Last modified by Artur K. on 2026/06/01 15:50

From version 1.5
edited by Artur K.
on 2026/05/25 16:42
Change comment: There is no comment for this version
To version 3.4
edited by Artur K.
on 2026/05/27 16:46
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -17,7 +17,10 @@
17 17   and doc.fullName like :fullNamePrefix
18 18  order by doc.fullName")
19 19  
20 -#set($elementRows = $services.query.hql($hqlElements).bindValue('rootDocFullName', $rootDocFullName).bindValue('fullNamePrefix', $fullNamePrefix).execute())
20 +#set($elementQuery = $services.query.hql($hqlElements))
21 +#set($discard = $elementQuery.bindValue('rootDocFullName', $rootDocFullName))
22 +#set($discard = $elementQuery.bindValue('fullNamePrefix', $fullNamePrefix))
23 +#set($elementRows = $elementQuery.execute())
21 21  
22 22  ## ---------------------------
23 23  ## 2. Получаем термины глоссария
... ... @@ -55,10 +55,10 @@
55 55  #end
56 56  
57 57  ## ----------------------------
58 -## 4. Ищем совпадения
61 +## 4. Ищем совпадения и записываем rdfs.seeAlso
59 59  ## ----------------------------
60 60  #set($matches = [])
61 -#set($totalCount = $elementRows.size())
64 +#set($updatedCount = 0)
62 62  
63 63  #foreach($row in $elementRows)
64 64   #set($elementFullName = $row[0])
... ... @@ -70,6 +70,17 @@
70 70   #if($glossaryMap.containsKey($normalizedElementTitle))
71 71   #set($glossaryData = $glossaryMap.get($normalizedElementTitle))
72 72  
76 + #set($rdoc = $xwiki.getDocument($elementFullName))
77 + #set($elementObj = $rdoc.getObject('SKMS.Ontology.Code.OntologyElementClass'))
78 +
79 + #set($seeAlsoValue = [])
80 + #set($discard = $seeAlsoValue.add($glossaryData.fullName))
81 +
82 + #set($discard = $elementObj.set('rdfs.seeAlso', $seeAlsoValue))
83 + #set($discard = $rdoc.save())
84 +
85 + #set($updatedCount = $updatedCount + 1)
86 +
73 73   #set($matchRow = {
74 74   "elementFullName" : $elementFullName,
75 75   "elementTitle" : $elementTitle,
... ... @@ -83,23 +83,19 @@
83 83  #end
84 84  
85 85  ## ---------------------------
86 -## 5. Выводим таблицу совпадений
100 +## 5. Выводим результат
87 87  ## ----------------------------
88 88  {{html clean="false" wiki="true"}}
103 +<p><strong>Updated:</strong> $updatedCount</p>
104 +
89 89  <table class="wikitable" border="1">
90 90   <thead>
91 91   <tr>
92 92   <th>Ontology elements</th>
93 - <th>Glossary terms</th>
109 + <th>Written to rdfs.seeAlso</th>
94 94   </tr>
95 95   </thead>
96 96   <tbody>
97 - <tr>
98 - <th colspan="2" style="text-align: center;">
99 - Matches ($matches.size() of $totalCount)
100 - </th>
101 - </tr>
102 -
103 103   #if($matches.size() > 0)
104 104   #foreach($match in $matches)
105 105   <tr>
© Semantic R&D Group, 2026