sub:assertion {
sub:get-fer-pref-ids-extra-available dct:description "This query returns the preferred IDs of FAIR-Enabling Resources (FERs) as an extra list to the get-fer-pref-ids list, adding the ones that are *only* tagged as fip:Available-FAIR-Enabling-Resource." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get FER preferred IDs (extra available FERs)" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/type/ab9afe2ff44e1c42e9f93092c0d6978a4d519b04fb0abecbc360603af23a34c2> ;
<
https://w3id.org/kpxl/grlc/sparql> """prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix fip: <https://w3id.org/fair/fip/terms/>
select distinct ?resource_pref_id ?res ?reslabel ?res_np_date ?resourcetype ?res_np ?np_pre ?pubkey_hash ?np_pre_pubkey_hash where {
graph npa:graph {
?res_np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?res_np ; npa:hasValidSignatureForPublicKey ?pubkey . }
bind(sha256(?pubkey) as ?pubkey_hash) ## workaround due to https://github.com/knowledgepixels/nanopub-query/issues/14
?res_np npx:hasNanopubType fip:Available-FAIR-Enabling-Resource .
filter not exists { ?res_np npx:hasNanopubType fip:FAIR-Enabling-Resource . }
?res_np (npx:introduces|npx:describes) ?resource_pref_id .
bind(replace(str(?resource_pref_id), \"^.*?(#|/)([^/#]*/?[^/#]*)/?$\", \"$2\") as ?res)
?res_np dct:created ?res_np_date .
?res_np rdfs:label ?reslabel .
bind(fip:Available-FAIR-Enabling-Resource as ?resourcetype)
}
optional { select * { graph npa:networkGraph {
?res_np npx:supersedes* ?np_pre_x .
} } }
bind(coalesce(?np_pre_x, ?res_np) as ?np_pre)
bind(concat(str(?np_pre), \" \", ?pubkey_hash) as ?np_pre_pubkey_hash)
} order by ?resource_pref_id ?res_np""" .
}