{"id":9216,"date":"2012-11-08T01:16:33","date_gmt":"2012-11-07T19:46:33","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=9216"},"modified":"2016-12-19T14:51:23","modified_gmt":"2016-12-19T09:21:23","slug":"create-game-leaderboard-using-sqlprojection","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/","title":{"rendered":"Create game Leaderboard using sqlProjection"},"content":{"rendered":"<p>Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for players and expected result:<br \/>\n<\/p>\n<p>There is a rank() function in Postgres which solved my problem. Here is the sample query :<br \/>\n[sql]<br \/>\nselect rank() over(order by score desc) as rnk, name, score from player<br \/>\n[\/sql]<\/p>\n<p>The good news is that Grails 2.2 supports <code>sqlProjection<\/code> where you can use <code>native sql projections<\/code> like this :<br \/>\n[groovy]<br \/>\nPlayer.createCriteria().list{<br \/>\n  projections {<br \/>\n      sqlProjection (&#8216;rank() over(order by score desc) as rnk&#8217;,<br \/>\n                     [&#8216;rnk&#8217;], [org.hibernate.Hibernate.INTEGER])<br \/>\n       property(&#8216;name&#8217;)<br \/>\n       property(&#8216;score&#8217;)<br \/>\n    }<br \/>\n  }<br \/>\n.each {  println &amp;amp;quot;${it[0]} \\t ${it[1]} \\t ${it[2]}&amp;amp;quot;}<br \/>\n[\/groovy]<\/p>\n<p>If you are using older version of Grails then you can go with following alternatives:<\/p>\n<ul>\n<li><strong>Using sessionFactory bean and createSQLQuery<\/strong><\/li>\n<p>[groovy]<br \/>\nString query=&amp;amp;quot;select rank() over(order by score desc) as rnk, name, score from player&amp;amp;quot;<br \/>\n\/\/inject sessionFactory bean object (def sessionFactory)<br \/>\nsessionFactory.currentSession.createSQLQuery(query).list()<br \/>\n.each {  println &amp;amp;quot;${it[0]} \\t ${it[1]} \\t ${it[2]}&amp;amp;quot;}<br \/>\n[\/groovy]<\/p>\n<li><strong>Using hibernate criteria query<\/strong><\/li>\n<p>[groovy]<br \/>\n\/* import org.hibernate.Hibernate<br \/>\nimport org.hibernate.type.Type<br \/>\nimport org.hibernate.criterion.Projections<br \/>\nimport org.hibernate.criterion.Restrictions *\/<\/p>\n<p>sessionFactory.currentSession.createCriteria(Player)<br \/>\n                .setProjection(Projections.projectionList()<br \/>\n                .add(Projections.sqlProjection(<br \/>\n                                 &amp;amp;quot;rank() over(order by score desc) as rnk&amp;amp;quot;,<br \/>\n                                 [&amp;amp;quot;rnk&amp;amp;quot;] as String[],<br \/>\n                                 [Hibernate.INTEGER] as Type[]))<br \/>\n                .add(Projections.property(&amp;amp;quot;name&amp;amp;quot;))<br \/>\n                .add(Projections.property(&amp;amp;quot;score&amp;amp;quot;)))<br \/>\n         .list()<br \/>\n         .each {println &amp;amp;quot;${it[0]} \\t ${it[1]} \\t ${it[2]}&amp;amp;quot;}<br \/>\n[\/groovy]<\/p>\n<\/ul>\n<p>I have not been able to find a solution to find rank of specific user without loading all the records\/rows and doing a groovy find on the result. The rank function assigns rank to each row based on the final result set returned by the query. So if you add a restriction to select only specific player&#8217;s rank, it will be always 1 (as the final result set will have only one record).<\/p>\n<p>Hope you will share a better way to find rank of specific user \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":9,"footnotes":""},"categories":[7],"tags":[606,1116,1114,1113,1115],"class_list":["post-9216","post","type-post","status-publish","format-standard","hentry","category-grails","tag-grails-createcriteria","tag-leaderboard","tag-postgres","tag-rank","tag-sqlprojection"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Bhagwat Kumar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Create game Leaderboard using sqlProjection | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Create game Leaderboard using sqlProjection | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#article\",\"name\":\"Create game Leaderboard using sqlProjection | TO THE NEW Blog\",\"headline\":\"Create game Leaderboard using sqlProjection\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-11-08T01:16:33+05:30\",\"dateModified\":\"2016-12-19T14:51:23+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#webpage\"},\"articleSection\":\"Grails, grails createCriteria, leaderboard, postgres, rank, sqlProjection\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#listItem\",\"name\":\"Create game Leaderboard using sqlProjection\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#listItem\",\"position\":3,\"name\":\"Create game Leaderboard using sqlProjection\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/\",\"name\":\"Bhagwat Kumar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d6c506f803fe26906ef802b1eaee463146e449a8b5b3d1f7e4ebc715b933d620?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Bhagwat Kumar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/\",\"name\":\"Create game Leaderboard using sqlProjection | TO THE NEW Blog\",\"description\":\"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/create-game-leaderboard-using-sqlprojection\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"datePublished\":\"2012-11-08T01:16:33+05:30\",\"dateModified\":\"2016-12-19T14:51:23+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Create game Leaderboard using sqlProjection | TO THE NEW Blog","description":"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for","canonical_url":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#article","name":"Create game Leaderboard using sqlProjection | TO THE NEW Blog","headline":"Create game Leaderboard using sqlProjection","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2012-11-08T01:16:33+05:30","dateModified":"2016-12-19T14:51:23+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#webpage"},"articleSection":"Grails, grails createCriteria, leaderboard, postgres, rank, sqlProjection"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/www.tothenew.com\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#listItem","name":"Create game Leaderboard using sqlProjection"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#listItem","position":3,"name":"Create game Leaderboard using sqlProjection","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/","name":"Bhagwat Kumar","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d6c506f803fe26906ef802b1eaee463146e449a8b5b3d1f7e4ebc715b933d620?s=96&d=mm&r=g","width":96,"height":96,"caption":"Bhagwat Kumar"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/","name":"Create game Leaderboard using sqlProjection | TO THE NEW Blog","description":"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"datePublished":"2012-11-08T01:16:33+05:30","dateModified":"2016-12-19T14:51:23+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Create game Leaderboard using sqlProjection | TO THE NEW Blog","og:description":"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for","og:url":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Create game Leaderboard using sqlProjection | TO THE NEW Blog","twitter:description":"Recently I was working on a Facebook game application using Grails 2.0 and Postgres database. The use case was to show the game leaderboard with ranks of the players. Players with same score should be given same rank and next player rank should be incremented rank of last player. Here is the sample data for","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"9216","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 22:20:50","updated":"2024-02-29 09:32:21","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCreate game Leaderboard using sqlProjection\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Grails","link":"https:\/\/www.tothenew.com\/blog\/category\/grails\/"},{"label":"Create game Leaderboard using sqlProjection","link":"https:\/\/www.tothenew.com\/blog\/create-game-leaderboard-using-sqlprojection\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=9216"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9216\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=9216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=9216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=9216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}