I am continuing to evaluate the RDF View mapping capabilities of Virtuoso.
 The whitepaper on the subject is useful, but I'm still having issues
manually generating a mapping (needed in our case, as we want to match a
specific vocabulary).

Given a sample table:

create table "testrdfview"."DBA"."vehicle"
(
  "id" INTEGER,
  "manufacturer_id" INTEGER,
  "vehicleName" VARCHAR(255),
  PRIMARY KEY ("id")
);


with data:

insert into "testrdfview"."DBA"."vehicle" (id, manufacturer_id,
vehicleName) values (1,1,'S2000');

insert into "testrdfview"."DBA"."vehicle" (id, manufacturer_id,
vehicleName) values (1,1,'Accord');


And the following mappings:

sparql

prefix testrdfview: <http://www.nowhere.com/testrdfview/#>

create iri class testrdfview:vehicle
"http://^{URIQADefaultHost}^/testrdfview/vehicle/id/%d#this"; (in _id
integer not null) . ;

sparql

prefix testrdfview: <http://www.nowhere.com/testrdfview/#>
create quad storage testrdfview:graph
  from "testrdfview"."DBA"."vehicle" as vehicle_tbl
  {
    create testrdfview:qm-vehicle as graph
iri("http://^{URIQADefaultHost}^/testrdfview#";)
    {
        testrdfview:vehicle (vehicle_tbl."id") a testrdfview:vehicle ;
        testrdfview:vehicle_name vehicle_tbl.vehicleName as
testrdfview:dba-vehicle-name .
    }
  }
;


However, running a query against the expected graph
(http://localhost:8890/testrdfview#) with this sparql returns no
results:

select * { ?s ?p ?o }


A select statement on the underlying database via SQL does return
results.  Am I overlooking something obvious in the design of this
mapping?


Thanks,

Jess

Reply via email to