-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add opt_fix query to remove newline chars from text
Recognizes CR and/or LF and replaces each continuous group with a single space.
- Loading branch information
1 parent
843b282
commit 831a553
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Replace newlines (/n, /r, or /r/n) in text with spaces | ||
|
||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
|
||
DELETE { | ||
?iri ?pred ?text . | ||
?axiom owl:annotatedTarget ?text . | ||
} | ||
INSERT { | ||
?iri ?pred ?text_new . | ||
?axiom owl:annotatedTarget ?text_new . | ||
} | ||
WHERE { | ||
VALUES ?pred { | ||
rdfs:label | ||
obo:IAO_0000115 | ||
oboInOwl:hasExactSynonym | ||
oboInOwl:hasBroadSynonym | ||
oboInOwl:hasNarrowSynonym | ||
oboInOwl:hasRelatedSynonym | ||
rdfs:comment | ||
} | ||
?iri ?pred ?text . | ||
|
||
OPTIONAL { | ||
?axiom a owl:Axiom ; | ||
owl:annotatedSource ?iri ; | ||
owl:annotatedProperty ?pred ; | ||
owl:annotatedTarget ?text . | ||
} | ||
|
||
FILTER(REGEX(?text, "[\\r\\n]")) | ||
BIND((REPLACE(?text, "[\\r\\n]+", " ")) AS ?text_new) | ||
|
||
FILTER NOT EXISTS { ?iri owl:deprecated true } | ||
} |