Hello,
Better late than never? It has been a while since I asked for
possibilities of improving HTML formatting of RDF when URI's are
directly dereferenced. I came up with something that I would like to
share. Perhaps it is useful to somebody...
The only method known to me of making URI's dereferencable in Virtuoso
is by using rewrite rules that transform URI's to SPARQL query's. The
response from the SPARQL query is returned as dereferenced RDF data. The
concept is described here:
http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtDeployingLinkedDataGuide_UsingVirtuoso
In the example, the rewrite rule transforms the URI to a DESCRIBE query.
My virtuoso instance, and I suppose every Virtuoso instance, creates a
response page with a heading like this:
This HTML5 document contains 16 embedded RDF statements represented
using HTML+Microdata notation.
The embedded RDF content will be recognized by any processor of HTML5
Microdata.
And then the name spaces and data follow. An example of such a page:
http://lod.geodan.nl/basisreg/bag/pand/id_0014100010962825/mut_1
Now it is my assumption that the primary audience for HTML pages is
human readers, not necessarily readers that know about RDF. So I
wondered if it is possible to automatically generate pages that are
easier to read.
A possible solution is to create a separate rewrite rule for the HTML
format that creates a SELECT query that will return a three column
(subject-predicate-object) table as output. Such a rule looks like this:
DB.DBA.URLREWRITE_CREATE_REGEX_RULE (
'bag_rule2', -- rule_iri
1, -- allow_update (1=yes)
'(/[^#]*)', -- nice_match
vector('path'), --nice_params
1, --nice_min_params
'/sparql?query=SELECT+%%3Chttp%%3A//lod.geodan.nl%U%%3E+as+%%3FSubject+%%3FPredicate+%%3FObject+from+%%3Chttp%%3A//lod.geodan.nl/basisreg/bag/%%3E+where+%%7B%%3Chttp%%3A//lod.geodan.nl%U%%3E+%%3FPredicate+%%3FObject%%7D&format=text/html',
-- target_compose (regex)
vector('path','path'), -- target_params
null, -- target_expn
'(text/html)', -- accept_pattern
1, -- do_not_continue (0= continue with next rule, 1=do not continue)
null -- http_redirect_code
);
And this is an example of a URI to which the rule is
applied:http://lod.geodan.nl/basisreg/bag/
<http://lod.geodan.nl/basisreg/bag/>
It is probably subjective, but I think this representation is easier to
read/understand for an average human. Still, there is room for
improvement. Some explanatory text as a heading would be nice, but I
don't know how to make that happen.
When I find the time, I will try to find an improvement. Perhaps just
changing the content type could be a solution - I have just discovered
Virtuoso has several HTML content types (see this list
<http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSSparqlProtocol#SPARQL%20Protocol%20Server%20Response%20Formats>)
next to 'text/html', like 'text/x-html+tr'.
Regards,
Frans
On 2013-11-26 15:17, Frans Knibbe | Geodan wrote:
Hello,
I wonder what my options are for automatically formatting RDF (either
the result of s SPARQL query or direct dereferencing of a URI) as HTML
that is pleasant to the human eye. What I have got now is rewrite
rules that will output the result of SPARQL DESCRIBE as text/html. I
think formatting for web browsers could be nicer. Are there common
approaches for automatically generating nice looking HTML that I could
deploy in Virtuoso? I did just find this description of using
Description.vsp
<http://www.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtDeployingLinkedDataGuide_description_vsp>.
I wonder if this is the recommended way to make nice HTML? Or are
there other options to consider?
Thanks in advance,
Frans
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users
------------------------------------------------------------------------
Frans Knibbe
Geodan
President Kennedylaan 1
1079 MB Amsterdam (NL)
T +31 (0)20 - 5711 347
E frans.kni...@geodan.nl
www.geodan.nl <http://www.geodan.nl> | disclaimer
<http://www.geodan.nl/disclaimer>
------------------------------------------------------------------------
------------------------------------------------------------------------------
Slashdot TV. Videos for Nerds. Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users