diff --git a/Makefile b/Makefile index 028b2e1..41aecff 100644 --- a/Makefile +++ b/Makefile @@ -66,9 +66,10 @@ missing-biolink-relation.ttl: sparql/reports/owl-missing-biolink-relation.rq cam all: cam-db-reasoned.jnl noctua-models.jnl: $(NOCTUA_MODELS_REPO)/models/*.ttl signor-models + $(BLAZEGRAPH-RUNNER) load --journal=$@ --properties=blazegraph.properties --informat=turtle --use-ontology-graph=true signor-models &&\ + $(BLAZEGRAPH-RUNNER) update --journal=$@ --properties=blazegraph.properties sparql/set-provenance-to-signor.ru &&\ $(BLAZEGRAPH-RUNNER) load --journal=$@ --properties=blazegraph.properties --informat=turtle --use-ontology-graph=true $(NOCTUA_MODELS_REPO)/models &&\ - $(BLAZEGRAPH-RUNNER) update --journal=$@ --properties=blazegraph.properties sparql/delete-non-production-models.ru &&\ - $(BLAZEGRAPH-RUNNER) load --journal=$@ --properties=blazegraph.properties --informat=turtle --use-ontology-graph=true signor-models + $(BLAZEGRAPH-RUNNER) update --journal=$@ --properties=blazegraph.properties sparql/delete-non-production-models.ru noctua-models-inferences.nq: $(NOCTUA_MODELS_REPO)/models/*.ttl sparql/is-production.rq ontologies-merged.ttl $(MAT) --ontology-file ontologies-merged.ttl --input $(NOCTUA_MODELS_REPO)/models --output $@ --output-graph-name '#inferred' --suffix-graph true --mark-direct-types true --output-indirect-types true --parallelism 20 --filter-graph-query sparql/is-production.rq --reasoner arachne diff --git a/sparql/set-provenance-to-signor.ru b/sparql/set-provenance-to-signor.ru new file mode 100644 index 0000000..e4c31ca --- /dev/null +++ b/sparql/set-provenance-to-signor.ru @@ -0,0 +1,24 @@ +PREFIX rdf: +PREFIX owl: +PREFIX lego: +PREFIX pav: + +# This is a temporary fix to https://github.com/ExposuresProvider/cam-pipeline/issues/76 -- a more +# permanent fix would require rewriting the SIGNOR to TTL converter to add provenance information. +# Currently we import the SIGNOR models first, use this SPARQL UPDATE to mark them as imported from +# SIGNOR, and then load the remaining models. + +INSERT { + # pav:importedFrom might be more accurate here, but I think + # sparql/delete-non-production-models.ru deletes models that + # don't have a pav:providedBy (which also seems to be what + # the triplestore largely uses), so let's use that to be + # consistent. + ?model pav:providedBy . +} WHERE { + ?model rdf:type owl:Ontology . + # When generating SIGNOR models, we set lego:modelstate, + # so we can use that to ensure we're only modifying models + # here. + ?model lego:modelstate ?modelstate +}