Virtual import with parameters

I am following this approach to do a virtual import into stardog from a DB2 server virtual import | Stardog Documentation 7.5.1

I may need to run the import multiple times by passing in different parameters to the DB2 sql. Is there a way to pass in parameters via the command line?

Thanks!

Hi Raj,

This question is a bit vague. Can you give an example of what the parameter would be? You can also use a SPARQL UPDATE to load data into Stardog, eg.

INSERT {
   ?s ?p ?o
}
WHERE {
  graph <virtual://example> {
    ?s ?p ?o
    ?s :hasClassification "A"
}

I would like to loop through a set of inputs via an wrapper script and pass in the values as parameters to the DB2 query used to populate the virtual graph. Is this possible?

If your SQL query is something like SELECT a, b, c FROM thing, you can query a subset of it and insert it into Stardog using SPARQL as I showed before. Perhaps you want to filter on some values of a:

INSERT {
  ?s ?p ?o
}
WHERE {
  graph <virtual://...> {
    ?s ?p ?o
    ?s :a ?a
    FILTER(?a IN(4, 10, 202, 56789))
  }
}

Hope this helps.
Jess

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.