Virtuoso Dump graph

488 views Asked by At

Hello I have a probably simple problem but I am not able to find it anywhere in docs.

I use this code in Virtuoso Interactive SQL:

SPARQL clear graph <http://product-open-data.org/temp>;
SPARQL clear graph <http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01>;
DB.DBA.TTLP ('
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix s: <http://schema.org/> .
@prefix pod: <http://linked.opendata.cz/ontology/product-open-data.org#>
<#TriplesMapBrand>
a rr:TriplesMap;    
rr:logicalTable [
      rr:tableSchema "POD"; 
      rr:tableOwner  "DBA"; 
      rr:tableName   "BRAND" 
];
    rr:subjectMap 
    [ 
      rr:template "http://linked.opendata.cz/resource/brand/{BSIN}";
      rr:class gr:Brand;
      rr:graph <http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01>
    ];
   rr:predicateObjectMap [
        rr:predicateMap [rr:constant pod:bsin];
        rr:objectMap [rr:termType rr:Literal; rr:column "BSIN" ];
];
 rr:predicateObjectMap [
        rr:predicateMap [rr:constant gr:name];
        rr:objectMap [rr:termType rr:Literal; rr:column "BRAND_NM" ];
];
 rr:predicateObjectMap [
        rr:predicateMap [rr:constant s:url]; 
        rr:objectMap [rr:termType rr:IRI; rr:template "{BRAND_LINK}";];

];.
', 'http://product-open-data.org/temp', 'http://product-open-data.org/temp', 0);

exec ('sparql ' || DB.DBA.R2RML_MAKE_QM_FROM_G ('http://product-open-data.org/temp','http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01'));


SPARQL Select * from <http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01>
where {?s ?o ?p.} limit 1000000;

My problem is following: I want to get a TTL file with dump_one_graph procedure. But when I run the procedure like this in iSQL:

SQL> DB.DBA.dump_one_graph('http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01','../R2RML/pod_',1000000000);

the only thing I get is:

Dump of graph http://linked.opendata.cz/resource/dataset/product-open-data.org/2014-01-01, as of 2014-11-11 23:46:48.000004

So my question is: where are my triples stored and why is SPARQL SELECT returning a result set while dump_one_graph doesn't?

1

There are 1 answers

0
chile On

R2RML gets mapped to Virtuoso RDFViews which are not persisted to the Quad Store by default. There is an option to make these material or persisted to the Quad Store. Have a look at: r2rml. There should by an option 'Enable Data Syncs with Physical Quad Store' which should do the trick. Also have a look at the Generate RDB2RDF triggers option. I don't know exactly how this will look with turtle-syntax, but you can inspect the resulting commands by using the 'Prepare to Execute Button. Hope this helps...