|
Hello, I have a trouble with right construction of SPARQl query to D2RQ mapping-file. I have a table in my db schema: CREATE TABLE fact ( id integer NOT NULL, argument1 character varying, relation character varying, argument2 character varying, confidence double precision, CONSTRAINT facts_pkey PRIMARY KEY (id) ) And there is only one row: insert into fact values(1,'conributor','town','Berlin',0.67,4) And I've generated a mapping between my schema and RDF model via mapping_generation command in D2RQ and get the following .ttl file: @prefix map: <#> . @prefix db: <> . @prefix vocab: <vocab/> . @prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > . @prefix rdfs: < http://www.w3.org/2000/01/rdf-schema# > . @prefix xsd: < http://www.w3.org/2001/XMLSchema# > . @prefix d2rq: < http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1# > . @prefix jdbc: < http://d2rq.org/terms/jdbc/ > . map:database a d2rq:Database;
map:fact a d2rq:ClassMap;
map:fact__label a d2rq:PropertyBridge;
map:fact_id a d2rq:PropertyBridge;
map:fact_argument1 a d2rq:PropertyBridge;
map:fact_relation a d2rq:PropertyBridge;
map:fact_argument2 a d2rq:PropertyBridge;
map:fact_confidence a d2rq:PropertyBridge;
My problem is that I don't know how to correctly write sparql query to this model. How shoud sparql query look like for the following request: get relation1 where relation2 = 'Berlin' Query, that I constructed, returns empty result: PREFIX vocab: <vocab/> |


I guess I found the reason. I don't know why but it doesn,t return bindings for variables with postgreSQL type character varying. Any ideas why and how can it be corrected?
The second problem is that Jena doesn't what to return answer for any query over d2rq model. But if I run the same query from command line using d2r-query command, it returns correct answer (but again only if it doesn't have character varying type). How can I deal with it?