Hi Ken,

I am probably not the best person to answer this, but hopefully others can 
comment/correct me if I'm wrong.


>1. Can I use the Fuseki web application as the interface point for my web 
>application?


I think it depends how you are building your application. If you have portlets 
or iframes, and would like to simply embed it, it could work. If you your own 
applicatoin written in JS or Java, PHP, etc, probably you want to consume 
Fuseki services instead? So that you can customize security, RBAC, UI, etc.



> 2. How should I connect my web application to the Fuseki instance? Should I 
> use RDFConnection or ARQ? Or do I need to use a RESTful client in my web app 
> to connect to Fuseki?


Weirdly, I think I never connected to Jena via Web in Java. I used its API 
once, when ingesting some data into Impala/Hive, that needed to load 
ontologies. For that I used the Jena Model class, and the methods to create 
values/literals/etc, and add to the model (can't remember much about the code).


But I think I have used EasyRDF in PHP (SKOSMOS is a PHP application that uses 
it, for instance) that sends queries to Jena web services.


I also used rdflib which is Python, and is also able to send queries to an 
SPARQL endpoint. I think Jena has a client for SPARQL queries? If not it should 
be easy to find one.


> 3. If I want to pull the Fuseki web application out in the future, is it a 
> significant challenge to switch over to Fuseki as a service? Any design 
> choices I should make to prepare for this potential direction?


I think we were discussing something similar in the mailing list recently. I 
started working on an update of the Fuseki UI, which is shipped with Jena and 
available by default on http://localhost:3030. This updated version is being 
created with Vue.JS. It uses Axios to send HTTP requests to the Fuseki 
services. I think in the future we may have a standalone Fuseki Java web 
services module, and a separate UI-Javascript module. And maybe another module 
only with the UI for admin.

When/If we have this set up, you may be able to re-use the admin module, for 
instance, if you'd like to include it in your application only available to 
certain users.


When you visit Fuseki and choose a dataset, it should display some services for 
you. Like $datasetname/sparql, $datasetname/data, $datasetname/upload.


Jena comes with a series of command line utilities that execute SPARQL over 
HTTP (https://jena.apache.org/documentation/fuseki2/soh.html). You should be 
able to look at the code and adapt it for your application.


Hope that helps,

Bruno



On Wednesday, 17 June 2020, 9:28:02 am NZST, Kenneth Keefe 
<kjke...@illinois.edu> wrote: 





I am learning Apache Jena and looking for advice. Please correct me if I am
speaking incorrectly about these components and suggestions for additional
learning resources are VERY welcome.

I am developing a RESTful Java web application that uses Apache Jena as a
data store with custom inference rules. Basically, external applications
will send data to my application, my application will onboard the data,
have Jena do some inference with custom rules, and then provide inferred
data back to the external applications.

I've been very happy with a proof of concept that involves running Jena in
memory only, loading my ontology, adding triples through .addLiteral and
.addProperty calls on Resources. The inference is working well and I am
able to provide basic inferred data back through .listStatements calls.

The time has come to bring persistence and SPARQL into the mix. I'd like to
have a persistent triple store that my RESTful java web app can interface
with and I would also like to expose the nice Fuseki web interface for
power users and my own debugging purposes. From reading the documentation,
it seems like the way to do that is have Fuseki manage the TDB2 store and
both the Fuseki web app and my web app use a single Fuseki instance as the
single point of contact so that there is no problem with multi-threaded
access to the TDB2 store.

Here are some questions:

1. Can I use the Fuseki web application as the interface point for my web
application?

2. How should I connect my web application to the Fuseki instance? Should I
use RDFConnection or ARQ? Or do I need to use a RESTful client in my web
app to connect to Fuseki?

3. If I want to pull the Fuseki web application out in the future, is it a
significant challenge to switch over to Fuseki as a service? Any design
choices I should make to prepare for this potential direction?

Thanks in advance!

Ken

Reply via email to