[BioMart Users] RDF/XML output prototype code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[BioMart Users] RDF/XML output prototype code

Peter Ansell
Hi,

I have written some prototype/template code that doesn't function yet,
but it is a basic attempt at RDF/XML processor output. I am attaching
it to this email so people who know about the way Biomart works a
little better can improve it and hopefully distribute it with Biomart.
It is designed to allow users to generate RDF/XML output using the
current XML Query format as long as some property URIs are defined in
the configuration to provide mappings based on property
names/dataset/mart contexts.

It doesn't currently depend on any information from a SPARQL query,
but it could be connected with that infrastructure as an alternative
output for SPARQL queries that is being constructed using
org.biomart.api.rest.SPARQLResource and org.biomart.processors.RDF.
RDF/XML allows you to process SPARQL Construct queries in addition to
Select queries. The only difference with Construct compared to Select
is that you find out what result variables are required based on the
"CONSTRUCT { ?resultObject <property:xyz> ?xyz ...}" BasicGraphPattern
instead of from the "SELECT ?xyz ?abc" list

Is it possible to extend the Processor definitions to include the
processor name as an annotation in a similar way to @ContentType? If I
understand it correctly, the current way maps the output name, for
example TSV or RDFXML, directly to the class name, which isn't ideal
given that annotations are used for the other major extensions. I
included an example of this in the attached file using the example
annotation @ProcessorName.

In future versions, 0.9 maybe, is there any possibility that
Processors can use an alternative method of receiving information? The
TSV stream works well for TSV, but it makes it a little difficult to
implement alternative output methods. In looking around, it seems like
QueryRunner is the last place that results are handled as List/Arrays
of String's before they are written as bytes to the OutputStream that
is then filtered by Processors. It may be possible to extend
QueryRunner to provide an alternative output method using List<String>
or even using an overall results set encapsulated in a
Collection<List<String>> so clients can directly handle entire rows of
results without having to restore them into List<String> based on
bytes that are written to the stream between NEWLINE characters.

Cheers,

Peter

_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users

RDFXML.java (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] RDF/XML output prototype code

Joachim Baran-2
Hi Peter!

On 11-04-07 10:47 PM, "Peter Ansell" <[hidden email]> wrote:
>I have written some prototype/template code that doesn't function yet,
>but it is a basic attempt at RDF/XML processor output.
  Thanks a lot for your prototype. I think you will be very pleased with
the functionality of the SPARQL/RDF implementation as it will be included
in the next BioMart release candidate. Essentially, it does cover the
RDF-XML-output functionality of your prototype (I need to have a more
in-depth look at it again though), but I also added some extras to
MartConfigurator that let you map attributes/filters to RDF
classes/properties too. An ontology is generated automagically for each
mart too.

  The next release candidate is in the making, so you will not have to
wait much longer before you can test BioMart's SPARQL implementation. It
would be great if you could then spare some time to have a closer look at
the results it generates. For now, I only included SELECT-queries, but
will have a look at CONSTRUCT queries as time allows. My main concern
right now is efficiency, because it turns out that the extra information
we are dealing with now can be impeding query speed.

Joachim

_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users