-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from INCATools/allow-prefixes-pass-thru
Allow prefixes pass-thru.
- Loading branch information
Showing
15 changed files
with
1,980 additions
and
1,664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,24 +33,29 @@ help: | |
# All dbs are made from an initial template containing | ||
# (1) prefixes | ||
# (2) SQL Schema (primarily views) | ||
$(TEMPLATE): $(THIS_DIR)/sql_schema/semsql.sql build_prefixes | ||
cat $< | sqlite3 $@.tmp && \ | ||
echo .exit | sqlite3 -echo $@.tmp -cmd ".mode csv" -cmd ".import $(THIS_DIR)/prefixes/prefixes.csv prefix" && \ | ||
mv $@.tmp $@ | ||
.PRECIOUS: $(TEMPLATE) | ||
#$(TEMPLATE): $(THIS_DIR)/sql_schema/semsql.sql build_prefixes | ||
# cat $< | sqlite3 [email protected] && \ | ||
# echo .exit | sqlite3 -echo [email protected] -cmd ".mode csv" -cmd ".import $(THIS_DIR)/prefixes/prefixes.csv prefix" && \ | ||
# mv [email protected] $@ | ||
#.PRECIOUS: $(TEMPLATE) | ||
|
||
%-min.owl: %.owl | ||
robot \ | ||
remove -i $< --axioms "equivalent disjoint annotation" \ | ||
filter --exclude-terms $(THIS_DIR)/exclude-terms.txt \ | ||
-o $@ | ||
|
||
PREFIX_CSV_PATH = $(PREFIX_DIR)/prefixes.csv | ||
PREFIX_YAML_PATH = $(PREFIX_DIR)/prefixes.yaml | ||
|
||
# -- MAIN TARGET -- | ||
# A db is constructed from | ||
# (1) triples loaded using rdftab | ||
# (2) A relation-graph TSV | ||
%.db: %.owl %-$(RGSUFFIX).tsv $(TEMPLATE) | ||
cp $(TEMPLATE) $@.tmp && \ | ||
%.db: %.owl %-$(RGSUFFIX).tsv $(PREFIX_CSV_PATH) | ||
rm -f $@.tmp && \ | ||
cat $(THIS_DIR)/sql_schema/semsql.sql | sqlite3 $@.tmp && \ | ||
echo .exit | sqlite3 -echo $@.tmp -cmd ".mode csv" -cmd ".import $(PREFIX_CSV_PATH) prefix" && \ | ||
rdftab $@.tmp < $< && \ | ||
sqlite3 $@.tmp -cmd '.separator "\t"' ".import $*-$(RGSUFFIX).tsv entailed_edge" && \ | ||
gzip -f $*-$(RGSUFFIX).tsv && \ | ||
|
@@ -61,22 +66,14 @@ $(TEMPLATE): $(THIS_DIR)/sql_schema/semsql.sql build_prefixes | |
|
||
# -- ENTAILED EDGES -- | ||
# relation-graph is used to compute entailed edges. | ||
# | ||
# this currently requires a few different steps, because | ||
# - RG currently outputs TTL | ||
# - We need a TSV using correct prefixes/CURIEs to load into our db | ||
# | ||
# will be simplified in future. See: | ||
# - https://github.com/balhoff/relation-graph/issues/123 | ||
# - https://github.com/balhoff/relation-graph/issues/25 | ||
%-$(RGSUFFIX).tsv: %-min.owl %-properties.txt $(PREFIX_DIR)/prefixes.yaml | ||
%-$(RGSUFFIX).tsv: %-min.owl %-properties.txt $(PREFIX_YAML_PATH) | ||
$(RG) --disable-owl-nothing true \ | ||
--ontology-file $<\ | ||
$(RG_PROPERTIES) \ | ||
--output-file [email protected] \ | ||
--equivalence-as-subclass true \ | ||
--mode TSV \ | ||
--prefixes $(PREFIX_DIR)/prefixes.yaml \ | ||
--prefixes $(PREFIX_YAML_PATH) \ | ||
--output-individuals true \ | ||
--output-subclasses true \ | ||
--reflexive-subclasses true && \ | ||
|
@@ -105,6 +102,6 @@ $(PREFIX_DIR)/prefixes.csv: $(PREFIX_DIR)/prefixes_curated.csv $(PREFIX_DIR)/pre | |
cat $^ > $@ | ||
|
||
# see https://github.com/INCATools/relation-graph/issues/168 | ||
$(PREFIX_DIR)/prefixes.yaml: $(PREFIX_DIR)/prefixes.csv | ||
$(PREFIX_YAML_PATH): $(PREFIX_CSV_PATH) | ||
grep -v ^prefix, $< | grep -v ^obo, | perl -npe 's@,(.*)@: "$$1"@' > $@.tmp && mv $@.tmp $@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.