Sparql response in XML with ungrouped tags

Matters relating to the Virtual Database Engine functionality realm such as:
- Master Data Management (virtualization of Heterogeneous SQL (ODBC/JDBC/ADO.NET/OLE-DB), XML, RDF, and SOA based data sources)
- Product Information Management (building RDF Linked Data Spaces from Product Catalog Data)
- RDFization Middleware for producing RDF Linked Data from non RDF Data Sources
- Enteprise Information & Data Integration (in general)

Sparql response in XML with ungrouped tags

Postby zoltanszi on Tue Sep 27, 2011 9:51 am

Hi!

We have OpenLink Virtuoso version 06.01.3127 installed.

There is a small inconvenience we are experiencing when the response of our sparql endpoint is in XML format.
Here is a sample response:

Code: Select all
<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:about="http://<host>/nda/resource/data/124"><dcterms:type xmlns:dcterms="http://purl.org/dc/terms/" rdf:resource="http://purl.org/dc/dcmitype/Sound"/></rdf:Description>
<rdf:Description rdf:about="http://<host>/nda/resource/data/124"><dcterms:language xmlns:dcterms="http://purl.org/dc/terms/" rdf:resource="http://lexvo.org/id/iso639-3/hun"/></rdf:Description>
<rdf:Description rdf:about="http://<host>/nda/resource/data/124"><dcterms:type xmlns:dcterms="http://purl.org/dc/terms/">Magazin</dcterms:type></rdf:Description>
<rdf:Description rdf:about="http://<host>/nda/resource/data/124"><dcterms:format xmlns:dcterms="http://purl.org/dc/terms/">audio/mpeg</dcterms:format></rdf:Description>
<rdf:Description rdf:about="http://<host>/nda/resource/data/124"><dcterms:date xmlns:dcterms="http://purl.org/dc/terms/">2003-12-04 06:00:00+01</dcterms:date></rdf:Description>
<rdf:Description rdf:about="http://<host>/nda/resource/data/124"><dcterms:subject xmlns:dcterms="http://purl.org/dc/terms/">tulku</dcterms:subject></rdf:Description>
</rdf:RDF>


As you can see, the triples have the same subjects and namespaces, yet they are not grouped into one Description tag. Also, the namespaces should be defined first, and then they would not need to be defined in every tag. Is there a way to change this output format the way I described? It would be much easier to read and the response would be a lot shorter as well.

(In NTriples format it displays the triples grouped and with the namespaces defined first).

Thank you in advance!

Kind regards,
Zoltan
zoltanszi
 
Posts: 13
Joined: Fri Sep 23, 2011 6:52 am

Re: Sparql response in XML with ungrouped tags

Postby iv_an_ru on Wed Sep 28, 2011 12:25 am

Indeed, the output can be shortened, but RDF/XML is noticeably less popular than Turtle and the like, so there were no optimization requests before and the "pretty-printing" was postponed.
As there's a need, I will add this improvement in 6.1.5.
iv_an_ru
 
Posts: 25
Joined: Wed Sep 03, 2008 10:26 am

Re: Sparql response in XML with ungrouped tags

Postby zoltanszi on Wed Sep 28, 2011 2:14 am

Okay, thank you for adding it!
zoltanszi
 
Posts: 13
Joined: Fri Sep 23, 2011 6:52 am


Return to Virtuoso - Virtual Data Management

Who is online

Users browsing this forum: No registered users and 1 guest

cron