Skip to content

Commit

Permalink
Update qc-xref-syntax.sparql
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Apr 22, 2024
1 parent 38f3a56 commit 1fb3815
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/sparql/qc/general/qc-xref-syntax.sparql
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# home: hp
prefix hasDbXref: <http://www.geneontology.org/formats/oboInOwl#hasDbXref>
prefix oio: <http://www.geneontology.org/formats/oboInOwl#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# # Invalid Xref
#
# **Problem:** A database_cross_reference is not in CURIE format.
#
# **Solution:** Replace the reference with a [CURIE](https://www.w3.org/TR/2010/NOTE-curie-20101216/).

SELECT DISTINCT ?entity ?property ?value WHERE
{
?entity hasDbXref: ?x .
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

FILTER( regex(STR(?x), " ") || regex(STR(?x), ";") || STR(?x) = "" )
BIND(hasDbXref: AS ?property)
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {oboInOwl:hasDbXref}
?entity ?property ?value .
FILTER (!regex(?value, "^[A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_]:[^\\s]+$"))
FILTER (!isBlank(?entity))
}
ORDER BY ?entity

0 comments on commit 1fb3815

Please sign in to comment.