Skip to content

Commit

Permalink
Fix it for real this time...
Browse files Browse the repository at this point in the history
  • Loading branch information
tnavatar committed Nov 1, 2024
1 parent f1cd07f commit 499c652
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/genegraph/gene_validity/graphql/schema/resource.clj
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,18 @@
;; Getting rid of website-legacy-ids for the time being
;; revisit original file in Genegraph for previous implementation

(defn phil-requested-assertion_be-ok-in-iris [iri]
(s/replace iri #"assertion_([0-9a-f\-]{36}).*" "$1"))

(def resource-query
{:name :resource
:graphql-type :query
:description "Find a resource by IRI or CURIE"
:args {:iri {:type 'String}}
:type :Resource
:resolve (fn [context args _]
(let [r (rdf/resource (:iri args) (:db context))]
(or (rdf/ld1-> r [[:cg/website-legacy-id :<]])
;; Phil sends requests from the website that match neither the direct IRI,
;; nor the assertion_ syntax. This should address that issue.
(s/replace r #"assertion_" ""))))})
;; Phil sends requests from the website that match neither the direct IRI,
;; nor the assertion_ syntax. This should address that issue.
(let [r (rdf/resource (phil-requested-assertion_be-ok-in-iris (:iri args))
(:db context))]
(or (rdf/ld1-> r [[:cg/website-legacy-id :<]]) r)))})

0 comments on commit 499c652

Please sign in to comment.