David, the actual UI rendering is done not by Java but by XSLT stylesheets that render RDF/XML: https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/bootstrap/2.3.2/layout.xsl
The stylesheet is invoked by the ModelXSLTWriter provider I mentioned earlier. On Tue, Mar 20, 2018 at 12:22 PM, David Moss <admo...@gmail.com> wrote: > > > On 19/3/18, 9:40 pm, "Martynas Jusevičius" <marty...@atomgraph.com> > wrote: > > David, > > >I gave you links but I take you haven't looked. The Web-Client project > > specifically renders RDF as HTML. The crucial class is this: > > https://github.com/AtomGraph/Web-Client/blob/master/src/ > main/java/com/atomgraph/client/writer/ModelXSLTWriter.java > > Actually, I have looked. The code you mentioned is over 400 lines long and > I can't see a UI component in it. > I have to admire your self-documenting coding style, but it is not the > easy to follow example I was looking for. > > > If you are looking to write generic software, you definitely want to > render > >Model and not ResultSet. With ResultSet you only get a plain old table, > > with all the graph relationships stripped away. > > I've suspected as much. By iterating over ResultSet I may as well use a > relational database instead of a semantic model. > It is frustrating! I know intuitively using a semantic model is richer but > without examples I'm reinventing a wheel that took teams of smarter people > than me years to invent the first time. > > >It also helps to think about the UI as a function of the data. HTML > webpage > >is just one more transformation applied to the Linked Data RDF > description. > > Again, easy to say. Probably easy for YOU to do. Bet where are the easy to > follow example code in small enough bites for the beginner to follow? > > I'm pretty much resigned to there not being any. I will try to write some. > > DM > > > > On Mon, Mar 19, 2018 at 12:33 PM, David Moss <admo...@gmail.com> > wrote: > > > > > > > On 19/3/18, 5:39 pm, "Lorenz Buehmann" <buehm...@informatik.uni- > > leipzig.de> wrote: > > > > >Well, isn't that the task of the UI logic? You get JSON-LD and > now you > > >can visualize it. I don't really see the problem here? > > > > Therein lies the problem. I'm sure _you_ know how to do it. > > How does someone without experience in integrating Jena with UI know > how > > to do it? > > > > >dataset -> query -> data -> visualization (table, graph, etc.) > > > > Those are indeed a set of steps. Do you have an example of how to do > that > > in java code and load the result into a combobox for selection in a > UI? > > > > >Why should this be an example on the Apache Jena documentation? > > > > It shouldn't. It should be stored separately from the Apache Jena > > documentation. > > The Javadoc is for how Jena works internally and how to maintain Jena > > itself. > > I'm talking about examples to help people use Jena in the kind of > > applications people want to use. > > > > One of the dilemmas I have regarding Jena is how to store query > results > > locally. > > I could use Jena to query an endpoint, iterate through the ResultSet > and > > build POJOs or Tables. > > Or is it better to keep the results in a Model and query that again > to > > build UI components? > > Or maybe I should ditch the fancy Jena objects and just get a result > as a > > JSON object and work with that? > > > > These are all possibilities, but how is it actually being done in > real > > projects? Where are the examples? > > > > A reply like "dataset -> query -> data -> visualization (table, > graph, > > etc.)" is very glib, but it doesn't actually have anything in the > way of > > example code that can be used by people new to Jena in their own > real-world > > programs. That is what I see as missing. > > > > > > DM > > > > > > > > > > > > > > > > > > > > > > > > > > On 19.03.2018 08:31, David Moss wrote: > > > That is certainly a way to get data from a SPARQL endpoint to > > display in a terminal window. > > > It does not store it locally or put it into a user-friendly GUI > > control however. > > > Looks like I might have to roll my own and face the music > publicly > > if I'm doing it wrong. > > > > > > I think real-world examples of how to use Jena in a user > friendly > > program are essential to advancing the semantic web. > > > Thanks for considering my question. > > > > > > DM > > > > > > On 19/3/18, 4:19 pm, "Laura Morales" <laure...@mail.com> > wrote: > > > > > > As far as I know the only way to query a Jena remotely is > via > > HTTP. So, install Fuseki and then send a traditional HTTP GET/POST > request > > to it with two parameters, "query" and "format". For example > > > > > > $ curl --data "format=json&query=..." > http://your-endpoint.org > > > > > > > > > > > > Sent: Sunday, March 18, 2018 at 11:26 PM > > > From: "David Moss" <admo...@gmail.com> > > > To: users@jena.apache.org > > > Subject: Re: Example code > > > > > > On 18/3/18, 6:24 pm, "Laura Morales" <laure...@mail.com> > wrote: > > > > > > >> For example, when using data from a SPARQL endpoint, > what is > > the accepted > > > >> way to retrieve it, store it locally and make it > available > > through user > > > >> interface controls? > > > > > > >Make a query that returns a jsonld document. > > > > > > How? Do you have some example code showing how this query > is > > retrieved, dealt with locally and made available to an end user > through a > > GUI control? > > > What I am looking for here is a bridge between what experts > > glean from reading Javadoc and what ordinary people need to use Jena > within > > a GUI based application. > > > > > > I see this kind of example as the missing link that > prevents > > anyone other than expert using Jena. > > > So long as easy to follow examples of how to get from an > rdf > > triplestore to information displayed on a screen in a standard GUI > way are > > missing, Jena will remain a plaything for expert enthusiasts. > > > > > > DM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >