Materializing Virtual Graphs via JAVA API


is there a JAVA API equivalent of “$ stardog-admin virtual import” command? I can’t find it…

It would be good if VirtualGraphAdminConnection class[1] would have a method for materializing a Virtual Graph (or CSV data).



Hi Piotr,

In general, the functionality of CLI commands is available in Java APIs. In fact, this is how we implement the CLI commands. Some CLI commands are provided purely as convenience. These tend not to be available in APIs as they only facilitate command line convenience. The virtual import command is one such command added purely for convenience. It’s implementation involves:

  • Adding the virtual graph to the registry
  • Execute the SPARQL update COPY <virtual://x> to <other_named_graph>
  • (or ADD if --remove-all switch is given)
  • Remove the virtual graph from the registry

In short, you can use the COPY statement in the same manner we do here.


1 Like

Hi Jess,

thanks for your explanation. I’ll try to do what you suggest.