Search code examples
owlontologyprotege

Relation IDs mismatch - Mapping OWL to Oracle DB with Ontop


As a Part of my little App I try to map Data between my Ontology and an Oracle DB with ontop. But my first mapping is not accepted by the reasoner and it's not clear why.

As my first attempt I use the following target:

:KIS/P_PVPAT_PATIENT/{PPVPAT_PATNR} a :Patient .   

and the following source:

select * from P_PVPAT_PATIENT

Here KIS is the schema, p_pvpat_patient the table and ppvpat_patnr the key.

Caused by: it.unibz.inf.ontop.exception.InvalidMappingSourceQueriesException:  
Error: Relation IDs mismatch: P_PVPAT_PATIENT v "KIS"."P_PVPAT_PATIENT" P_PVPAT_PATIENT 
Problem location: source query of triplesMap 
[id: MAP_PATIENT
target atoms: triple(s,p,o) with  
s/RDF(http://www.semanticweb.org/grossmann/ontologies/kis-ontology#KIS/P_PVPAT_PATIENT/{}(TmpToVARCHAR2(PPVPAT_PATNR)),IRI), p/<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>, o/<http://www.semanticweb.org/grossmann/ontologies/kis-ontology#Patient>
source query: select * from P_PVPAT_PATIENT]


Solution

  • As the error said my source query was wrong because I forgot to use the schema in my sql.

    the correct sql is

    select * from kis.P_PVPAT_PATIENT