Skip to content

Commit

Permalink
change definition pattern to population only
Browse files Browse the repository at this point in the history
  • Loading branch information
anitacaron committed Jan 9, 2024
1 parent 4089ca4 commit 190ff8b
Show file tree
Hide file tree
Showing 7 changed files with 538 additions and 546 deletions.
4 changes: 2 additions & 2 deletions src/ontology/afpo.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
## changes here rather than in the main Makefile

.PHONY: update_def_table
update_def_table: $(PATTERNDIR)/data/default/create_definition.tsv
update_def_table: $(PATTERNDIR)/data/default/create_population_definition.tsv

$(PATTERNDIR)/data/default/create_definition.tsv: $(SPARQLDIR)/annotation_definition.sparql $(SRC)
$(PATTERNDIR)/data/default/create_population_definition.tsv: $(SPARQLDIR)/population_annotation_definition.sparql $(SRC)
$(ROBOT) query --input $(SRC) --query $< $@.tmp.tsv
sed -e 's/?//g' -e 's/"//g' -e 's/http:\/\/purl.obolibrary.org\/obo\/AfPO_/AfPO:/g' < $@.tmp.tsv >$@ && rm $@.tmp.tsv

Large diffs are not rendered by default.

881 changes: 418 additions & 463 deletions src/patterns/definitions.owl

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions src/patterns/dosdp-patterns/create_definition.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions src/patterns/dosdp-patterns/create_population_definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pattern_name: create_population_definition
pattern_iri: http://purl.obolibrary.org/obo/afpo/patterns/create_population_definition.yaml

description: "This pattern creates population class definition using annotations from the classes."

annotationProperties:
xref: oio:hasDbXref

data_vars:
parent_class_label: "xsd:string"
population_size: "xsd:string"

data_list_vars:
wiki: "'xref'"

def:
text: "A %s population with a population size of %s"
vars:
- parent_class_label
- population_size
annotations:
- annotationProperty: xref
value: wiki
5 changes: 3 additions & 2 deletions src/patterns/pattern.owl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Ontology(<urn:unnamed:ontology#ont1>

Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/IAO_0000115>))
Declaration(AnnotationProperty(<http://purl.org/dc/terms/title>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#hasDbXref>))


AnnotationAssertion(<http://purl.obolibrary.org/obo/IAO_0000115> <http://purl.obolibrary.org/obo/afpo/patterns/create_definition.yaml> "A country in xsd:string with a population size of xsd:string"^^xsd:string)
AnnotationAssertion(<http://purl.org/dc/terms/title> <http://purl.obolibrary.org/obo/afpo/patterns/create_definition.yaml> "create_definition"^^xsd:string)
AnnotationAssertion(Annotation(<http://www.geneontology.org/formats/oboInOwl#hasDbXref> "'xref'"^^xsd:string) <http://purl.obolibrary.org/obo/IAO_0000115> <http://purl.obolibrary.org/obo/afpo/patterns/create_population_definition.yaml> "A xsd:string population with a population size of xsd:string"^^xsd:string)
AnnotationAssertion(<http://purl.org/dc/terms/title> <http://purl.obolibrary.org/obo/afpo/patterns/create_population_definition.yaml> "create_population_definition"^^xsd:string)
)
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX population_size: <http://purl.obolibrary.org/obo/AfPO_0000459>
PREFIX Population: <http://purl.obolibrary.org/obo/AfPO_0000146>
PREFIX wiki_ref: <http://purl.obolibrary.org/obo/AfPO_0000235>
PREFIX wiki: <https://en.wikipedia.org/wiki/>

SELECT ?defined_class ?defined_class_label ?parent_class_label ?population_size ?xref
SELECT ?defined_class ?defined_class_label ?parent_class_label ?population_size ?wiki
WHERE {
?dc a owl:Class .
?dc rdfs:label ?defined_class_label .
?dc rdfs:subClassOf ?pc .
?dc population_size: ?population_size .
OPTIONAL { ?dc population_size: ?population_size . }
OPTIONAL { ?dc wiki_ref: ?x . }
?pc a owl:Class .
?pc rdfs:subClassOf* Population: .
?pc rdfs:label ?parent_class_label .
BIND(STR(?dc) AS ?defined_class)
BIND(STR(?x) AS ?xref)
BIND(STR(?x) AS ?wiki)
}

0 comments on commit 190ff8b

Please sign in to comment.