I got this wrong in my previous email These new functions are currently on a branch and not yet integrated into master and so won't be in the 2.13.0 release
Rob On 10/03/2015 09:56, "Rob Vesse" <[email protected]> wrote: >Rose > >The latest development SNAPSHOTs of ARQ I.e. 2.13.0-SNAPSHOT do include >some new functions that add a broader range of mathematical functions. >We're currently voting on the 2.13.0 so it will likely be officially >available by the end of the week if you don't want to use development >code. > >Specifically Jena gains all the numeric and trigonometric functions >provided by the Leviathan Function Library: > >https://bitbucket.org/dotnetrdf/dotnetrdf/wiki/DeveloperGuide/SPARQL/Levia >t >han%20Functions > >So your query could be rewritten like so: > >PREFIX lfn: <http://www.dotnetrdf.org/leviathan#> > >SELECT ?a ?c ?c1 (lfn:log(?c1) + (2^?c) AS ?score) >WHERE >{ > GRAPH ?j1 > { > ?a <http://dbpedia.org/b> ?c. > ?a <http://dbpedia.org/b> ?c1 > } >} > >Regards, > >Rob > > > >On 09/03/2015 21:55, "Rose Beck" <[email protected]> wrote: > >>Just to add I tried to use: jena-arq-2.11.0.jar as it supports SPARQL >>1.1 (http://mvnrepository.com/artifact/org.apache.jena/jena-arq/2.11.0). >>However as I am new to Java therefore I am not getting how can I load >>data into Jena using this jar file, also how can I query this jar file >>just like with jena-tdb-0.9.0-incubating I use ./bin/tdbquery --time >>--loc=/home/jenaTestDatabase/ "./bin/tdbquery >>--time --loc=/home/jenaTestDatabase/ "select ?a?c?c1 (log(?c1)+(2^?c) >>as ?score) where{ graph ?j1{?a <http://dbpedia.org/b> ?c. ?a >><http://dbpedia.org/b> ?c1} }" >> >>Can someone please help me with this too. Possibly an example can be a >>great starting point for new users like me. I'll be very grateful to >>you for the same. >> >>On Tue, Mar 10, 2015 at 3:00 AM, Rose Beck <[email protected]> wrote: >>> Dear all, >>> >>> I have data of the following form (File name: test.nq): >>> <http://dbpedia.org/a> <http://dbpedia.org/b> >>> "200"^^<http://www.w3.org/2001/XMLSchema#integer> >>> <http://dbpedia.org/id_1> . >>> <http://dbpedia.org/a> <http://dbpedia.org/b1> >>> "200"^^<http://www.w3.org/2001/XMLSchema#integer> >>> <http://dbpedia.org/id_3> . >>> <http://dbpedia.org/a> <http://dbpedia.org/b2> >>> <http://dbpedia.org/data/Plasmodium_hegneri.xml> >>> <http://dbpedia.org/id_5> . >>> >>> I loaded the data using: >>> ~/jena-tdb-0.9.0-incubating/bin/tdbloader >>> --loc=/home/jenaTestDatabase/ -v /home/test.nq >>> >>> And am querying it using: >>> ./bin/tdbquery --time --loc=/home/jenaTestDatabase/ "./bin/tdbquery >>> --time --loc=/home/jenaTestDatabase/ "select ?a?c?c1 (log(?c1)+(2^?c) >>> as ?score) where{ graph ?j1{?a <http://dbpedia.org/b> ?c. ?a >>> <http://dbpedia.org/b> ?c1} }" >>> >>> That is I want to take the logarithm to base 10 of bindings of ?c1 and >>> raise the bindings of ?c to power of 2. Is it possible to achieve the >>> same using Jena? Probably I am missing the syntax of SPARQL 1.1. Can >>> someone please help me with -- as to how can I write the above query? >>> >>> -- >>> With Warm Regards, >>> Rose >>> Researcher >> >> >> >>-- >>With Warm Regards, >>Rose > > > >
