Re: Example code

2018-03-20 Thread John A. Fereira
When developing a UI with a SQL database, if the developer is using an MVC 
pattern, they’re not sending SQL statements to the server and iterating over 
the result set.  Instead, they’re making a request to the server such as 
“getPersonList” and the business logic on the server side is constructing the 
query to the database,  maps the result set to a list of objects (which might 
be in JSON) , and returning those objects to the UI for display.  That really 
isn’t any different when an application has a triple store on the back end 
except that the business logic is running SPARQL (or accessing the data model 
directly) instead of SQL.

With that in mind,  there is a robust example page here 
(http://jena.apache.org/tutorials/rdf_api.html) which provides examples for how 
to read  or write RDF (and much more).  When reading RDF, instead of writing 
the results to standard out, transforming them to objects, then sending them to 
a UI is no different from how one might do it with  a SQL database on the back 
end. 



On 3/20/18, 7:11 AM, "David Moss" <admo...@gmail.com> wrote:



On 19/3/18, 9:59 pm, "Laura Morales" <laure...@mail.com> wrote:

>TBH I think you're writing to the wrong mailing list. You should write 
to the  mailing list, and ask them to provide example 
code to use the UI with a Fuseki>backend instead of MySQL.

The UI people would, quite rightly, point to any number of examples of 
people using SQL or other custom means of getting information into their 
components.
Then they would tell me to go to the mailing list for the exotic framework 
I'm interested on promoting and ask the users to contribute some example code.

Which is what I have done.
The answer seems to be that there isn't any. I can live with that. If I 
find the time I'll write some.
Then the people in this group can laugh at my efforts and write better 
examples!

DM

Sent: Monday, March 19, 2018 at 12:33 PM
From: "David Moss" <admo...@gmail.com>
    To: users@jena.apache.org
Subject: Re: Example code

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 quer

Re: Example code

2018-03-20 Thread Martynas Jusevičius
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 s

Re: Example code

2018-03-20 Thread David Moss


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=..." http://y

Re: Example code

2018-03-20 Thread David Moss


On 19/3/18, 9:59 pm, "Laura Morales" <laure...@mail.com> wrote:

>TBH I think you're writing to the wrong mailing list. You should write to 
the  mailing list, and ask them to provide example 
code to use the UI with a Fuseki>backend instead of MySQL.

The UI people would, quite rightly, point to any number of examples of people 
using SQL or other custom means of getting information into their components.
Then they would tell me to go to the mailing list for the exotic framework I'm 
interested on promoting and ask the users to contribute some example code.

Which is what I have done.
The answer seems to be that there isn't any. I can live with that. If I find 
the time I'll write some.
Then the people in this group can laugh at my efforts and write better examples!

DM

Sent: Monday, March 19, 2018 at 12:33 PM
From: "David Moss" <admo...@gmail.com>
To: users@jena.apache.org
Subject: Re: Example code

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=..." 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
>
>
>
>
>
>
>
>
>
>
>
>
>



 





Re: Example code

2018-03-19 Thread Paul Tyson
On Mon, 2018-03-19 at 20:01 +1000, David Moss wrote:
> I agree, the technical documentation is not the place to keep basic how-to 
> examples. But with Jena the basic how-to examples seem to be missing entirely.
> I have written GUI applications using the available examples from MYSQL. 
> MYSQL does have this kind of thing if you look. Jena does not.
> 
> Try typing " mysql java gui tutorial" into Google and see what pops up.
> Then try " Jena java gui tutorial" and contrast the results.
> 
Everyone's been on the low end of the learning curve with the RDF
technology stack, but I would advise to set aside the idea that your RDF
solution architecture should look anything like an SQL-based solution.
The RDF stack is web-ready, which means that what you are trying to do
is probably easier than you expect it to be.

If you described your goals, requirements, and constraints in more
detail, maybe we could be of more assistance.

Regards,
--Paul




Re: Example code

2018-03-19 Thread Claude Warren
This may not be a Fuseki/Jena problem directly but it is one I have had to
deal with before.  Being a backend architect/developer I try to stay away
from the UI as much as possible.  However, there comes a time when someone
some where says "So how do I get the data out".  Right now on my €job I
have that question posed and I have an architect who wants to create a
bunch of REST service calls that do nothing but run standard parametrized
queries against Fuseki and present the results to the UI developers.  I
don't think this is the best solution.

I think this is a valid question, and I think it is a tough one to solve.

The shortest answer is probably to look at the Fuseki web app code and see
how it is done  there.

The longer answer is that front end developers will have to understand how
RDF works and some standard vocabularies.

For example: if a UI developer wants to get all the properties of a cow <
http://example.com/Cow> s/he needs to know to query with either:

Select distinct ?property WHERE
?a rdf:type  <http://example.com/Cow>
?a ?property ?value .

or:

Select distinct ?property WHERE
?property rdfs:domain <http://example.com/Cow>.

depending on what the UI requirements are.

Next the JSON-LD format, while it is a valid json format, is not what most
UI developers have seen.  A bit of help explaining how to understand what
JSON-LD is saying would go a long way.

Now with all that being said, not all of it belongs in Jena documentation.
But then most of the RDF documentation sites I have seen are not well
maintained, so there is no place to go for good samples.

So, valid and important question, but I fear I don't have much in the way
of an answer as of yet.  I will be discussing this at work and will try to
post information as I develop it.

Claude

On Mon, Mar 19, 2018 at 11:59 AM, Laura Morales <laure...@mail.com> wrote:

> TBH I think you're writing to the wrong mailing list. You should write to
> the  mailing list, and ask them to provide
> example code to use the UI with a Fuseki backend instead of MySQL.
>
>
>
>
> Sent: Monday, March 19, 2018 at 12:33 PM
> From: "David Moss" <admo...@gmail.com>
> To: users@jena.apache.org
> Subject: Re: Example code
>
> 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 remotel

Re: Example code

2018-03-19 Thread Laura Morales
TBH I think you're writing to the wrong mailing list. You should write to the 
 mailing list, and ask them to provide example code 
to use the UI with a Fuseki backend instead of MySQL.

 
 

Sent: Monday, March 19, 2018 at 12:33 PM
From: "David Moss" <admo...@gmail.com>
To: users@jena.apache.org
Subject: Re: Example code

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=..." 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
>
>
>
>
>
>
>
>
>
>
>
>
>



 


Re: Example code

2018-03-19 Thread Martynas Jusevičius
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

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.

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.

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=..." 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
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
>


Re: Example code

2018-03-19 Thread David Moss


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=..." 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
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
>
>
>






Re: Example code

2018-03-19 Thread David Moss
I agree, the technical documentation is not the place to keep basic how-to 
examples. But with Jena the basic how-to examples seem to be missing entirely.
I have written GUI applications using the available examples from MYSQL. MYSQL 
does have this kind of thing if you look. Jena does not.

Try typing " mysql java gui tutorial" into Google and see what pops up.
Then try " Jena java gui tutorial" and contrast the results.

The MySQL fans have done the groundwork to attract beginning programmers to 
their ecosystem. I think it is time the Jena fans did something similar.

DM


On 19/3/18, 6:56 pm, "Kevin Dreßler"  wrote:

> 
> On 19. Mar 2018, at 08:31, David Moss  wrote:
> 
> [...]
>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.

By that argumentation MySQL will also forever remain a plaything for expert 
enthusiasts, as I couldn't find any example in their documentation about how 
you set up GUI controls with values obtained from MySQL.
What you are after is probably a kind of end-to-end tutorial to a certain 
tech stack and I agree that there are probably far less of those for linked 
data tech stacks than for more traditional ways of doing things. But the Apache 
Jena documentation is certainly not the right place for such content just as 
you won't find complete AMP stack tutorials in the MySQL documentation.




Re: Example code

2018-03-19 Thread Daan Reid
I'm not sure whether you're after is something that corresponds 
one-to-one between RDF triples and what the user sees, or something more 
functional, but if you want to see an example of using Jena as data 
store for an application, it might be interesting to look at our system 
ADDIS:

https://addis.drugis.org/

We use an RDF data store to persist clinical trials study data in a 
structured manner, then retrieve it with SPARQL and render it in 
angularJS. Code is here:

https://github.com/drugis/addis-core

Resultset to Java:
https://github.com/drugis/addis-core/blob/master/src/main/java/org/drugis/addis/trialverse/service/impl/QueryResultMappingServiceImpl.java

Jena graph to and from usable frontend data objects in JS:
https://github.com/drugis/addis-core/blob/master/src/main/webapp/resources/app/js/outcome/outcomeService.js

Note that the system is somewhat large by now so extracting simple 
examples isn't easy.


Regards,

Daan Reid
http://drugis.org

On 19-03-18 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=..." 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
 
 
 
 
 
 
 
 
  
 





Re: Example code

2018-03-19 Thread Kevin Dreßler
> 
> On 19. Mar 2018, at 08:31, David Moss  wrote:
> 
> [...]
>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.

By that argumentation MySQL will also forever remain a plaything for expert 
enthusiasts, as I couldn't find any example in their documentation about how 
you set up GUI controls with values obtained from MySQL.
What you are after is probably a kind of end-to-end tutorial to a certain tech 
stack and I agree that there are probably far less of those for linked data 
tech stacks than for more traditional ways of doing things. But the Apache Jena 
documentation is certainly not the right place for such content just as you 
won't find complete AMP stack tutorials in the MySQL documentation.

Re: Example code

2018-03-19 Thread Laura Morales
Sorry, but I don't understand your problem. Jena/Fuseki is a server, what 
you're trying to do seems to me very clearly a client-side thing. Why would the 
server store any user UI? If you're using a javascript framework, you simply 
send a GET request, get JSON in return, and bind these values to the framework 
(on the client side). Similar to any other UI program. The point of a database 
is to retrieve data, not to format it nicely for your UI. Just out of 
curiosity, how do you use traditional RDBMes? Do you expect them to format HTML 
templates for you?

On the other hand, if what you meant is simply to improve the documentation 
with some demo apps, then I agree that it could be useful to see how others are 
using Jena/Fuseki in their projects.
 
 

Sent: Monday, March 19, 2018 at 8:31 AM
From: "David Moss" <admo...@gmail.com>
To: users@jena.apache.org
Subject: Re: Example code
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.


Re: Example code

2018-03-19 Thread Lorenz Buehmann
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?

dataset -> query -> data -> visualization (table, graph, etc.)

Why should this be an example on the Apache Jena documentation?


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=..." 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
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
>
>
>



Re: Example code

2018-03-19 Thread David Moss
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=..." 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








 





Re: Example code

2018-03-19 Thread Laura Morales
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=..." 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








 


Re: Example code

2018-03-18 Thread David Moss


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











Re: Example code

2018-03-18 Thread Martynas Jusevičius
You can take a look here, these projects use Jena extensively:
https://github.com/AtomGraph/Core
https://github.com/AtomGraph/Processor
https://github.com/AtomGraph/Web-Client

On Sun, Mar 18, 2018 at 4:19 AM, David Moss <admo...@gmail.com> wrote:

> Nearly all the example code on the web for Jena is restatement of Javadoc.
> This is better than nothing, but what seems to be missing is examples of
> how Jena is used in real-world applications.
> I believe publishing practical examples would dramatically increase the
> use of Jena and semantic processing in general.
>
> Without a pool of practical examples people using Jena are working in
> isolation.
> There are so many ways of achieving results, but which are the ways people
> are actually using in real applications?
>
> 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?
> As far as I can tell there are no examples of how to do this anywhere.
>
> ie How would you go about populating a dropdown list in a UI with data
> from a SPARQL endpoint?
>
> Am I missing something (I hope so!)
> If not, does anyone want to contribute some examples of using Jena in
> real-world applications?
>
> If it turns out there are no such examples out there and no-one wants to
> contribute examples, I will write some myself. But they will be awful!
> I’d much rather people with experience provided this much needed
> information. I’m happy to collate and publish.
>
> DM
>
>
>
>
>
>
>
>


Re: Example code

2018-03-18 Thread Laura Morales
> 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.


Example code

2018-03-17 Thread David Moss
Nearly all the example code on the web for Jena is restatement of Javadoc.
This is better than nothing, but what seems to be missing is examples of how 
Jena is used in real-world applications.
I believe publishing practical examples would dramatically increase the use of 
Jena and semantic processing in general.

Without a pool of practical examples people using Jena are working in isolation.
There are so many ways of achieving results, but which are the ways people are 
actually using in real applications?

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?
As far as I can tell there are no examples of how to do this anywhere.

ie How would you go about populating a dropdown list in a UI with data from a 
SPARQL endpoint?

Am I missing something (I hope so!)
If not, does anyone want to contribute some examples of using Jena in 
real-world applications?

If it turns out there are no such examples out there and no-one wants to 
contribute examples, I will write some myself. But they will be awful!
I’d much rather people with experience provided this much needed information. 
I’m happy to collate and publish.

DM