Skip to content

Commit

Permalink
Merge pull request #77 from ExposuresProvider/add-provenance-for-signor
Browse files Browse the repository at this point in the history
This PR attempts to implement the temporary fix we described in #76 (comment) by (1) loading only the SIGNOR models into Blazegraph, (2) marking all the models as having SIGNOR provenance, and then (3) loading the remaining models.
  • Loading branch information
gaurav authored Aug 31, 2022
2 parents 8fe9cc6 + 744e593 commit b2ad9f8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions sparql/set-provenance-to-signor.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lego: <http://geneontology.org/lego/>
PREFIX pav: <http://purl.org/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 <https://signor.uniroma2.it/> .
} 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
}

0 comments on commit b2ad9f8

Please sign in to comment.