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

Mapping an IRI based lookup to ODGI #2

Open
JervenBolleman opened this issue Oct 21, 2019 · 1 comment
Open

Mapping an IRI based lookup to ODGI #2

JervenBolleman opened this issue Oct 21, 2019 · 1 comment

Comments

@JervenBolleman
Copy link
Collaborator

For example in the current vg models in RDF. All nodes have a {SOMEBASE}/node/{ID} iri as identifier. These can be used as hack to identify which methods to call.

Consider the sparql query.

PREFIX node:<http://example.org/node/>
PREFIX vg:<http://biohackathon.org/resource/vg#>

SELECT 
   ?node ?sequenceLength
WHERE {
  BIND(node:25 as ?node)
  ?node a vg:Node ; 
     rdf:value ?sequence .
 BIND(strlen(?sequence) AS ?sequenceLength)

Statically analysing the query AST we should be able to determine that this requires a call to odgi.get_handle as that will give us the handle for the node id.

ASK
node:25 a vg:Node .

Can return true as we can look into the IRI string to see it is a node.

SELECT
?sequence
WHERE
{
node:25 rdf:value ?sequence .
}

Can be mapped to odgi.get_handle on which we can ask for the sequence string.

Then the engine can do a classic translation to sequence length by just calling the python method.

@JervenBolleman
Copy link
Collaborator Author

Longer term we will want an index of node IRIs and an index of path IRIs instead of assuming they are all in the same namespace.

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

1 participant