Hello Jesse,
On Thu, 2010-03-25 at 16:30 -0400, Jesse Sightler wrote:
> 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 }
You've created an RDF View in a new storage, namely testrdfview:graph,
but query the default one, virtrdf:DefaultQuadStorage.
If I try the proper storage, I get
sparql define input:storage <http://www.nowhere.com/testrdfview/#graph>
select * where { graph ?g { ?s ?p ?o }};
g
s
p o
VARCHAR
VARCHAR
VARCHAR VARCHAR
_______________________________________________________________________________
http://localhost.localdomain:8550/testrdfview#
http://localhost.localdomain:8550/testrdfview/vehicle/id/1#this
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://www.nowhere.com/testrdfview/#vehicle
http://localhost.localdomain:8550/testrdfview#
http://localhost.localdomain:8550/testrdfview/vehicle/id/1#this
http://www.nowhere.com/testrdfview/#vehicle_name
Accord
as expected.
If you do not want to specify a storage in the query, "alter quad
storage virtrdf:DefaultQuadStorage", not create a new one.
Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com