This query returns the most popular FAIR Supporting Resources (FSRs) for a given research domain, based on the current FIP declarations of the FAIR Implementation Communities in that domain (including its subdomains), across all FIP questions. For each FSR it shows the declaring communities, the FIP questions it was declared under, the matched (sub)domains, and the number of distinct declaring communities. This query backs the 'Most used FSRs' resource view shown on domain part pages.
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> select ?fsr (min(?fsr_label_x) as ?fsr_label) (group_concat(distinct str(?community); separator=" ") as ?communities_multi_iri) (group_concat(distinct replace(replace(?clabel, "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?communities_label_multi) (group_concat(distinct ?qcode; separator=", ") as ?questions) (group_concat(distinct str(?subdomain); separator=" ") as ?subdomains_multi_iri) (count(distinct ?community) as ?count) (min(?fsrnp_x) as ?np) (min("^") as ?np_label) where { { select ?community ?subdomain (min(?community_label) as ?clabel) where { graph npa:graph { ?cnp npa:hasValidSignatureForPublicKey ?cpubkey ; npx:hasNanopubType fip:FAIR-Implementation-Community ; np:hasAssertion ?ca . ?cnp npx:introduces|npx:describes ?community . filter not exists { ?cnp npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?cnpx npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKey ?cpubkey . } } graph ?ca { ?community a fip:FAIR-Implementation-Community ; rdfs:label ?community_label ; fip:has-research-domain ?subdomain . } graph <http://purl.org/np/RArRAOwj4QOppEPCR8WVvOBmrX7oRKOrPi-asX-7AY66I#assertion> { ?subdomain rdfs:subClassOf* <http://aims.fao.org/aos/agrovoc/c_331559> . } } group by ?community ?subdomain } graph ?fa { ?fip fip:declared-by ?community ; fip:has-declaration-index ?index . } graph npa:graph { ?fipnp np:hasAssertion ?fa ; npx:hasNanopubType fip:FAIR-Implementation-Profile ; npa:hasValidSignatureForPublicKey ?fippubkey . filter not exists { ?fipnp npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?fipnpx npx:invalidates ?fipnp ; npa:hasValidSignatureForPublicKey ?fippubkey . } ?index npa:hasValidSignatureForPublicKey ?ipubkey . filter not exists { ?indexx npx:invalidates ?index ; npa:hasValidSignatureForPublicKey ?ipubkey . } } graph npa:networkGraph { ?index npx:includesElement ?dnp . } graph npa:graph { ?dnp npx:hasNanopubType fip:FIP-Declaration ; np:hasAssertion ?da . } graph ?da { ?decl fip:declared-by ?community ; fip:refers-to-question ?question ; (fip:declares-current-use-of|fip:declares-planned-use-of) ?fsr . } bind(replace(str(?question), "^.*-([^-MD]+(-[MD]+)?)$", "$1") as ?qcode) optional { graph npa:graph { ?fsrnp_x npx:introduces|npx:describes ?fsr ; rdfs:label ?fsr_label_x ; npa:hasValidSignatureForPublicKey ?fpubkey . filter not exists { ?fsrnp_x npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?fsrnpx npx:invalidates ?fsrnp_x ; npa:hasValidSignatureForPublicKey ?fpubkey . } } } filter( bound(?fsrnp_x) || not exists { graph npa:graph { ?onp npx:introduces|npx:describes ?fsr . } } ) } group by ?fsr order by desc(?count)