-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add makefile to generate a synonym csv report from ontologies/rdf
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
WGET = /usr/bin/wget --timestamping --no-verbose | ||
|
||
OBO = http://purl.obolibrary.org/obo | ||
MONARCH = https://archive.monarchinitiative.org/latest/rdf | ||
|
||
|
||
OBO_SOURCES = mondo.owl \ | ||
hp.owl \ | ||
chebi.owl | ||
|
||
MONARCH_SOURCES = reactome.ttl | ||
|
||
ALL_SOURCES = $(OBO_SOURCES) $(MONARCH_SOURCES) | ||
CSVS = $(ALL_SOURCES:=.csv) | ||
|
||
build/: | ||
mkdir -p build | ||
|
||
build/robot.jar: | build/ | ||
curl -L -o build/robot.jar \ | ||
https://build.berkeleybop.org/job/robot/lastSuccessfulBuild/artifact/bin/robot.jar | ||
|
||
ROBOT := java -jar build/robot.jar | ||
|
||
sources/: | ||
mkdir --parents $@ | ||
|
||
$(OBO_SOURCES): | sources/ | ||
cd sources && $(WGET) $(OBO)/$@ | ||
|
||
$(MONARCH_SOURCES): | sources/ | ||
cd sources && $(WGET) $(MONARCH)/$@ | ||
|
||
$(CSVS): $(ALL_SOURCES) build/robot.jar | ||
$(ROBOT) \ | ||
filter --input sources/$(patsubst %.csv,%,$@) --axioms annotation \ | ||
query -f csv --query ./sparql/synonyms.sparql $@ | ||
|
||
all-synonyms.csv: $(CSVS) | ||
cat *.csv | sort -u >all-synonyms.csv | ||
|
||
|
||
all: $(ALL_SOURCES) build/robot.jar $(CSVS) all-synonyms.csv | ||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Generates a tsv of synonyms using [robot](http://robot.obolibrary.org/) | ||
with the fields iri, synonym type, synonym | ||
|
||
To run: | ||
|
||
make all | ||
|
||
To add ontologies or rdf sources adjust the ALL_SOURCES variable | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
prefix owl: <http://www.w3.org/2002/07/owl#> | ||
prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
|
||
SELECT ?cls ?pred ?val | ||
WHERE | ||
{ ?cls ?pred ?val ; | ||
a owl:Class . | ||
FILTER ( | ||
?pred = oboInOwl:hasRelatedSynonym || | ||
?pred = oboInOwl:hasNarrowSynonym || | ||
?pred = oboInOwl:hasBroadSynonym || | ||
?pred = oboInOwl:hasExactSynonym | ||
) | ||
} |