Skip to content

Commit

Permalink
Merge pull request #438 from rctauber/report_feedback
Browse files Browse the repository at this point in the history
Report query updates based on feedback
  • Loading branch information
jamesaoverton authored Feb 22, 2019
2 parents b037bd5 + 22cc5f2 commit ac231ab
Show file tree
Hide file tree
Showing 51 changed files with 307 additions and 211 deletions.
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
### Configuration

# Collect the list of query files for report.
REPORT_QUERIES := $(wildcard ../robot-core/src/main/resources/queries/*.rq)
REPORT_QUERIES := $(wildcard ../robot-core/src/main/resources/report_queries/*.rq)
REPORT_DOCS := $(foreach x, $(REPORT_QUERIES), report_queries/$(notdir $(basename $(x))).md)


Expand All @@ -29,7 +29,7 @@ report_queries:
mkdir -p $@

# Convert each SPARQL file to a Markdown file.
report_queries/%.md: ../robot-core/src/main/resources/queries/%.rq | report_queries
report_queries/%.md: ../robot-core/src/main/resources/report_queries/%.rq | report_queries
awk '/^PREFIX/ && !x {print "```sparql"; x=1} 1' $< \
| sed 's/^#//' \
| sed 's/^ //' \
Expand Down
8 changes: 4 additions & 4 deletions docs/report_queries/annotation_whitespace.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Annotation Whitespace

Problem: An annotation has leading or trailing whitespace, usually a single space.
**Problem:** An annotation has leading or trailing whitespace, usually a single space.

Solution: Re-format the annotation to remove additional whitespace.
**Solution:** Re-format the annotation to remove additional whitespace.

```sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
{?property a owl:AnnotationProperty .
?entity ?property ?value .
FILTER STRENDS(str(?value), " ")}
Expand All @@ -18,4 +17,5 @@ WHERE {
?entity ?property ?value .
FILTER STRSTARTS(str(?value), " ")}
}
ORDER BY ?entity
```
26 changes: 13 additions & 13 deletions docs/report_queries/deprecated_class_reference.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
# Deprecated Class Reference

Problem: A deprecated class is used in a logical axiom. A deprecated class can be the child of another class (e.g. ObsoleteClass), but it cannot have children or be used in blank nodes or equivalent class statements. Additionally, a deprecated class should not have any equivalent classes or anonymous parents.
**Problem:** A deprecated class is used in a logical axiom. A deprecated class can be the child of another class (e.g. ObsoleteClass), but it cannot have children or be used in blank nodes or equivalent class statements. Additionally, a deprecated class should not have any equivalent classes or anonymous parents.

Solution: Replace deprecated class.
**Solution:** Replace deprecated class.

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <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#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
{
VALUES ?property {
owl:equivalentClass
rdfs:subClassOf
}
?entity owl:deprecated ?dep .
FILTER regex(str(?dep), "true") .
?entity owl:deprecated true .
?value ?property ?entity .
FILTER (!STRENDS(str(?property), "owl#deprecated"))
FILTER NOT EXISTS { ?entity rdfs:subClassOf oboInOwl:ObsoleteClass }
}
UNION
{
?entity owl:deprecated ?dep .
FILTER regex(str(?dep), "true") .
?entity owl:deprecated true .
?entity ?property ?value .
FILTER (!STRENDS(str(?property), "owl#deprecated")) .
FILTER (?property != obo:IAO_0000231)
FILTER (?property != rdf:type)
FILTER NOT EXISTS { ?property a owl:AnnotationProperty }
FILTER NOT EXISTS {
?entity rdfs:subClassOf ?value .
Expand All @@ -38,6 +36,8 @@ WHERE {
?entity rdfs:subPropertyOf ?value .
FILTER (!isBlank(?value))
}
FILTER NOT EXISTS { ?entity rdfs:subClassOf oboInOwl:ObsoleteClass }
}
}
ORDER BY ?entity
```
23 changes: 14 additions & 9 deletions docs/report_queries/duplicate_definition.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Duplicate Definition

Problem: An entity shares an exact definition with another entity.
**Problem:** An entity shares an exact definition or elucidation with another entity. Excludes deprecated entities.

Solution: Update the definition to reflect the entities, or determine if the entities are the same.
**OBO Foundry Principle:** [6 - Textual Definitions](http://obofoundry.org/principles/fp-006-textual-definitions.html)

**Solution:** Update the definition to reflect the entities, or determine if the entities are the same.

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
VALUES ?property {obo:IAO_0000115}
?entity obo:IAO_0000115 ?value .
?entity2 obo:IAO_0000115 ?value .
FILTER (?entity != ?entity2) .
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property { obo:IAO_0000115
obo:IAO_0000600 }
?entity ?property ?value .
?entity2 ?property ?value .
FILTER NOT EXISTS { ?entity owl:deprecated true }
FILTER NOT EXISTS { ?entity2 owl:deprecated true }
FILTER (?entity != ?entity2)
FILTER (!isBlank(?entity))
}
ORDER BY ?value
ORDER BY DESC(UCASE(str(?value)))
```
13 changes: 8 additions & 5 deletions docs/report_queries/duplicate_exact_synonym.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Duplicate Exact Synonym

Problem: Two entities share an exact synonym. This causes ambiguity.
**Problem:** Two entities share an exact synonym. This causes ambiguity. Excludes deprecated entities.

Solution: Avoid ambiguity by assigning unique exact synonyms or changing the exact synonym to a different annotation (e.g. broad synonym).
**Solution:** Avoid ambiguity by assigning unique exact synonyms or changing the exact synonym to a different annotation (e.g. broad synonym).

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <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#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {
obo:IAO_0000118
oboInOwl:hasExactSynonym
}
?entity ?property ?value .
?entity ?property ?value.
?entity2 ?property ?value .
FILTER NOT EXISTS { ?entity owl:deprecated true }
FILTER NOT EXISTS { ?entity2 owl:deprecated true }
FILTER (?entity != ?entity2)
}
ORDER BY DESC(UCASE(str(?value)))
```
11 changes: 6 additions & 5 deletions docs/report_queries/duplicate_label.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Duplicate Label

Problem: Two different subjects have been assigned the same label. This causes ambiguity.
**Problem:** Two different subjects have been assigned the same label. This causes ambiguity.

Solution: Avoid ambiguity by assigning distinct labels to each subject.
**OBO Foundry Principle:** [12 - Naming Conventions](http://www.obofoundry.org/principles/fp-012-naming-conventions.html)

**Solution:** Avoid ambiguity by assigning distinct labels to each subject.

```sparql
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {rdfs:label}
?entity ?property ?value .
?entity2 ?property ?value .
FILTER (?entity != ?entity2)
FILTER (!isBlank(?entity))
}
ORDER BY ?value
ORDER BY DESC(UCASE(str(?value)))
```
13 changes: 8 additions & 5 deletions docs/report_queries/duplicate_label_synonym.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Duplicate Label-Synonym

Problem: An entity shares a label with an exact synonym. This causes ambiguity.
**Problem:** An entity shares a label with an exact synonym. This causes ambiguity. Excludes deprecated entities.

Solution: Avoid ambiguity by changing the exact synonym or label.
**Solution:** Avoid ambiguity by changing the exact synonym or label.

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <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#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {
obo:IAO_0000118
oboInOwl:hasExactSynonym
oboInOwl:hasRelatedSynonym
oboInOwl:hasNarrowSynonym
oboInOwl:hasBroadSynonym
}
FILTER NOT EXISTS { ?entity owl:deprecated true }
FILTER NOT EXISTS { ?entity2 owl:deprecated true }
?entity rdfs:label ?value .
?entity ?property ?value
?entity ?property ?value .
}
ORDER BY ?entity
```
7 changes: 3 additions & 4 deletions docs/report_queries/duplicate_scoped_synonym.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Duplicate Scoped Synonyms

Problem: An entity has duplicate synonyms with different properties (e.g. the same broad and related synonym). This causes ambiguity.
**Problem:** An entity has duplicate synonyms with different properties (e.g. the same broad and related synonym). This causes ambiguity.

Solution: Remove duplicate synonyms and determine the correct scope.
**Solution:** Remove duplicate synonyms and determine the correct scope.

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {
obo:IAO_0000118
oboInOwl:hasExactSynonym
Expand Down
8 changes: 4 additions & 4 deletions docs/report_queries/equivalent_pair.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Equivalent Pair

Problem: An entity has a one-to-one equivalency with another entity. This may be intentional (assuming it is not annotated with `is_inferred true`), or it may be due to incorrect logic and the reasoner asserting the equivalency.
**Problem:** An entity has a one-to-one equivalency with another entity. This may be intentional (assuming it is not annotated with `is_inferred true`), or it may be due to incorrect logic and the reasoner asserting the equivalency.

Solution: Ensure the reasoner is not incorrectly inferring equivalency. If so, update the logical axioms.
**Solution:** Ensure the reasoner is not incorrectly inferring equivalency. If so, update the logical axioms.

```sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {owl:equivalentClass}
?entity ?property ?value .
FILTER (!isBlank(?value))
}
ORDER BY ?entity
```
5 changes: 4 additions & 1 deletion docs/report_queries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ See [`report`](../report) for more details.
| [missing definition](missing_definition) | WARN
| [missing label](missing_label) | ERROR
| [missing obsolete label](missing_obsolete_label) | WARN
| [missing ontology description](missing_ontology_description) | ERROR
| [missing ontology license](missing_ontology_license) | ERROR
| [missing ontology title](missing_ontology_title) | ERROR
| [missing superclass](missing_superclass) | INFO
| [misused obsolete label](misused_obsolete_label) | ERROR
| [multiple asserted superclasses](multiple_asserted_superclasses) | WARN
| [multiple definitions](multiple_definitions) | ERROR
| [multiple equivalent classes](multiple_equivalent_classes) | ERROR
| [multiple labels](multiple_labels) | ERROR
| [ontology metadata](ontology_metadata) | ERROR
10 changes: 5 additions & 5 deletions docs/report_queries/invalid_xref.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Invalid Xref

Problem: A database_cross_reference is not in CURIE format.
**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/).
**Solution:** Replace the reference with a [CURIE](https://www.w3.org/TR/2010/NOTE-curie-20101216/).

```sparql
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {oboInOwl:hasDbXref}
?entity ?property ?value .
FILTER (!regex(?value, "^[a-z|A-Z|_|0-9]*:(?!$)\\S*$"))
FILTER (!regex(?value, "^[a-z|A-Z|_|\\-|0-9]*:(?!$)\\S*$"))
FILTER (!isBlank(?entity))
}
ORDER BY ?entity
```
8 changes: 4 additions & 4 deletions docs/report_queries/label_formatting.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Label Formatting

Problem: Formatting characters are used in a label. This may cause issues when trying to reference the entity by label.
**Problem:** Formatting characters are used in a label. This may cause issues when trying to reference the entity by label.

Solution: Remove formatting characters from label.
**Solution:** Remove formatting characters from label.

```sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
{
VALUES ?property {rdfs:label}
?entity ?property ?value .
Expand All @@ -22,4 +21,5 @@ WHERE {
FILTER regex(?value, "\t")
}
}
ORDER BY ?entity
```
8 changes: 4 additions & 4 deletions docs/report_queries/label_whitespace.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Label Whitespace

Problem: A label has leading or trailing whitespace. This may cause issues when trying to reference the entity by label.
**Problem:** A label has leading or trailing whitespace. This may cause issues when trying to reference the entity by label.

Solution: Remove the additional whitespace.
**Solution:** Remove the additional whitespace.

```sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value
WHERE {
SELECT DISTINCT ?entity ?property ?value WHERE {
{
VALUES ?property {rdfs:label}
?entity ?property ?value .
Expand All @@ -22,4 +21,5 @@ WHERE {
FILTER STRSTARTS(str(?value), " ")
}
}
ORDER BY ?entity
```
11 changes: 6 additions & 5 deletions docs/report_queries/lowercase_definition.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Lowercase Definition

Problem: A definition does not begin with an uppercase letter. This may be indicative of inconsistent formatting.
**Problem:** A definition or elucidation does not begin with an uppercase letter. This may be indicative of inconsistent formatting.

Solution: Capitalize the first letter of the definition, or disregard this INFO.
**Solution:** Capitalize the first letter of the definition, or disregard this INFO.

```sparql
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT DISTINCT ?entity ?property ?value
WHERE {
VALUES ?property {obo:IAO_0000115}
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property { obo:IAO_0000115
obo:IAO_0000600 }
?entity ?property ?value .
FILTER (!regex(?value, "^[A-Z]"))
}
ORDER BY ?entity
```
Loading

0 comments on commit ac231ab

Please sign in to comment.