- From: M. Scott Marshall <mscottmarshall@gmail.com>
- Date: Thu, 7 Jul 2011 11:54:52 +0200
- To: Peter Ansell <ansell.peter@gmail.com>
- Cc: Matthias Samwald <matthias.samwald@meduniwien.ac.at>, Bio2Rdf Mailing List <bio2rdf@googlegroups.com>, w3c semweb hcls <public-semweb-lifesci@w3.org>, "Eric Prud'hommeaux" <eric@w3.org>
Hi Peter, You could probably use SWObjects as an interpreter for your SPARQL Constructs while speaking with your Sesame SPARQL endpoint as a graph service. SWObjects makes use of SPARQL Constructs to chain rules and effectively create views or mappings of either triplestores or relational databases. I think that it has support for the SPARQL 1.1 functions - at least, I've seen several of the functions in your example. Not sure about encode_for_uri() though. If that sounds interesting to you, checkout: http://www.w3.org/2010/Talks/1208-egp-swobjects/ See also: http://tinyurl.com/swobjects-swat4ls Cheers, Scott -- M. Scott Marshall, W3C HCLS IG co-chair, http://www.w3.org/blog/hcls http://staff.science.uva.nl/~marshall On Thu, Jun 30, 2011 at 1:07 PM, Peter Ansell <ansell.peter@gmail.com> wrote: > On 30 June 2011 18:43, Matthias Samwald > <matthias.samwald@meduniwien.ac.at> wrote: >> Hi Peter, >> >> Great work! On the example page you provided >> (http://bio2rdf.org/page/geneid:12334) I also see properties such as >> http://purl.org/science/owl/sciencecommons/describes_gene_or_gene_product_mentioned_by >> which come from the Science Commons KB (and the HCLS Knowledge Base >> developed in the first charter of the HCLS interest group). Did those >> properties go into Bio2RDF because you imported some data from the Science >> Commons KB, or did you deliberately choose to re-use those properties >> because you considered them useful? > > Those triples are directly sourced from > http://sparql.neurocommons.org/sparql , without changing the > properties. > >>> If you want to make changes to any of the datasources, you can >>> normalise results (and denormalise queries) using rules. This version >>> allows you to use XSLT and SPARQL in addition to Regular Expressions >>> that were already supported. For example this now means that if there >>> are XML datasources, you can convert them to RDF using the >>> normalisation rules in the server. The software now uses Sesame 2.4.0 >>> which contains support for SPARQL Query 1.1 so any SPARQL rules that >>> are applied to intermediate results can be transformed using the new >>> functions and language features. In particular, SPARQL 1.1 allows you >>> to create new URIs inside queries, so if you know that there are >>> literals in an rdf document that you could create a URI out of, you >>> can do it using a SPARQL normalisation rule for that datasource. >> >> Do you have an example of how this could be done with SPARQL 1.1? > > According to the SPARQL 1.1 specifications, the following should > hypothetically work, but it doesn't seem to work right now with the > Sesame 2.4.0 library. > > CONSTRUCT { > ?myUri <http://bio2rdf.org/bio2rdf_resource:genesymbol> ?symbolUri . > } WHERE { > ?myUri <http://purl.org/science/owl/sciencecommons/ggp_has_primary_symbol> > ?primarysymbol . > bind(iri(concat("http://bio2rdf.org/symbol:",encode_for_uri(lcase(str(?primarySymbol))))) > AS ?symbolUri)} > > BIND : http://www.w3.org/TR/sparql11-query/#bind > IRI : http://www.w3.org/TR/sparql11-query/#func-iri > CONCAT : http://www.w3.org/TR/sparql11-query/#func-concat > ENCODE-FOR-URI : http://www.w3.org/TR/sparql11-query/#func-encode > LCASE : http://www.w3.org/TR/sparql11-query/#func-lcase > > Maybe I am doing something wrong so far. It is complaining about > something being wrong after concat but it looks okay to me. > >>> In addition, if anyone wants to suggest a way to do any other rule >>> based normalisation I would be happy to extend the software to support >>> it. I have always had RIF rules in the back of my head, but have not >>> experimented with them yet. If anyone uses RIF rules in their work, it >>> would be great to get some example code to guide a future extension to >>> this software. >> >> Did you consider using SPARQL Inference Notation (SPIN, >> http://spinrdf.org/)? I don't think there is an implementation for Sesame >> out there yet, though. > > I will look at it again. Is there an open source implementation by the > way? I have been using SPARQL CONSTRUCT queries to do virtually > everything that I thought SPIN could do, with a more familiar > notation. I didn't find the SPIN notation easy to understand. > > Cheers, > > Peter > >
Received on Thursday, 7 July 2011 09:55:22 UTC