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

Issue 125 relation graphs #198

Merged
merged 17 commits into from
Aug 28, 2020
Merged
Changes from 3 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
136 changes: 9 additions & 127 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,38 +205,21 @@ $(BUILD_DIR)/phenoscape-kb-tbox-classified-pre-absence-reasoning.ofn: $(BUILD_DI
# ----------

# Generate phenoscape-kb-tbox.ofn
$(BUILD_DIR)/phenoscape-kb-tbox.ofn: $(BUILD_DIR)/bio-ontologies-classified.ttl \
$(BUILD_DIR)/defined-by-links.ttl \
$(BUILD_DIR)/phenex-tbox.ofn \
$(BUILD_DIR)/anatomical-entity-presences.ofn \
$(BUILD_DIR)/anatomical-entity-absences.ofn \
$(BUILD_DIR)/anatomical-entity-partOf.ofn \
$(BUILD_DIR)/hasParts.ofn \
$(BUILD_DIR)/anatomical-entity-hasPartsInheringIns.ofn \
$(BUILD_DIR)/anatomical-entity-phenotypeOfs.ofn \
$(BUILD_DIR)/anatomical-entity-phenotypeOf-partOf.ofn \
$(BUILD_DIR)/anatomical-entity-phenotypeOf-developsFrom.ofn
$(BUILD_DIR)/phenoscape-kb-tbox.ofn: $(BUILD_DIR)/bio-ontologies-classified.ttl $(BUILD_DIR)/defined-by-links.ttl $(BUILD_DIR)/phenex-tbox.ofn
$(ROBOT) merge \
-i $(BUILD_DIR)/bio-ontologies-classified.ttl \
-i $(BUILD_DIR)/defined-by-links.ttl \
-i $(BUILD_DIR)/phenex-tbox.ofn \
-i $(BUILD_DIR)/anatomical-entity-presences.ofn \
-i $(BUILD_DIR)/anatomical-entity-absences.ofn \
-i $(BUILD_DIR)/anatomical-entity-partOf.ofn \
-i $(BUILD_DIR)/hasParts.ofn \
-i $(BUILD_DIR)/anatomical-entity-hasPartsInheringIns.ofn \
-i $(BUILD_DIR)/anatomical-entity-phenotypeOfs.ofn \
-i $(BUILD_DIR)/anatomical-entity-phenotypeOf-partOf.ofn \
-i $(BUILD_DIR)/anatomical-entity-phenotypeOf-developsFrom.ofn \
convert --format ofn \
-o [email protected] \
&& mv [email protected] $@

# ----------

# *** Subsumers ***

# -----
$(BUILD_DIR)/bio-ontologies-property-graphs.ttl : $(BUILD_DIR)/bio-ontologies-merged.ttl
relation-graph --ontology-file $< \
--non-redundant-output-file $@ \
--redundant-output-file $(BUILD_DIR)/bio-ontologies-redundant-property-graphs.ttl \
Shalsh23 marked this conversation as resolved.
Show resolved Hide resolved
--mode rdf

$(BUILD_DIR)/defined-by-links.ttl: $(BUILD_DIR)/bio-ontologies-merged.ttl $(SPARQL)/isDefinedBy.sparql
$(ROBOT) query \
Expand All @@ -245,110 +228,6 @@ $(BUILD_DIR)/defined-by-links.ttl: $(BUILD_DIR)/bio-ontologies-merged.ttl $(SPAR
--input $< \
--query $(SPARQL)/isDefinedBy.sparql $@

$(BUILD_DIR)/anatomical-entity-presences.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/implies_presence_of.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/implies_presence_of.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-absences.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/absences.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/absences.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-partOf.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/part_of.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/part_of.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/hasParts.ofn: $(BUILD_DIR)/anatomical-entities.txt $(BUILD_DIR)/qualities.txt patterns/has_part.yaml
mkdir -p $(dir $@) \
&& sed '1d' $(BUILD_DIR)/qualities.txt > $(BUILD_DIR)/qualities--header.txt \
&& cat $(BUILD_DIR)/anatomical-entities.txt $(BUILD_DIR)/qualities--header.txt > $(BUILD_DIR)/anatomical-entities++qualities.txt \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/has_part.yaml \
--infile=$(BUILD_DIR)/anatomical-entities++qualities.txt \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-hasPartsInheringIns.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/has_part_inhering_in.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/has_part_inhering_in.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-phenotypeOfs.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/phenotype_of.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/phenotype_of.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-phenotypeOf-partOf.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/phenotype_of_part_of.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/phenotype_of_part_of.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

$(BUILD_DIR)/anatomical-entity-phenotypeOf-developsFrom.ofn: $(BUILD_DIR)/anatomical-entities.txt patterns/phenotype_of_develops_from.yaml
mkdir -p $(dir $@) \
&& dosdp-tools generate \
--generate-defined-class=true \
--obo-prefixes=true \
--template=patterns/phenotype_of_develops_from.yaml \
--infile=$< \
[email protected] \
&& mv [email protected] $@

# -----

# Generate anatomical-entities.txt
$(BUILD_DIR)/anatomical-entities.txt: $(BUILD_DIR)/bio-ontologies-classified.ttl $(BUILD_DIR)/defined-by-links.ttl $(SPARQL)/anatomicalEntities.sparql
$(ARQ) \
-q \
--data=$< \
--data=$(BUILD_DIR)/defined-by-links.ttl \
--results=TSV \
--query=$(SPARQL)/anatomicalEntities.sparql > [email protected] \
&& sed 's/^\?//' -i [email protected] \
&& mv [email protected] $@

# Generate qualities.txt
$(BUILD_DIR)/qualities.txt: $(BUILD_DIR)/bio-ontologies-classified.ttl $(SPARQL)/qualities.sparql
$(ROBOT) query \
-i $< \
--use-graphs true \
--query $(SPARQL)/qualities.sparql [email protected] \
&& mv [email protected] $@

# -----

# ----------

Expand Down Expand Up @@ -686,6 +565,7 @@ $(BUILD_DIR)/build-time.ttl: $(SPARQL)/build-time.sparql
$(DB_FILE): $(BLAZEGRAPH_PROPERTIES) \
$(BUILD_DIR)/phenoscape-kb.ttl \
$(BUILD_DIR)/subclass-closure.ttl $(BUILD_DIR)/instance-closure.ttl \
$(BUILD_DIR)/bio-ontologies-property-graphs.ttl $(BUILD_DIR)/bio-ontologies-redundant-property-graphs.ttl \
$(BUILD_DIR)/corpus-ics-taxa.ttl $(BUILD_DIR)/taxa-expect-scores.ttl $(BUILD_DIR)/taxa-pairwise-sim.ttl \
$(BUILD_DIR)/corpus-ics-genes.ttl $(BUILD_DIR)/gene-expect-scores.ttl $(BUILD_DIR)/gene-pairwise-sim.ttl \
$(BUILD_DIR)/phylopics.owl \
Expand All @@ -695,6 +575,8 @@ $(DB_FILE): $(BLAZEGRAPH_PROPERTIES) \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/" $(BUILD_DIR)/phenoscape-kb.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/closure" $(BUILD_DIR)/subclass-closure.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/closure" $(BUILD_DIR)/instance-closure.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/property_graphs" $(BUILD_DIR)/bio-ontologies-property-graphs.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/property_graphs" $(BUILD_DIR)/bio-ontologies-redundant-property-graphs.ttl && \
Shalsh23 marked this conversation as resolved.
Show resolved Hide resolved
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/sim/taxa" $(BUILD_DIR)/corpus-ics-taxa.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/sim/taxa" $(BUILD_DIR)/taxa-expect-scores.ttl && \
$(BLAZEGRAPH-RUNNER) load --informat=turtle --journal=$@ --properties=$< --graph="http://kb.phenoscape.org/sim/taxa" $(BUILD_DIR)/taxa-pairwise-sim.ttl && \
Expand Down