You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Diptendu Dutta <du...@gmail.com> on 2020/03/08 06:36:04 UTC

Visualising Jena model saved in RDF/XML in the browser

I have used Jena to generate RDF/XML of the model:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <rdf:Description>
    <rdf:subject rdf:parseType="Resource">
      <rdfs:label>TheConsignor</rdfs:label>
    </rdf:subject>
    <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#shall%20deliver
"/>
    <rdf:object rdf:parseType="Resource">
      <rdfs:label>theConsignedUnits</rdfs:label>
    </rdf:object>
  </rdf:Description>
  <rdf:Description>
    <rdf:subject rdf:parseType="Resource">
      <rdfs:label>rulesofinterpretation</rdfs:label>
    </rdf:subject>
    <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
    <rdf:object rdf:parseType="Resource">
      <rdfs:label>thisConsignmentAgreement</rdfs:label>
    </rdf:object>
  </rdf:Description>
.
.
</rdf:RDF>

Do I need to use some other format apart from RDF/XML so that
the output my be be visualised in a browser?

I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
the data to be in some specific format.

Are there libraries available for  transforming the RDF/XML to a format
suitable for display in browser?

Which approach would you suggest?

Regards,

Diptendu Dutta

Regards,

Diptendu Dutta

Re: Visualising Jena model saved in RDF/XML in the browser

Posted by Paul Tyson <ph...@sbcglobal.net>.
Not to go too deeply into this on jena-users list, but ...

I don't doubt that RDF/XML+XSLT is a useful approach in some situations,
to meet some information presentation needs.

My experience was in Product Lifecycle Management (PLM), mainly dealing
with part master and product structure data, but extending into shop
floor (planning), configuration control, and supply chain aspects. There
are many different, useful, presentations that can be made from this
sort of dataset. Some presentations are easily supported by csv or other
record-oriented extracts from RDF dataset. Others require on-the-fly
conversion of subgraph extracts. I came to realize that both types of
presentations (for web browser delivery) could be handled by relatively
light-weight client-side conversions using d3.js. The only drawback is
that too much business- and schema-specific selection and transformation
logic had to be written in javascript. I would have preferred to use a
standard declarative language (like XSLT, only for general graphs) to
encode these rules.

I'm pretty sure my experience in PLM applies in other domains. The
abstract problem is the same: selecting things of interest from an RDF
dataset, and applying transformations to display those things with
desired presentational semantics (which includes behavioral dimensions).

Regards,
--Paul

On Mon, 2020-03-09 at 08:31 +0100, Martynas Jusevičius wrote:
> Paul,
> 
> as I've shown, XSLT is perfectly usable. Admittedly easier on a flat,
> non-nested output.
> RDF/XML is significant as a bridge format to the XML stack.
> 
> Do you have an example of "useful schema-specific information presentations"?
> 
> 
> Martynas
> 
> On Mon, Mar 9, 2020 at 3:56 AM Paul Tyson <ph...@sbcglobal.net> wrote:
> >
> > On Sun, 2020-03-08 at 12:06 +0530, Diptendu Dutta wrote:
> > > I have used Jena to generate RDF/XML of the model:
> > >
> > > <rdf:RDF
> > >     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> > >     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
> > >   <rdf:Description>
> > >     <rdf:subject rdf:parseType="Resource">
> > >       <rdfs:label>TheConsignor</rdfs:label>
> > >     </rdf:subject>
> > >     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#shall%20deliver
> > > "/>
> > >     <rdf:object rdf:parseType="Resource">
> > >       <rdfs:label>theConsignedUnits</rdfs:label>
> > >     </rdf:object>
> > >   </rdf:Description>
> > >   <rdf:Description>
> > >     <rdf:subject rdf:parseType="Resource">
> > >       <rdfs:label>rulesofinterpretation</rdfs:label>
> > >     </rdf:subject>
> > >     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
> > >     <rdf:object rdf:parseType="Resource">
> > >       <rdfs:label>thisConsignmentAgreement</rdfs:label>
> > >     </rdf:object>
> > >   </rdf:Description>
> > > .
> > > .
> > > </rdf:RDF>
> > >
> > > Do I need to use some other format apart from RDF/XML so that
> > > the output my be be visualised in a browser?
> > >
> > > I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> > > the data to be in some specific format.
> > >
> > > Are there libraries available for  transforming the RDF/XML to a format
> > > suitable for display in browser?
> > >
> > > Which approach would you suggest?
> >
> > I have not worked in this area since 2015, but it remains the biggest
> > problem (and opportunity) in semantic technology.
> >
> > Must you work with RDF/XML format? Jena provides many other options,
> > including csv, json-ld, and sparql results format (srx). These are all
> > easier to transform for presentation than RDF/XML. Will you be
> > transforming the RDF on the server or in the browser?
> >
> > Next, do you want to create a static information display, or dynamic
> > display that responds to user input? Do you want a primarily text-based
> > layout (paragraphs, lists, tables), or graphical (boxes or bubbles and
> > lines)?
> >
> > The approach I found most promising was to use d3.js [1] in the browser.
> > This allows you to create either text or graphical layouts, static or
> > dynamic. You can make ajax sparql queries, either CONSTRUCT or SELECT,
> > and transform the results to HTML5 (including SVG and canvas). What is
> > lacking, however, is a standard way to select and transform significant
> > graph patterns, analogous to XSLT templates. Perhaps the graph shape
> > languages, SHACL and ShEx, could be of some help in this area, but I
> > have not kept up in the last 5 years.
> >
> > One of the big disappointments of semantic technologies is that we
> > haven't gotten far past the "connected bubbles" visualization of RDF
> > graphs. That is easy to do and most unhelpful. It is much harder to
> > create useful schema-specific information presentations from semantic
> > data that meet the real needs of the information consumers.
> >
> > Regards,
> > --Paul
> >
> > [1] https://d3js.org/
> >
> > >
> > > Regards,
> > >
> > > Diptendu Dutta
> > >
> > > Regards,
> > >
> > > Diptendu Dutta
> >
> >



Re: Visualising Jena model saved in RDF/XML in the browser

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
Paul,

as I've shown, XSLT is perfectly usable. Admittedly easier on a flat,
non-nested output.
RDF/XML is significant as a bridge format to the XML stack.

Do you have an example of "useful schema-specific information presentations"?


Martynas

On Mon, Mar 9, 2020 at 3:56 AM Paul Tyson <ph...@sbcglobal.net> wrote:
>
> On Sun, 2020-03-08 at 12:06 +0530, Diptendu Dutta wrote:
> > I have used Jena to generate RDF/XML of the model:
> >
> > <rdf:RDF
> >     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> >     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
> >   <rdf:Description>
> >     <rdf:subject rdf:parseType="Resource">
> >       <rdfs:label>TheConsignor</rdfs:label>
> >     </rdf:subject>
> >     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#shall%20deliver
> > "/>
> >     <rdf:object rdf:parseType="Resource">
> >       <rdfs:label>theConsignedUnits</rdfs:label>
> >     </rdf:object>
> >   </rdf:Description>
> >   <rdf:Description>
> >     <rdf:subject rdf:parseType="Resource">
> >       <rdfs:label>rulesofinterpretation</rdfs:label>
> >     </rdf:subject>
> >     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
> >     <rdf:object rdf:parseType="Resource">
> >       <rdfs:label>thisConsignmentAgreement</rdfs:label>
> >     </rdf:object>
> >   </rdf:Description>
> > .
> > .
> > </rdf:RDF>
> >
> > Do I need to use some other format apart from RDF/XML so that
> > the output my be be visualised in a browser?
> >
> > I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> > the data to be in some specific format.
> >
> > Are there libraries available for  transforming the RDF/XML to a format
> > suitable for display in browser?
> >
> > Which approach would you suggest?
>
> I have not worked in this area since 2015, but it remains the biggest
> problem (and opportunity) in semantic technology.
>
> Must you work with RDF/XML format? Jena provides many other options,
> including csv, json-ld, and sparql results format (srx). These are all
> easier to transform for presentation than RDF/XML. Will you be
> transforming the RDF on the server or in the browser?
>
> Next, do you want to create a static information display, or dynamic
> display that responds to user input? Do you want a primarily text-based
> layout (paragraphs, lists, tables), or graphical (boxes or bubbles and
> lines)?
>
> The approach I found most promising was to use d3.js [1] in the browser.
> This allows you to create either text or graphical layouts, static or
> dynamic. You can make ajax sparql queries, either CONSTRUCT or SELECT,
> and transform the results to HTML5 (including SVG and canvas). What is
> lacking, however, is a standard way to select and transform significant
> graph patterns, analogous to XSLT templates. Perhaps the graph shape
> languages, SHACL and ShEx, could be of some help in this area, but I
> have not kept up in the last 5 years.
>
> One of the big disappointments of semantic technologies is that we
> haven't gotten far past the "connected bubbles" visualization of RDF
> graphs. That is easy to do and most unhelpful. It is much harder to
> create useful schema-specific information presentations from semantic
> data that meet the real needs of the information consumers.
>
> Regards,
> --Paul
>
> [1] https://d3js.org/
>
> >
> > Regards,
> >
> > Diptendu Dutta
> >
> > Regards,
> >
> > Diptendu Dutta
>
>

Re: Visualising Jena model saved in RDF/XML in the browser

Posted by Paul Tyson <ph...@sbcglobal.net>.
On Sun, 2020-03-08 at 12:06 +0530, Diptendu Dutta wrote:
> I have used Jena to generate RDF/XML of the model:
> 
> <rdf:RDF
>     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>   <rdf:Description>
>     <rdf:subject rdf:parseType="Resource">
>       <rdfs:label>TheConsignor</rdfs:label>
>     </rdf:subject>
>     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#shall%20deliver
> "/>
>     <rdf:object rdf:parseType="Resource">
>       <rdfs:label>theConsignedUnits</rdfs:label>
>     </rdf:object>
>   </rdf:Description>
>   <rdf:Description>
>     <rdf:subject rdf:parseType="Resource">
>       <rdfs:label>rulesofinterpretation</rdfs:label>
>     </rdf:subject>
>     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
>     <rdf:object rdf:parseType="Resource">
>       <rdfs:label>thisConsignmentAgreement</rdfs:label>
>     </rdf:object>
>   </rdf:Description>
> .
> .
> </rdf:RDF>
> 
> Do I need to use some other format apart from RDF/XML so that
> the output my be be visualised in a browser?
> 
> I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> the data to be in some specific format.
> 
> Are there libraries available for  transforming the RDF/XML to a format
> suitable for display in browser?
> 
> Which approach would you suggest?

I have not worked in this area since 2015, but it remains the biggest
problem (and opportunity) in semantic technology.

Must you work with RDF/XML format? Jena provides many other options,
including csv, json-ld, and sparql results format (srx). These are all
easier to transform for presentation than RDF/XML. Will you be
transforming the RDF on the server or in the browser?

Next, do you want to create a static information display, or dynamic
display that responds to user input? Do you want a primarily text-based
layout (paragraphs, lists, tables), or graphical (boxes or bubbles and
lines)?

The approach I found most promising was to use d3.js [1] in the browser.
This allows you to create either text or graphical layouts, static or
dynamic. You can make ajax sparql queries, either CONSTRUCT or SELECT,
and transform the results to HTML5 (including SVG and canvas). What is
lacking, however, is a standard way to select and transform significant
graph patterns, analogous to XSLT templates. Perhaps the graph shape
languages, SHACL and ShEx, could be of some help in this area, but I
have not kept up in the last 5 years.

One of the big disappointments of semantic technologies is that we
haven't gotten far past the "connected bubbles" visualization of RDF
graphs. That is easy to do and most unhelpful. It is much harder to
create useful schema-specific information presentations from semantic
data that meet the real needs of the information consumers.

Regards,
--Paul

[1] https://d3js.org/

> 
> Regards,
> 
> Diptendu Dutta
> 
> Regards,
> 
> Diptendu Dutta



Re: Visualising Jena model saved in RDF/XML in the browser

Posted by "Martin G. Skjæveland" <m....@gmail.com>.
 > Are there libraries available for transforming the RDF/XML to a
 > format suitable for display in browser?

RDFVizler, written by me, transforms RDF into images in various formats 
using Jena, Jena rules and Graphviz.

   http://rdfvizler.dyreriket.xyz/

Martin

On 08/03/2020 07:36, Diptendu Dutta wrote:
> I have used Jena to generate RDF/XML of the model:
> 
> <rdf:RDF
>      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>    <rdf:Description>
>      <rdf:subject rdf:parseType="Resource">
>        <rdfs:label>TheConsignor</rdfs:label>
>      </rdf:subject>
>      <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#shall%20deliver
> "/>
>      <rdf:object rdf:parseType="Resource">
>        <rdfs:label>theConsignedUnits</rdfs:label>
>      </rdf:object>
>    </rdf:Description>
>    <rdf:Description>
>      <rdf:subject rdf:parseType="Resource">
>        <rdfs:label>rulesofinterpretation</rdfs:label>
>      </rdf:subject>
>      <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
>      <rdf:object rdf:parseType="Resource">
>        <rdfs:label>thisConsignmentAgreement</rdfs:label>
>      </rdf:object>
>    </rdf:Description>
> .
> .
> </rdf:RDF>
> 
> Do I need to use some other format apart from RDF/XML so that
> the output my be be visualised in a browser?
> 
> I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> the data to be in some specific format.
> 
> Are there libraries available for  transforming the RDF/XML to a format
> suitable for display in browser?
> 
> Which approach would you suggest?
> 
> Regards,
> 
> Diptendu Dutta
> 
> Regards,
> 
> Diptendu Dutta
> 

Re: Visualising Jena model saved in RDF/XML in the browser

Posted by Diptendu Dutta <du...@gmail.com>.
Hello Martynas,

I am getting some errors running the stylesheet that I have reported in the
Issues section of GitHub.

Thank you for your help.

Regards,

Diptendu Dutta

On Sun, Mar 8, 2020 at 4:42 PM Martynas Jusevičius <ma...@atomgraph.com>
wrote:

> Hi Diptendu,
>
> you can try transforming it to SVG with this XSLT 2.0 stylesheet:
>
> https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/converters/RDFXML2SVG.xsl
>
> You can execute it with this Saxon Docker image:
> https://hub.docker.com/r/atomgraph/saxon
>
>
> Martynas
> atomgraph.com
>
> On Sun, 8 Mar 2020 at 07.36, Diptendu Dutta <du...@gmail.com>
> wrote:
>
> > I have used Jena to generate RDF/XML of the model:
> >
> > <rdf:RDF
> >     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> >     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
> >   <rdf:Description>
> >     <rdf:subject rdf:parseType="Resource">
> >       <rdfs:label>TheConsignor</rdfs:label>
> >     </rdf:subject>
> >     <rdf:predicate rdf:resource="
> > http://www.lke.com/lke.owl#shall%20deliver
> > "/>
> >     <rdf:object rdf:parseType="Resource">
> >       <rdfs:label>theConsignedUnits</rdfs:label>
> >     </rdf:object>
> >   </rdf:Description>
> >   <rdf:Description>
> >     <rdf:subject rdf:parseType="Resource">
> >       <rdfs:label>rulesofinterpretation</rdfs:label>
> >     </rdf:subject>
> >     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in
> "/>
> >     <rdf:object rdf:parseType="Resource">
> >       <rdfs:label>thisConsignmentAgreement</rdfs:label>
> >     </rdf:object>
> >   </rdf:Description>
> > .
> > .
> > </rdf:RDF>
> >
> > Do I need to use some other format apart from RDF/XML so that
> > the output my be be visualised in a browser?
> >
> > I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> > the data to be in some specific format.
> >
> > Are there libraries available for  transforming the RDF/XML to a format
> > suitable for display in browser?
> >
> > Which approach would you suggest?
> >
> > Regards,
> >
> > Diptendu Dutta
> >
> > Regards,
> >
> > Diptendu Dutta
> >
>

Re: Visualising Jena model saved in RDF/XML in the browser

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
Hi Diptendu,

you can try transforming it to SVG with this XSLT 2.0 stylesheet:
https://github.com/AtomGraph/Web-Client/blob/master/src/main/webapp/static/com/atomgraph/client/xsl/converters/RDFXML2SVG.xsl

You can execute it with this Saxon Docker image:
https://hub.docker.com/r/atomgraph/saxon


Martynas
atomgraph.com

On Sun, 8 Mar 2020 at 07.36, Diptendu Dutta <du...@gmail.com>
wrote:

> I have used Jena to generate RDF/XML of the model:
>
> <rdf:RDF
>     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>   <rdf:Description>
>     <rdf:subject rdf:parseType="Resource">
>       <rdfs:label>TheConsignor</rdfs:label>
>     </rdf:subject>
>     <rdf:predicate rdf:resource="
> http://www.lke.com/lke.owl#shall%20deliver
> "/>
>     <rdf:object rdf:parseType="Resource">
>       <rdfs:label>theConsignedUnits</rdfs:label>
>     </rdf:object>
>   </rdf:Description>
>   <rdf:Description>
>     <rdf:subject rdf:parseType="Resource">
>       <rdfs:label>rulesofinterpretation</rdfs:label>
>     </rdf:subject>
>     <rdf:predicate rdf:resource="http://www.lke.com/lke.owl#apply%20in"/>
>     <rdf:object rdf:parseType="Resource">
>       <rdfs:label>thisConsignmentAgreement</rdfs:label>
>     </rdf:object>
>   </rdf:Description>
> .
> .
> </rdf:RDF>
>
> Do I need to use some other format apart from RDF/XML so that
> the output my be be visualised in a browser?
>
> I looked at "cytoscape.js", Owl2Vowl, and some others. They all require
> the data to be in some specific format.
>
> Are there libraries available for  transforming the RDF/XML to a format
> suitable for display in browser?
>
> Which approach would you suggest?
>
> Regards,
>
> Diptendu Dutta
>
> Regards,
>
> Diptendu Dutta
>