1:- module(obo_util,
    2          [entity_xref_prefix/3]).    3
    4:- use_module(library(obo_metadata/oio)).    5
    6:- use_module(library(semweb/rdf11)).    7:- use_module(library(semweb/rdfs)).    8:- use_module(library(sparqlprog/ontologies/owl), []).    9:- use_module(library(sparqlprog/emulate_builtins)).   10
   11:- rdf_register_ns(oio,'http://www.geneontology.org/formats/oboInOwl#').
 entity_xref_prefix(?Cls:atm, ?X:str, ?Pre:str)
true if Cls has X as an xref, and X has prefix Pre
   16entity_xref_prefix(C,X,P) :-
   17        has_dbxref(C,X),
   18        curie_prefix(X,P).
 entity_xref_src(?Cls:atm, ?X:str, ?S:str)
true if Cls has X as an xref, and axiom annotated with S
   23entity_xref_src(C,X,S) :-
   24        entity_xref_src(C,X,_,S).
   25entity_xref_src(C,X,A,S) :-
   26        has_dbxref_axiom(C,X,A),
   27        rdf(A,oio:source,S).
   28
   29entity_xref_prefix_srcont(C,X,P,S) :-
   30        entity_xref_prefix(C,X,P),
   31        entity_xref_src(C,X,SC),
   32        curie_prefix(SC,S).
 curie_prefix(Literal:str, Pre:str)
   36curie_prefix(Literal,Pre) :-
   37        str_before(Literal,":",Pre)