You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Frans Knibbe <fr...@geodan.nl> on 2016/04/15 16:18:22 UTC

Fuseki content negotiation: HTML content type

Hello,

I have just been testing content negotiation with my new Fuseki server
(version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
JSON-LD formats and that seemed to work well. However, if I request data to
be formatted in HTML ("Accept: text/html"), I receive my sample data in
RDF/XML format.

Is there an overview of content types that Fuseki supports somewhere? I
searched but have not been able to find it.

And is there a way to get HTML format working?

Greetings, and thanks in advance,

Frans

Re: Fuseki content negotiation: HTML content type

Posted by Martynas Jusevičius <ma...@graphity.org>.
You might find these XSLT stylesheets for RDF/XML useful:
https://github.com/Graphity/graphity-client/blob/master/src/main/webapp/static/org/graphity/client/xsl/bootstrap/2.3.2/layout.xsl
On Fri, 15 Apr 2016 at 21:27, Frans Knibbe <fr...@geodan.nl> wrote:

> Hello A. Soroka,
>
> Thank you for all the pointers. It seems I have some researching to do. I
> think I will start with the options that seem the most simple: XSLT with
> RDF/XML and Pubby.
>
> Regards,
> Frans
>
> 2016-04-15 19:17 GMT+02:00 A. Soroka <aj...@virginia.edu>:
>
> > Using XSLT with RDF/XML is a pretty common solution for this. Otherwise,
> > you might want to look at Pubby:
> >
> > http://wifo5-03.informatik.uni-mannheim.de/pubby/
> >
> > which seems no longer to be under development and has some limitations,
> > but could be useful to you. It translates requests on URIs into SPARQL
> > Describe queries against a backend (e.g. Jena Fuseki) and provides HTML
> > representations. For more sophisticated HTML work, there are templating
> > systems (e.g. Apache Marmotta LDPath Template [1]). Or, if you are less
> > interested in providing a sophisticated query endpoint than in just
> > publishing triples en masse, you might be better served by Linked Data
> > Fragments [2] and the machinery associated therewith [3].
> >
> > [1] https://marmotta.apache.org/ldpath/template.html
> > [2] http://linkeddatafragments.org/
> > [3] https://github.com/LinkedDataFragments/Server.java
> >
> > ---
> > A. Soroka
> > The University of Virginia Library
> >
> > > On Apr 15, 2016, at 12:59 PM, Andy Seaborne <an...@apache.org> wrote:
> > >
> > > Fuseki itself does not provide HTML.  It's a data server - appearance
> is
> > the responsibility of the client.
> > >
> > > What sparql.org does for HTML is add a stylesheet to
> > application/sparql-results+xml.
> > >
> > > request G
> > >
> > > GET .... &stylesheet=%2Fxml-to-html.xsl
> > >
> > > -->
> > >
> > > <?xml version="1.0"?>
> > > <?xml-stylesheet type="text/xsl" href="/xml-to-html.xsl"?>
> > > <sparql xmlns="http://www.w3.org/2005/sparql-results#">
> > > ....
> > >
> > >
> > >
> > >       Andy
> > >
> > > On 15/04/16 16:42, Frans Knibbe wrote:
> > >> 2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:
> > >>
> > >>> It's not totally clear to me what you could mean by "a way to get
> HTML
> > >>> format working". Do you mean some kind of RDFa templating? There's
> not
> > a
> > >>> normal way to translate triples into HTML.
> > >>>
> > >>> If you could say a little more about your use case for HTML, someone
> > might
> > >>> be able to recommend a tool or technique to use. Otherwise, Fuseki
> will
> > >>> return the serializations for triples that you name below (and I
> > believe
> > >>> there may be some functionality for quads, but others would know more
> > than
> > >>> I).
> > >>>
> > >>
> > >> The general use case would be displaying data in a human friendly way.
> > For
> > >> example when a data URI is entered in the address bar of a web
> browser.
> > Or
> > >> when a data URI appears in on a web page or in a web application and a
> > user
> > >> clicks on it.
> > >>
> > >> I do not have an idea of how the data should be presented on an HTML
> > page.
> > >> I guess it is like the SPARQL DESCRIBE response - there is some lierty
> > in
> > >> how it can be implemented. It could be table with subject, predicate
> and
> > >> object columns for example. Or something like the DBPedia HTML output
> > (e.g.
> > >> http://dbpedia.org/page/Fuseki). Something that allows some kind of
> > >> customization or templating would be great.
> > >>
> > >> I hope this helps to explain what I am looking for. And I hope it is
> > >> somehow possible to have some form of HTML output.
> > >>
> > >> Regards,
> > >> Frans
> > >>
> > >>
> > >>>
> > >>> ---
> > >>> A. Soroka
> > >>> The University of Virginia Library
> > >>>
> > >>>> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
> > >>> wrote:
> > >>>>
> > >>>> Hello,
> > >>>>
> > >>>> I have just been testing content negotiation with my new Fuseki
> server
> > >>>> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples
> and
> > >>>> JSON-LD formats and that seemed to work well. However, if I request
> > data
> > >>> to
> > >>>> be formatted in HTML ("Accept: text/html"), I receive my sample data
> > in
> > >>>> RDF/XML format.
> > >>>>
> > >>>> Is there an overview of content types that Fuseki supports
> somewhere?
> > I
> > >>>> searched but have not been able to find it.
> > >>>>
> > >>>> And is there a way to get HTML format working?
> > >>>>
> > >>>> Greetings, and thanks in advance,
> > >>>>
> > >>>> Frans
> > >>>
> > >>>
> > >>
> > >
> >
> >
>

Re: Fuseki content negotiation: HTML content type

Posted by Frans Knibbe <fr...@geodan.nl>.
Hello A. Soroka,

Thank you for all the pointers. It seems I have some researching to do. I
think I will start with the options that seem the most simple: XSLT with
RDF/XML and Pubby.

Regards,
Frans

2016-04-15 19:17 GMT+02:00 A. Soroka <aj...@virginia.edu>:

> Using XSLT with RDF/XML is a pretty common solution for this. Otherwise,
> you might want to look at Pubby:
>
> http://wifo5-03.informatik.uni-mannheim.de/pubby/
>
> which seems no longer to be under development and has some limitations,
> but could be useful to you. It translates requests on URIs into SPARQL
> Describe queries against a backend (e.g. Jena Fuseki) and provides HTML
> representations. For more sophisticated HTML work, there are templating
> systems (e.g. Apache Marmotta LDPath Template [1]). Or, if you are less
> interested in providing a sophisticated query endpoint than in just
> publishing triples en masse, you might be better served by Linked Data
> Fragments [2] and the machinery associated therewith [3].
>
> [1] https://marmotta.apache.org/ldpath/template.html
> [2] http://linkeddatafragments.org/
> [3] https://github.com/LinkedDataFragments/Server.java
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Apr 15, 2016, at 12:59 PM, Andy Seaborne <an...@apache.org> wrote:
> >
> > Fuseki itself does not provide HTML.  It's a data server - appearance is
> the responsibility of the client.
> >
> > What sparql.org does for HTML is add a stylesheet to
> application/sparql-results+xml.
> >
> > request G
> >
> > GET .... &stylesheet=%2Fxml-to-html.xsl
> >
> > -->
> >
> > <?xml version="1.0"?>
> > <?xml-stylesheet type="text/xsl" href="/xml-to-html.xsl"?>
> > <sparql xmlns="http://www.w3.org/2005/sparql-results#">
> > ....
> >
> >
> >
> >       Andy
> >
> > On 15/04/16 16:42, Frans Knibbe wrote:
> >> 2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:
> >>
> >>> It's not totally clear to me what you could mean by "a way to get HTML
> >>> format working". Do you mean some kind of RDFa templating? There's not
> a
> >>> normal way to translate triples into HTML.
> >>>
> >>> If you could say a little more about your use case for HTML, someone
> might
> >>> be able to recommend a tool or technique to use. Otherwise, Fuseki will
> >>> return the serializations for triples that you name below (and I
> believe
> >>> there may be some functionality for quads, but others would know more
> than
> >>> I).
> >>>
> >>
> >> The general use case would be displaying data in a human friendly way.
> For
> >> example when a data URI is entered in the address bar of a web browser.
> Or
> >> when a data URI appears in on a web page or in a web application and a
> user
> >> clicks on it.
> >>
> >> I do not have an idea of how the data should be presented on an HTML
> page.
> >> I guess it is like the SPARQL DESCRIBE response - there is some lierty
> in
> >> how it can be implemented. It could be table with subject, predicate and
> >> object columns for example. Or something like the DBPedia HTML output
> (e.g.
> >> http://dbpedia.org/page/Fuseki). Something that allows some kind of
> >> customization or templating would be great.
> >>
> >> I hope this helps to explain what I am looking for. And I hope it is
> >> somehow possible to have some form of HTML output.
> >>
> >> Regards,
> >> Frans
> >>
> >>
> >>>
> >>> ---
> >>> A. Soroka
> >>> The University of Virginia Library
> >>>
> >>>> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
> >>> wrote:
> >>>>
> >>>> Hello,
> >>>>
> >>>> I have just been testing content negotiation with my new Fuseki server
> >>>> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
> >>>> JSON-LD formats and that seemed to work well. However, if I request
> data
> >>> to
> >>>> be formatted in HTML ("Accept: text/html"), I receive my sample data
> in
> >>>> RDF/XML format.
> >>>>
> >>>> Is there an overview of content types that Fuseki supports somewhere?
> I
> >>>> searched but have not been able to find it.
> >>>>
> >>>> And is there a way to get HTML format working?
> >>>>
> >>>> Greetings, and thanks in advance,
> >>>>
> >>>> Frans
> >>>
> >>>
> >>
> >
>
>

Re: Fuseki content negotiation: HTML content type

Posted by "A. Soroka" <aj...@virginia.edu>.
Using XSLT with RDF/XML is a pretty common solution for this. Otherwise, you might want to look at Pubby:

http://wifo5-03.informatik.uni-mannheim.de/pubby/

which seems no longer to be under development and has some limitations, but could be useful to you. It translates requests on URIs into SPARQL Describe queries against a backend (e.g. Jena Fuseki) and provides HTML representations. For more sophisticated HTML work, there are templating systems (e.g. Apache Marmotta LDPath Template [1]). Or, if you are less interested in providing a sophisticated query endpoint than in just publishing triples en masse, you might be better served by Linked Data Fragments [2] and the machinery associated therewith [3].

[1] https://marmotta.apache.org/ldpath/template.html
[2] http://linkeddatafragments.org/
[3] https://github.com/LinkedDataFragments/Server.java

---
A. Soroka
The University of Virginia Library

> On Apr 15, 2016, at 12:59 PM, Andy Seaborne <an...@apache.org> wrote:
> 
> Fuseki itself does not provide HTML.  It's a data server - appearance is the responsibility of the client.
> 
> What sparql.org does for HTML is add a stylesheet to application/sparql-results+xml.
> 
> request G
> 
> GET .... &stylesheet=%2Fxml-to-html.xsl
> 
> -->
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="/xml-to-html.xsl"?>
> <sparql xmlns="http://www.w3.org/2005/sparql-results#">
> ....
> 
> 
> 
> 	Andy
> 
> On 15/04/16 16:42, Frans Knibbe wrote:
>> 2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:
>> 
>>> It's not totally clear to me what you could mean by "a way to get HTML
>>> format working". Do you mean some kind of RDFa templating? There's not a
>>> normal way to translate triples into HTML.
>>> 
>>> If you could say a little more about your use case for HTML, someone might
>>> be able to recommend a tool or technique to use. Otherwise, Fuseki will
>>> return the serializations for triples that you name below (and I believe
>>> there may be some functionality for quads, but others would know more than
>>> I).
>>> 
>> 
>> The general use case would be displaying data in a human friendly way. For
>> example when a data URI is entered in the address bar of a web browser. Or
>> when a data URI appears in on a web page or in a web application and a user
>> clicks on it.
>> 
>> I do not have an idea of how the data should be presented on an HTML page.
>> I guess it is like the SPARQL DESCRIBE response - there is some lierty in
>> how it can be implemented. It could be table with subject, predicate and
>> object columns for example. Or something like the DBPedia HTML output (e.g.
>> http://dbpedia.org/page/Fuseki). Something that allows some kind of
>> customization or templating would be great.
>> 
>> I hope this helps to explain what I am looking for. And I hope it is
>> somehow possible to have some form of HTML output.
>> 
>> Regards,
>> Frans
>> 
>> 
>>> 
>>> ---
>>> A. Soroka
>>> The University of Virginia Library
>>> 
>>>> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
>>> wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> I have just been testing content negotiation with my new Fuseki server
>>>> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
>>>> JSON-LD formats and that seemed to work well. However, if I request data
>>> to
>>>> be formatted in HTML ("Accept: text/html"), I receive my sample data in
>>>> RDF/XML format.
>>>> 
>>>> Is there an overview of content types that Fuseki supports somewhere? I
>>>> searched but have not been able to find it.
>>>> 
>>>> And is there a way to get HTML format working?
>>>> 
>>>> Greetings, and thanks in advance,
>>>> 
>>>> Frans
>>> 
>>> 
>> 
> 


Re: Fuseki content negotiation: HTML content type

Posted by Frans Knibbe <fr...@geodan.nl>.
Hello Andy,

Ok, HTML is not a pure data format, but it could be viewed as such. A data
format for human consumers, allowing humans to surf the data web in a
follow-your-nose style. Other RDF data servers that I worked with (D2R
server and Virtuoso) did support HTML content. So I kind of expected this
from Fuseki too.

Appearence would not have to be handled by the data server, the data server
could produce a bare HTML file annotated with CSS classes, leaving
appearence to some other party.

Following the sparql.org example, a solution would be to use XSL to
transform rdf/xml to html. I wonder if it is possible to somehow intercept
the requests for text/html content in the web server and add an XSL
transformation in those cases... I should look in to that.

Greetings,
Frans

2016-04-15 18:59 GMT+02:00 Andy Seaborne <an...@apache.org>:

> Fuseki itself does not provide HTML.  It's a data server - appearance is
> the responsibility of the client.
>
> What sparql.org does for HTML is add a stylesheet to
> application/sparql-results+xml.
>
> request G
>
> GET .... &stylesheet=%2Fxml-to-html.xsl
>
> -->
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="/xml-to-html.xsl"?>
> <sparql xmlns="http://www.w3.org/2005/sparql-results#">
> ....
>
>
>
>         Andy
>
>
> On 15/04/16 16:42, Frans Knibbe wrote:
>
>> 2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:
>>
>> It's not totally clear to me what you could mean by "a way to get HTML
>>> format working". Do you mean some kind of RDFa templating? There's not a
>>> normal way to translate triples into HTML.
>>>
>>> If you could say a little more about your use case for HTML, someone
>>> might
>>> be able to recommend a tool or technique to use. Otherwise, Fuseki will
>>> return the serializations for triples that you name below (and I believe
>>> there may be some functionality for quads, but others would know more
>>> than
>>> I).
>>>
>>>
>> The general use case would be displaying data in a human friendly way. For
>> example when a data URI is entered in the address bar of a web browser. Or
>> when a data URI appears in on a web page or in a web application and a
>> user
>> clicks on it.
>>
>> I do not have an idea of how the data should be presented on an HTML page.
>> I guess it is like the SPARQL DESCRIBE response - there is some lierty in
>> how it can be implemented. It could be table with subject, predicate and
>> object columns for example. Or something like the DBPedia HTML output
>> (e.g.
>> http://dbpedia.org/page/Fuseki). Something that allows some kind of
>> customization or templating would be great.
>>
>> I hope this helps to explain what I am looking for. And I hope it is
>> somehow possible to have some form of HTML output.
>>
>> Regards,
>> Frans
>>
>>
>>
>>> ---
>>> A. Soroka
>>> The University of Virginia Library
>>>
>>> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
>>>>
>>> wrote:
>>>
>>>>
>>>> Hello,
>>>>
>>>> I have just been testing content negotiation with my new Fuseki server
>>>> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
>>>> JSON-LD formats and that seemed to work well. However, if I request data
>>>>
>>> to
>>>
>>>> be formatted in HTML ("Accept: text/html"), I receive my sample data in
>>>> RDF/XML format.
>>>>
>>>> Is there an overview of content types that Fuseki supports somewhere? I
>>>> searched but have not been able to find it.
>>>>
>>>> And is there a way to get HTML format working?
>>>>
>>>> Greetings, and thanks in advance,
>>>>
>>>> Frans
>>>>
>>>
>>>
>>>
>>
>

Re: Fuseki content negotiation: HTML content type

Posted by Andy Seaborne <an...@apache.org>.
Fuseki itself does not provide HTML.  It's a data server - appearance is 
the responsibility of the client.

What sparql.org does for HTML is add a stylesheet to 
application/sparql-results+xml.

request G

GET .... &stylesheet=%2Fxml-to-html.xsl

-->

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/xml-to-html.xsl"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
....



	Andy

On 15/04/16 16:42, Frans Knibbe wrote:
> 2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:
>
>> It's not totally clear to me what you could mean by "a way to get HTML
>> format working". Do you mean some kind of RDFa templating? There's not a
>> normal way to translate triples into HTML.
>>
>> If you could say a little more about your use case for HTML, someone might
>> be able to recommend a tool or technique to use. Otherwise, Fuseki will
>> return the serializations for triples that you name below (and I believe
>> there may be some functionality for quads, but others would know more than
>> I).
>>
>
> The general use case would be displaying data in a human friendly way. For
> example when a data URI is entered in the address bar of a web browser. Or
> when a data URI appears in on a web page or in a web application and a user
> clicks on it.
>
> I do not have an idea of how the data should be presented on an HTML page.
> I guess it is like the SPARQL DESCRIBE response - there is some lierty in
> how it can be implemented. It could be table with subject, predicate and
> object columns for example. Or something like the DBPedia HTML output (e.g.
> http://dbpedia.org/page/Fuseki). Something that allows some kind of
> customization or templating would be great.
>
> I hope this helps to explain what I am looking for. And I hope it is
> somehow possible to have some form of HTML output.
>
> Regards,
> Frans
>
>
>>
>> ---
>> A. Soroka
>> The University of Virginia Library
>>
>>> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
>> wrote:
>>>
>>> Hello,
>>>
>>> I have just been testing content negotiation with my new Fuseki server
>>> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
>>> JSON-LD formats and that seemed to work well. However, if I request data
>> to
>>> be formatted in HTML ("Accept: text/html"), I receive my sample data in
>>> RDF/XML format.
>>>
>>> Is there an overview of content types that Fuseki supports somewhere? I
>>> searched but have not been able to find it.
>>>
>>> And is there a way to get HTML format working?
>>>
>>> Greetings, and thanks in advance,
>>>
>>> Frans
>>
>>
>


Re: Fuseki content negotiation: HTML content type

Posted by Frans Knibbe <fr...@geodan.nl>.
2016-04-15 17:02 GMT+02:00 A. Soroka <aj...@virginia.edu>:

> It's not totally clear to me what you could mean by "a way to get HTML
> format working". Do you mean some kind of RDFa templating? There's not a
> normal way to translate triples into HTML.
>
> If you could say a little more about your use case for HTML, someone might
> be able to recommend a tool or technique to use. Otherwise, Fuseki will
> return the serializations for triples that you name below (and I believe
> there may be some functionality for quads, but others would know more than
> I).
>

The general use case would be displaying data in a human friendly way. For
example when a data URI is entered in the address bar of a web browser. Or
when a data URI appears in on a web page or in a web application and a user
clicks on it.

I do not have an idea of how the data should be presented on an HTML page.
I guess it is like the SPARQL DESCRIBE response - there is some lierty in
how it can be implemented. It could be table with subject, predicate and
object columns for example. Or something like the DBPedia HTML output (e.g.
http://dbpedia.org/page/Fuseki). Something that allows some kind of
customization or templating would be great.

I hope this helps to explain what I am looking for. And I hope it is
somehow possible to have some form of HTML output.

Regards,
Frans


>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl>
> wrote:
> >
> > Hello,
> >
> > I have just been testing content negotiation with my new Fuseki server
> > (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
> > JSON-LD formats and that seemed to work well. However, if I request data
> to
> > be formatted in HTML ("Accept: text/html"), I receive my sample data in
> > RDF/XML format.
> >
> > Is there an overview of content types that Fuseki supports somewhere? I
> > searched but have not been able to find it.
> >
> > And is there a way to get HTML format working?
> >
> > Greetings, and thanks in advance,
> >
> > Frans
>
>

Re: Fuseki content negotiation: HTML content type

Posted by "A. Soroka" <aj...@virginia.edu>.
It's not totally clear to me what you could mean by "a way to get HTML format working". Do you mean some kind of RDFa templating? There's not a normal way to translate triples into HTML.

If you could say a little more about your use case for HTML, someone might be able to recommend a tool or technique to use. Otherwise, Fuseki will return the serializations for triples that you name below (and I believe there may be some functionality for quads, but others would know more than I).

---
A. Soroka
The University of Virginia Library

> On Apr 15, 2016, at 10:18 AM, Frans Knibbe <fr...@geodan.nl> wrote:
> 
> Hello,
> 
> I have just been testing content negotiation with my new Fuseki server
> (version 1.3.1). I tried to get data in Turtle, RDF/XML, Ntriples and
> JSON-LD formats and that seemed to work well. However, if I request data to
> be formatted in HTML ("Accept: text/html"), I receive my sample data in
> RDF/XML format.
> 
> Is there an overview of content types that Fuseki supports somewhere? I
> searched but have not been able to find it.
> 
> And is there a way to get HTML format working?
> 
> Greetings, and thanks in advance,
> 
> Frans