Hi all

I'm running D2R on Microsoft SQL Server. I playing around with the BSBM
data. I'm running into the two following things:

I'm running this query:

SELECT ?title ?text WHERE {
        ?review bsbm:reviewFor <
http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer30/Product1358>
.
        ?review dc:title ?title .
        ?review rev:text ?text .
}


The first issue, for those familiar to the BSBM benchmark and dataset, each
review has a language. In the query, I'm not specifying the language. This
is what I have in my mapping file (which is the exact as what is posted on
the bsbm website).

map:review_text1 a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:review;
d2rq:property rev:text;
 d2rq:column "review.text";
d2rq:lang "en";
d2rq:condition "review.language='en'";
 .
map:review_text2 a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:review;
 d2rq:property rev:text;
d2rq:column "review.text";
d2rq:lang "ja";
 d2rq:condition "review.language='ja'";
.
map:review_text3 a d2rq:PropertyBridge;
 d2rq:belongsToClassMap map:review;
d2rq:property rev:text;
d2rq:column "review.text";
 d2rq:lang "zh";
d2rq:condition "review.language='zh'";
 .
map:review_text4 a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:review;
 d2rq:property rev:text;
d2rq:column "review.text";
d2rq:lang "de";
 d2rq:condition "review.language='de'";
.
map:review_text5 a d2rq:PropertyBridge;
 d2rq:belongsToClassMap map:review;
d2rq:property rev:text;
d2rq:column "review.text";
 d2rq:lang "fr";
d2rq:condition "review.language='fr'";
 .
map:review_text6 a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:review;
 d2rq:property rev:text;
d2rq:column "review.text";
d2rq:lang "es";
 d2rq:condition "review.language='es'";
.
map:review_text7 a d2rq:PropertyBridge;
 d2rq:belongsToClassMap map:review;
d2rq:property rev:text;
d2rq:column "review.text";
 d2rq:lang "ru";
d2rq:condition "review.language='ru'";
 .
map:review_text8 a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:review;
 d2rq:property rev:text;
d2rq:column "review.text";
d2rq:lang "ko";
 d2rq:condition "review.language='ko'";

This issue is that the query is being rewritten to

 SELECT DISTINCT "T1_review"."reviewID", "T2_review"."title",
"T1_review"."publisher", "T3_review"."text" FROM "review" AS "T3_review",
"review" AS "T1_review", "product" AS "T1_product", "review" AS "T2_review"
WHERE ("T1_product"."producerID" = 30 AND "T1_product"."productID" =
"T1_review"."productID" AND "T1_product"."productID" = 1358 AND
"T1_review"."publisher" = "T2_review"."publisher" AND
"T1_review"."publisher" = "T3_review"."publisher" AND "T1_review"."reviewID"
= "T2_review"."reviewID" AND "T1_review"."reviewID" = "T3_review"."reviewID"
AND ("T3_review"."language"='zh'))

It seems like 'zh' is the default language, or something like that. What am
I doing wrong here?

The second issue, and this seems like a MSSQL specific problem is that the
previous SQL query does not run. This is the following error:

The text data type cannot be selected as DISTINCT because it is not
comparable.:

Looks like in MSSQL you can't run DISTINCT on different datatypes. Who else
has ran into this problem? How have you solved it? Does every query get
rewritten into a SELECT DISTINCT?

Thanks for your insight!

Juan Sequeda
+1-575-SEQ-UEDA
www.juansequeda.com
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to