Comments (7)
I guess I was missing a piece.. It needs to be a SQL db, cant be an arbitrary obo/owl file.. Now looking for how to convert first.
This also wont work:
resource = OntologyResource(slug='sqlite:mondo.db', local=False)
How do I convert a local obo file into a db file? Assuming that is what the issue is I mean.
from ontology-access-kit.
from ontology-access-kit.
Cant get it to work, like this?
resource = OntologyResource(slug='mondo.owl', local=True)
oi = SqlImplementation(resource)
from ontology-access-kit.
I believe that should work
from ontology-access-kit.
from oaklib.resource import OntologyResource
from oaklib.implementations.sqldb.sql_implementation import SqlImplementation
import os
print(os.path.exists('mondo.owl'))
resource = OntologyResource(slug='mondo.owl', local=True)
oi = SqlImplementation(resource)
Results in
True
---------------------------------------------------------------------------
ArgumentError Traceback (most recent call last)
<ipython-input-26-3f3e82a428e8> in <module>
1 print(os.path.exists('mondo.owl'))
2 resource = OntologyResource(slug='mondo.owl', local=True)
----> 3 oi = SqlImplementation(resource)
~/opt/anaconda3/lib/python3.8/site-packages/oaklib/implementations/sqldb/sql_implementation.py in __init__(self, resource, strict, engine, _session, _connection, **_kwargs)
~/opt/anaconda3/lib/python3.8/site-packages/oaklib/implementations/sqldb/sql_implementation.py in __post_init__(self)
40 def __post_init__(self):
41 if self.engine is None:
---> 42 self.engine = create_engine(self.resource.slug) ## TODO
43
44
<string> in create_engine(url, **kwargs)
~/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py in warned(fn, *args, **kwargs)
307 stacklevel=3,
308 )
--> 309 return fn(*args, **kwargs)
310
311 doc = fn.__doc__ is not None and fn.__doc__ or ""
~/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/create.py in create_engine(url, **kwargs)
528
529 # create url.URL object
--> 530 u = _url.make_url(url)
531
532 u, plugins, kwargs = u._instantiate_plugins(kwargs)
~/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/url.py in make_url(name_or_url)
729
730 if isinstance(name_or_url, util.string_types):
--> 731 return _parse_rfc1738_args(name_or_url)
732 else:
733 return name_or_url
~/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/url.py in _parse_rfc1738_args(name)
790
791 else:
--> 792 raise exc.ArgumentError(
793 "Could not parse rfc1738 URL from string '%s'" % name
794 )
ArgumentError: Could not parse rfc1738 URL from string 'mondo.owl'
from ontology-access-kit.
try with the latest version from 2 days ago
from your stacktrace that seems to be a (quite) old version?
this is what post_init looks like now:
this is my output:
➜ mondo-build git:(minor-edits) ✗ /Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/bin/python t.py
True
cat /Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/semsql/builder//sql_schema/semsql.sql | sqlite3 .template.db.tmp && \
echo .exit | sqlite3 -echo .template.db.tmp -cmd ".mode csv" -cmd ".import /Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/semsql/builder//prefixes/prefixes.csv prefix" && \
mv .template.db.tmp .template.db
.exit
robot remove -i mondo.owl --axioms "equivalent disjoint annotation" -o mondo-min.owl
relation-graph --disable-owl-nothing true \
--ontology-file mondo-min.owl\
--output-file mondo-relation-graph.tsv.ttl.tmp \
--equivalence-as-subclass true \
--output-subclasses true \
--reflexive-subclasses true && \
riot --out RDFXML mondo-relation-graph.tsv.ttl.tmp > mondo-relation-graph.tsv.owl.tmp && \
sqlite3 mondo-relation-graph.tsv.db.tmp -cmd ".mode csv" ".import /Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/semsql/builder//prefixes/prefixes.csv prefix" && \
rdftab mondo-relation-graph.tsv.db.tmp < mondo-relation-graph.tsv.owl.tmp && \
sqlite3 mondo-relation-graph.tsv.db.tmp -cmd '.separator "\t"' -cmd '.header on' "SELECT subject,predicate,object FROM statements " > mondo-relation-graph.tsv.tmp && \
mv mondo-relation-graph.tsv.tmp mondo-relation-graph.tsv && \
rm mondo-relation-graph.tsv.*.tmp
2022.06.02 14:22:35:933 zio-default-async-1 INFO org.renci.relationgraph.Main.program:57
Running reasoner
2022.06.02 14:22:48:433 zio-default-async-1 INFO org.renci.relationgraph.Main.program:60
Done running reasoner
2022.06.02 14:23:42:579 zio-default-async-16 INFO org.renci.relationgraph.Main.program:70
Computed relations in 54.116s
cp .template.db mondo.db.tmp && \
rdftab mondo.db.tmp < mondo.owl && \
sqlite3 mondo.db.tmp -cmd '.separator "\t"' ".import mondo-relation-graph.tsv entailed_edge" && \
gzip -f mondo-relation-graph.tsv && \
cat /Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/semsql/builder//indexes/*.sql | sqlite3 mondo.db.tmp && \
mv mondo.db.tmp mondo.db
rm mondo-min.owl
from ontology-access-kit.
I had some other issues here, but I moved them to #294 , as I think they are unrelated to this issue.
from ontology-access-kit.
Related Issues (20)
- Optimization: `SqlImplementation.relationships_metadata()`
- problem with updating Wikidata import HOT 4
- `AttributeError` in `TranslatorImplementation` when using node normalizer endpoint HOT 1
- New sssom==0.3.42 breaks oaklib HOT 5
- Can't run tests without LinkML HOT 1
- sort the return of 'ancestors' by the chain of relations such that the nodes are arranged in order from leaf to root
- Add an option to have a default count of 1 for all terms when calculating IC
- Bug?: `.relationships()` filtering predicates even if `predicates` arg absent HOT 4
- Performance: `SqlImplementation.entity_metadata_map()` HOT 3
- `relationships`: Add warning/error when invalid predicates HOT 2
- OAK Adapters vs. Invalid URI/CURIEs HOT 5
- Dumpers and loaders: Separate concept of syntax and datamodel HOT 1
- `.entities()` typedef update HOT 2
- Add ability to generate d3viz trees
- Hard coded CURIES in OAK code cause confusion when ontologies use different prefix maps HOT 3
- Extended prefix map support HOT 3
- Bug in how `vskit` handles an empty list of arguments
- adapter.entity_metadata_map("HP:0000001") with obo adapter causes `DuplicateURIPrefixes` error HOT 7
- Missing support for Python 3.12 HOT 4
- Misleading copyright statement at the bottom of OAK documentation pages HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ontology-access-kit.