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

Make semsql prefix maps configurable #51

Open
matentzn opened this issue Aug 29, 2022 · 4 comments
Open

Make semsql prefix maps configurable #51

matentzn opened this issue Aug 29, 2022 · 4 comments

Comments

@matentzn
Copy link
Contributor

No description provided.

@cmungall
Copy link
Collaborator

We definitely want to do this, in addition to using any shacl triple namespace declarations in the file itself

Currently this is a bit awkward as everything is coordinated via a Makefile

Our options are:

  1. add some parameterization to the Makefile, and pass this via the calling script
  2. bite the bullet and do Make everything installable via PyPI #41 now, or at least switching out the rdftab part, which will make all this easier

@cmungall
Copy link
Collaborator

If we wanted to go with (1) here is the relevant section of the Makefile:

# -- 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 && \
rdftab $@.tmp < $< && \
sqlite3 $@.tmp -cmd '.separator "\t"' ".import $*-$(RGSUFFIX).tsv entailed_edge" && \
gzip -f $*-$(RGSUFFIX).tsv && \
cat $(THIS_DIR)/indexes/*.sql | sqlite3 $@.tmp && \
mv $@.tmp $@
.PRECIOUS: %.db

You need to load the additional prefixes into the prefix table prior to calling rdftab, as rdftab takes care of contracting the URIs

But from our discussion on slack, it seems this is less of a priority as we will just merge the prefixes you need in to curated_prefixes

@cmungall
Copy link
Collaborator

but it's looking like direct loading with https://github.com/ozekik/lightrdf is easiest

@cmungall
Copy link
Collaborator

now possible with:

semsql make foo.db --prefix-csv-path /path/to/my/prefixes.csv

caveat: you must make sure ALL prefixes are in the csv, including owl, rdf, xsd, etc

the next release of oak will make this more transparent when querying owl via the sql adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants