See comments in-line.
Jeffrey Brown wrote on 10/26/17 6:52 AM:
I want to rewrite Digraphs with Text[1] to use an external Datalog server,
rather than the native Haskell module for graphs that it currently uses. Jena
looks like the best open-source choice. I can run ./fuseki, visit
http://localhost:3030, upload data and manually query it. I want to do those
things over HTTP.
If you are going to http://localhost:3030 to do those things, you already are doing them over HTTP, are you not? Or
perhaps I misunderstand your question?
I have found a number of sources that describe Jena's RDF and Sparql APIs, but
nothing describing its web API.
Jena has its own particular HTTP API for administration (e.g. adding and removing datasets) but for ordinary query,
update, etc. operations it implements the W3C Recommendations in those matters, e.g. SPARQL Query, SPARQL Update, Graph
Store, etc.
My rudimentary understanding of web services is that there's some URL of the form
"http://localhost:3030//
dataset/query?magic", where an appropriate value for "magic" would produce the
results of a query. Is that correct?
More or less. See http://www.w3.org/TR/sparql11-protocol/ for specifics. Your
"magic" token is just a SPARQL Query.
How does one translate data entry (or removal) commands from Jena's RDF API to
Jena's Web RDF API? How does one translate queries from Jena's Sparql API to
Jena's Web Sparql API?
Jena's "Web Sparql API" is just the W3C recommended SPARQL Protocol (see link above). There really isn't much
translation to be done. SPARQL Query (or Update) is SPARQL Query (or Update), in Java or over HTTP. In fact, using
Jena's RDF Connection component you needn't even differentiate in your code between local and HTTP-supported datasets:
https://jena.apache.org/documentation/rdfconnection .
Last, the Jena documentation says that it contains two inference engines. Is
Datalog one of them and Sparql the other? I'm finding a lot of Jena Sparql
documentation, but no Jena Datalog documentation.
SPARQL Query is not really an inference engine, per se, although you can certainly use SPARQL queries to implement many
kinds of inference. With regard to Jena's abilities with inference, you'll want to start here:
https://jena.apache.org/documentation/inference
and particularly
https://jena.apache.org/documentation/inference/#rules
and
https://jena.apache.org/documentation/inference/#RULEbackward
Note "In fact, the rule language is essentially datalog rather than full prolog, whilst the functor syntax within rules
does allow some creation of nested data structures they are flat (not recursive) and so can be regarded a syntactic
sugar for datalog."
Hope this helps, and please come back with more questions!
---
A. Soroka
Research Computing : Office of the CIO : the Smithsonian Institution
Many thanks.
[1] Digraphs with Text
<https://github.com/JeffreyBenjaminBrown/digraphs-with-text> is a simple
app that provides a generalization of the graph (relationships of arbitrary
arity, arbitrarily nested) and a language for input and queries that is
friendly to non-programmers.