You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Richard Morgan <si...@gmail.com> on 2014/03/13 12:50:35 UTC

Creating my own builtins and compiling libraries in Eclipse

Hi all,

The last time I coded Java in anger was in version 1.02 since then things
have changed a bit and the world is more exciting.

I wish to start rolling my own Jena Rules functions by extending the
Builtin class. I am using Eclipse, I have read and successfully followed
the "A complete beginner's guide to starting a Jena project in
Eclipse<http://www.iandickinson.me.uk/articles/jena-eclipse-helloworld/>"
which has you download and link in the Jena libraries. I've also read the "The
general purpose rule
engine<http://jena.apache.org/documentation/inference/#rules>"
which points me to builtins.

The bit I'm struggling with then is how to actually import the Jena
libraries into my project and compile them so that my builtin is available.
Initially I thought that I would be able to import or load the project
files from the jena-2.11.1-source-release.zip<http://mirror.gopotato.co.uk/apache//jena/source/jena-2.11.1-source-release.zip>
but
it doesn't seem to be this simple and I'm copying source files around
trying to get it to compile.

What are the broad steps I need to follow, and what elements of the Eclipse
IDE do I need to learn to do this? I know exactly what I want to do and
I've an interesting data integration project to complete and it is
frustrating me that I'm banging my head on Eclipse instead of getting on
with it ...

Best Regards,

Richard

Re: Creating my own builtins and compiling libraries in Eclipse

Posted by Richard Morgan <si...@gmail.com>.
Hi Andy,

Thanks for the sage advice! I've done as you've suggested and I'm fast
progressing on to my next problem :-)

Many thanks,

Richard


On Thu, Mar 13, 2014 at 1:52 PM, Crapo, Andrew (GE Global Research) <
crapo@ge.com> wrote:

> Why would you want to recompile the Jena source? Just put the Jena jar
> files on your classpath and create your class that extend the Jena class
> com.hp.hpl.jena.reasoner.rulesys.builtins.BaseBuiltin. Then you can
> register your builtin with the call
>
> BuiltinRegistry.theRegistry.register((Builtin) myBuiltin);
>
> (Builtin is the Interface class for BaseBuiltin.) Your builtin will now
> work in your rules.
>
> Andy
>
> -----Original Message-----
> From: Richard Morgan [mailto:silkyrich@gmail.com]
> Sent: Thursday, March 13, 2014 7:51 AM
> To: users@jena.apache.org
> Subject: Creating my own builtins and compiling libraries in Eclipse
>
> Hi all,
>
> The last time I coded Java in anger was in version 1.02 since then things
> have changed a bit and the world is more exciting.
>
> I wish to start rolling my own Jena Rules functions by extending the
> Builtin class. I am using Eclipse, I have read and successfully followed
> the "A complete beginner's guide to starting a Jena project in Eclipse<
> http://www.iandickinson.me.uk/articles/jena-eclipse-helloworld/>"
> which has you download and link in the Jena libraries. I've also read the
> "The general purpose rule engine<
> http://jena.apache.org/documentation/inference/#rules>"
> which points me to builtins.
>
> The bit I'm struggling with then is how to actually import the Jena
> libraries into my project and compile them so that my builtin is available.
> Initially I thought that I would be able to import or load the project
> files from the jena-2.11.1-source-release.zip<
> http://mirror.gopotato.co.uk/apache//jena/source/jena-2.11.1-source-release.zip
> >
> but
> it doesn't seem to be this simple and I'm copying source files around
> trying to get it to compile.
>
> What are the broad steps I need to follow, and what elements of the
> Eclipse IDE do I need to learn to do this? I know exactly what I want to do
> and I've an interesting data integration project to complete and it is
> frustrating me that I'm banging my head on Eclipse instead of getting on
> with it ...
>
> Best Regards,
>
> Richard
>

RE: Creating my own builtins and compiling libraries in Eclipse

Posted by "Crapo, Andrew (GE Global Research)" <cr...@ge.com>.
Why would you want to recompile the Jena source? Just put the Jena jar files on your classpath and create your class that extend the Jena class com.hp.hpl.jena.reasoner.rulesys.builtins.BaseBuiltin. Then you can register your builtin with the call 

BuiltinRegistry.theRegistry.register((Builtin) myBuiltin);

(Builtin is the Interface class for BaseBuiltin.) Your builtin will now work in your rules.

Andy

-----Original Message-----
From: Richard Morgan [mailto:silkyrich@gmail.com] 
Sent: Thursday, March 13, 2014 7:51 AM
To: users@jena.apache.org
Subject: Creating my own builtins and compiling libraries in Eclipse

Hi all,

The last time I coded Java in anger was in version 1.02 since then things have changed a bit and the world is more exciting.

I wish to start rolling my own Jena Rules functions by extending the Builtin class. I am using Eclipse, I have read and successfully followed the "A complete beginner's guide to starting a Jena project in Eclipse<http://www.iandickinson.me.uk/articles/jena-eclipse-helloworld/>"
which has you download and link in the Jena libraries. I've also read the "The general purpose rule engine<http://jena.apache.org/documentation/inference/#rules>"
which points me to builtins.

The bit I'm struggling with then is how to actually import the Jena libraries into my project and compile them so that my builtin is available.
Initially I thought that I would be able to import or load the project files from the jena-2.11.1-source-release.zip<http://mirror.gopotato.co.uk/apache//jena/source/jena-2.11.1-source-release.zip>
but
it doesn't seem to be this simple and I'm copying source files around trying to get it to compile.

What are the broad steps I need to follow, and what elements of the Eclipse IDE do I need to learn to do this? I know exactly what I want to do and I've an interesting data integration project to complete and it is frustrating me that I'm banging my head on Eclipse instead of getting on with it ...

Best Regards,

Richard