Skip to content

Commit

Permalink
Add report to WARN of newline chars in text
Browse files Browse the repository at this point in the history
Prefer that no text contain newline characters. Works for CR
and/or LF.
  • Loading branch information
allenbaron committed Jan 9, 2025
1 parent 8315f3b commit 843b282
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/sparql/report/newline_in_text.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# returns entities with text elements that have newline characters in them

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>

SELECT DISTINCT ?entity ?property ?value
WHERE {
VALUES ?property {
rdfs:label
obo:IAO_00001115
oboInOwl:hasExactSynonym
oboInOwl:hasBroadSynonym
oboInOwl:hasNarrowSynonym
oboInOwl:hasRelatedSynonym
rdfs:comment
}
?entity ?property ?value .

FILTER(REGEX(?value, "[\\r\\n]"))
FILTER NOT EXISTS { ?entity owl:deprecated true }
}
1 change: 1 addition & 0 deletions src/sparql/report/report_profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ERROR file:./src/sparql/report/invalid_syn_type_property.rq
ERROR file:./src/sparql/report/multiple_not_allowed.rq
WARN file:./src/sparql/report/invalid_annotation_property_eco_code.rq
WARN file:./src/sparql/report/invalid_mapping.rq
WARN file:./src/sparql/report/newline_in_text.rq
WARN file:./src/sparql/report/unpunctuated_definition.rq
WARN file:./src/sparql/report/xref_as_synonym.rq
INFO file:./src/sparql/report/missing_definition_xref.rq
Expand Down

0 comments on commit 843b282

Please sign in to comment.