Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chebi slim version iri #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ TODAY ?= $(shell date +%Y-%m-%d)
URIBASE= http://purl.obolibrary.org/obo
ONTBASE= $(URIBASE)/chebi/obophenotype
ROBOT= robot
VERSION= $(TODAY)
ANNOTATE_ONTOLOGY_VERSION = annotate -V $(ONTBASE)/releases/$(VERSION)/$@ --annotation owl:versionInfo $(VERSION)

MIR= true
Expand All @@ -17,8 +16,8 @@ mirror/chebi.owl.gz:

chebi_slim.owl: mirror/chebi.owl seed.txt
$(ROBOT) extract -i $< -T seed.txt --force true --copy-ontology-annotations true --individuals include --method BOT \
query --update sparql/inject-subset-declaration.ru --update sparql/inject-synonymtype-declaration.ru --update sparql/postprocess-module.ru \
annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@
query --update sparql/preprocess-module.ru --update sparql/inject-subset-declaration.ru --update sparql/inject-synonymtype-declaration.ru --update sparql/postprocess-module.ru \
convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@
.PRECIOUS: chebi_slim.owl

chebi_slim.obo: chebi_slim.owl
Expand Down
2 changes: 1 addition & 1 deletion sparql/postprocess-module.ru
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ DELETE {
WHERE {
?ontology rdf:type owl:Ontology .
?ontology ?ontology_annotation_property ?ontology_annotation_value .
FILTER(?ontology_annotation_property != dc:source && ?ontology_annotation_property != rdf:type)
FILTER(?ontology_annotation_property != owl:versionIRI && ?ontology_annotation_property != dc:source && ?ontology_annotation_property != rdf:type)

}
3 changes: 2 additions & 1 deletion sparql/preprocess-module.ru
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PREFIX owl: <http://www.w3.org/2002/07/owl#>

INSERT {
?ontology dc:source ?version_iri .
?ontology owl:versionIRI ?newVersionIRI .
}

WHERE {
Expand All @@ -18,5 +19,5 @@ WHERE {
#OPTIONAL {
# ?ontology ?ontology_annotation_property ?ontology_annotation_value .
#}

BIND(REPLACE(REPLACE(STR(?version_iri),"http://purl.obolibrary.org/obo/chebi/","http://purl.obolibrary.org/obo/chebi/obophenotype/releases/"),"chebi.owl","chebi_slim.owl") as ?newVersionIRI)
}