mapping from get_triples to IRIs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mapping from get_triples to IRIs

Mark L.
When I call onto.get_triples() I see all asserted statements in some coded format (storid's?) like so:

[(303, 6, 80),
 (304, 6, 15),
 (305, 6, 15)]

With onto.graph.dump() I can see how these ids map to IRIs (assuming the order is maintained):

<http://webprotege.stanford.edu/project/9bL9HkeW3Flcuo8Q7VyVjf> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .
<http://webprotege.stanford.edu/R14U7ZaRrGMsX2y7Y7ch70> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> .
<http://webprotege.stanford.edu/RCBxNYrhsFVYEF3EWmL664C> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> .

I would like to be able to easily map from ids as they are represented in get_triples() to full IRIs. There must be a dictionary somewhere tying them together? Or maybe this is happening at the SQLite level?  
Reply | Threaded
Open this post in threaded view
|

Re: mapping from get_triples to IRIs

Jiba
Administrator
Hi,

These number are storid (store ID). The correspondance is stored in the SQLite database, and possibly cached (depending on the number of storid).

You can use default_world._unabbreviate(storid) to get the corresponding IRI, and default_world._abbreviate(iri) for the reverse operation.

Jiba