Hi Jason,
Hi, I'm trying to figure out a way to insert triples into Virtuoso and
then query using SPARQL. I'd like to do this programmatically from
another application (a C# Windows app to be exact).
The only documentation I can seem to find on how to do this is
http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtRDFInsert#%20SPARQL%20Insert%20via%20HTTP%20Post%20using%20Content-Type:%20application/sparql-query%20and%20ODS%20wiki,
and there doesn't seem to be any examples of doing this directly via
an API call. The examples all show uploading RDF into a WebDAV
repository, which is not what I want to do. I simply want to use the
RDF store to hold RDF so I can query it via SPARQL.
I would also prefer to do this via an API if that's possible as it
seems a bit silly to construct an HTTP call just to put this
information into the triple store, especially since the app feeding
the RDF into Virtuoso will be running on the same server.
I thought that perhaps the ADO.NET <http://ADO.NET> client would
provide a way to do this, but it seems to be geared more towards using
Virtuoso to query external databases.
Any pointers here? I figured that there would be all kinds of
information on how to get RDF into Virtuoso quickly and easily, but so
far no dice.
I don't know if you can using ADO.NET, but there are a couple of things
you can do. First, is there an odbc or jodbc API in .NET? If so, you can
use it to send any kind of queries to the virtuoso instance. Otherwise,
you can always query the HTTP endpoint directly using the localhost.
This really depends on the setting I think; but possibly that OL folks
have other options.
Once you can send your queries to the instance, then you have two
choices (basically):
(1) Using the SPARUL (http://jena.hpl.hp.com/~afs/SPARQL-Update.html)
syntax to CRUD your RDF data in the store
(2) Using the intrnal Virtuoso API calls that handle this stuff:
DB.DBA.RDF_LOAD_RDFXML_MT and DB.DBA.TTLP_MT (you have access to the MT
and non MT versions of these functions (MT == multi-threads)).
Also there is all the webdav stuff you refered too, etc. All methods are
defined here:
http://docs.openlinksw.com/virtuoso/rdfinsertmethods.html
Hope this helps; in any case, you have to find a channel (odbc, http,
etc) to connect your instance software to the data store instance.
Take care,
Fred