2

I have to do a join from this 2 tables, on the field ID_CLIENTI. These tables, on MySQL DB, are mapped with generate-mapping on D2R Server in a turtle file.

Table CLIENTI
map:CLIENTI a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "CLIENTI/@@CLIENTI.ID_CLIENTI@@";
d2rq:class vocab:CLIENTI;
d2rq:classDefinitionLabel "CLIENTI";
. map:CLIENTI__label a d2rq:PropertyBridge; d2rq:belongsToClassMap map:CLIENTI; d2rq:property rdfs:label; d2rq:pattern "CLIENTI #@@CLIENTI.ID_CLIENTI@@"; .
map:CLIENTI_ID_CLIENTI a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:CLIENTI;
d2rq:property vocab:CLIENTI_ID_CLIENTI;
d2rq:propertyDefinitionLabel "CLIENTI ID_CLIENTI";
d2rq:column "CLIENTI.ID_CLIENTI";
d2rq:datatype xsd:integer;
.
map:CLIENTI_COGNOME a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:CLIENTI;
d2rq:property vocab:CLIENTI_COGNOME;
d2rq:propertyDefinitionLabel "CLIENTI COGNOME";
d2rq:column "CLIENTI.COGNOME";
.

Table FATTURE
map:FATTURE a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "FATTURE/@@FATTURE.ID_FATTURE@@";
d2rq:class vocab:FATTURE;
d2rq:classDefinitionLabel "FATTURE";
.
map:FATTURE__label a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:CLIENTI;
d2rq:property rdfs:label;
d2rq:pattern "FATTURE #@@FATTURE.ID_FATTURE@@";
.
map:FATTURE_ID_FATTURE a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:FATTURE;
d2rq:property vocab:FATTURE_ID_FATTURE;
d2rq:propertyDefinitionLabel "FATTURE ID_FATTURE";
d2rq:column "FATTURE.ID_FATTURE";
d2rq:datatype xsd:integer;
.
map:FATTURE_IMPORTO a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:FATTURE;
d2rq:property vocab:FATTURE_IMPORTO;
d2rq:propertyDefinitionLabel "FATTURE IMPORTO";
d2rq:column "FATTURE.IMPORTO";
d2rq:datatype xsd:double;
.

My query is:

SELECT ?cognome ?ID ?importo 
WHERE {

?cognome2 vocab:CLIENTI_COGNOME ?cognome.

?cognome2 vocab:CLIENTI_ID_CLIENTI ?ID.

?cognome2 vocab:FATTURE_ID_CLIENTI ?importo.

}

but, it returns no row found.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140

0 Answers0