Difference between revisions of "Scholia Parameter Handling"
Jump to navigation
Jump to search
(→result) |
|||
Line 39: | Line 39: | ||
|- | |- | ||
| align="right"| 1 || keyword | | align="right"| 1 || keyword | ||
+ | |} | ||
+ | == scholia_jinja_for_loops == | ||
+ | |||
+ | === query === | ||
+ | <source lang='sql'> | ||
+ | SELECT | ||
+ | count(*), | ||
+ | substr( | ||
+ | sparql, | ||
+ | instr(sparql, '{% for') + length('{% for'), -- Start position right after "{% for" | ||
+ | instr(substr(sparql, instr(sparql, '{% for')), '%}') - length('{% for') -- Length of substring | ||
+ | ) as for_loop_content | ||
+ | FROM | ||
+ | NamedQuery | ||
+ | WHERE | ||
+ | sparql LIKE '%{% for%' ESCAPE '\' and for_loop_content like "%in%" | ||
+ | group by for_loop_content | ||
+ | order by 1 desc | ||
+ | |||
+ | </source> | ||
+ | |||
+ | |||
+ | === result === | ||
+ | {| class="wikitable" style="text-align: left;" | ||
+ | |+ <!-- caption --> | ||
+ | |- | ||
+ | ! align="right"| count(*) !! for_loop_content | ||
+ | |- | ||
+ | | align="right"| 28 || q in qs % | ||
+ | |- | ||
+ | | align="right"| 1 || q1 in qs % | ||
+ | |- | ||
+ | | align="right"| 1 || doi in dois % | ||
+ | |- | ||
+ | | align="right"| 1 || day in range(-32, 1) % | ||
|} | |} |
Revision as of 09:51, 9 July 2024
params_stats
query
SELECT count(*),
params
FROM "QueryDetails"
GROUP BY params
ORDER BY 1 desc
result
count(*) | params |
---|---|
682 | |
293 | q |
14 | q1,q2 |
9 | q,q |
3 | q,q,q |
3 | p |
1 | q,q2 |
1 | q,q,q,q,q |
1 | q,doi,q,doi,q,doi,q,doi,q,doi |
1 | lexeme |
1 | keyword |
scholia_jinja_for_loops
query
SELECT
count(*),
substr(
sparql,
instr(sparql, '{% for') + length('{% for'), -- Start position right after "{% for"
instr(substr(sparql, instr(sparql, '{% for')), '%}') - length('{% for') -- Length of substring
) as for_loop_content
FROM
NamedQuery
WHERE
sparql LIKE '%{% for%' ESCAPE '\' and for_loop_content like "%in%"
group by for_loop_content
order by 1 desc
result
count(*) | for_loop_content |
---|---|
28 | q in qs % |
1 | q1 in qs % |
1 | doi in dois % |
1 | day in range(-32, 1) % |