From 02bd82bb11eced25d201853f73040339737d07ff Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Sat, 3 Sep 2022 20:51:26 +0300 Subject: [PATCH] Fix chebi slim version iri fixes #2 --- Makefile | 5 ++--- sparql/postprocess-module.ru | 2 +- sparql/preprocess-module.ru | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 26a6b46..c43aa24 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/sparql/postprocess-module.ru b/sparql/postprocess-module.ru index 0767af1..eaaeae0 100644 --- a/sparql/postprocess-module.ru +++ b/sparql/postprocess-module.ru @@ -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) } \ No newline at end of file diff --git a/sparql/preprocess-module.ru b/sparql/preprocess-module.ru index 99120a0..c187a61 100644 --- a/sparql/preprocess-module.ru +++ b/sparql/preprocess-module.ru @@ -10,6 +10,7 @@ PREFIX owl: INSERT { ?ontology dc:source ?version_iri . + ?ontology owl:versionIRI ?newVersionIRI . } WHERE { @@ -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) } \ No newline at end of file