[Mulgara-general] Not yet for newbie

David Wood dwood at softwarememetics.com
Mon Nov 20 16:16:22 UTC 2006


Hi Guojin,

Thanks for your description of our documentation problems.  We can  
use your mail to address the documentation before the next Mulgara  
release.

It is unfortunate that you are trying to use the JSP library with  
Mulgara.  I do not believe that the JSP library has been touched in  
years and it is only tested via the unit tests.  You are therefore  
probably right about Java 1.5. classes causing problems with it.

These directions should get you going, but I HAVE NOT TRIED THEM.   
Let me know if you continue to have trouble and I will see if I can  
give you confirmed directions.  Please make sure you give me the  
details of your environment if that becomes necessary.

The JSP library uses the SOAP endpoint in the API.  It depends on a  
servlet container that supports the JavaServer Pages Specification,  
version 1.1 or higher.

In Mulgara, the JSP library JAR has been moved to <install_dir>/bin/ 
tag-base-1.1.0.jar - that may be been enough to confuse you if you  
were looking at the JSP directions on the old Kowari documentation  
site (at http://kowari.org/oldsite/485.htm).

You will have to copy .../bin/tag-base-1.1.0.jar and .../bin/ 
taglib.tld to the /WEB-INF/lib directory of your Web application server.

Then, add a <taglib> element to your Web application deployment  
Descriptor in /WEB-INF/web.xml:

<taglib>
   <taglib-uri>http://www.mulgara.org/mulgara/taglibs/mulgara</taglib- 
uri>
   <taglib-location>/WEB-INF/lib/tag-base-1.1.0.jar</taglib-location>
</taglib>

NB: Note that the URI and JAR file names are different than for Kowari!

Next, add this directive to the top of each of your JSP pages:

<%@ taglib prefix="mulgara" uri="http://www.mulgara.org/mulgara/ 
taglibs/mulgara"%>


The JSP tags you will then have available are:
init - Initializes the Mulgara JSP tag environment by setting the  
SOAP endpoint of the Mulgara server
render - Renders an XML document using a supplied stylesheet
statement - Sends queries to a Mulgara server
query - Adds an iTQL query to a statement
execute - Executes queries in a statement
answer - Retrieves query answers from a statement


An example JSP page would work like this, if you change the init tag  
to point to your Mulgara instance:

<%-- initialise the environment with the SOAP endpoint's URL--%>
<mulgara:init server="http://mysite.com:8080/webservices/services/ 
ItqlBeanService"/>
<%-- render the results of a query --%>
<mulgara:render stylesheet="/default.xsl">

   <%-- execute a statement --%>
   <mulgara:statement>

     <mulgara:query>
       select $subj $pred $obj from rmi://localhost/server1#foo where  
$subj $pred $obj ;
     </mulgara:query>

     <%-- execute the query --%>
     <mulgara:execute/>

   </mulgara:statement>
</mulgara:render>


Regards,
Dave


On 20 Nov2006, at 05:02, Guojun Zhu wrote:
> Hi,
>
> I am a newbie for the rdf.  I know fairly amount about
> java and sql though.  Kowari and Mulgara are great
> stuff. The tutorial of itql is also very nice.  I
> admire your hard work.   However, I would express some
> frustration on these especially, the documentation.
>
> I guess you have already see my message about weird
> problem with kowari-1.2.  It works on and off with my
> jsp codes on tomcat 5.5.  I highly suspect it is
> because of some java 1.5 class in my codes.  And I
> suspected some bugs of packaging problem with it.
>
> One thing I am sure is that the javadoc with it is
> non-synchronized.  One class mentioned in the jrdf
> tutorial of wiki, AbstractGraphFactory for client-side
> model is not in the jar file while it is in the
> javadoc.
>
> The non-existing documentation really gives me
> headache.  I have a running kowari server and would
> like to access it from a web application of jsp in
> tomcat.  The Tag part is not completed in the wiki.
> The jrdf tutorial use this non-existing class. And
> jrdf has almost no documents itself.   Jena's tutorial
> is quite short and
> jena's own site is not that clear either.
>
> Also, the example class mentioned in the tutorial
> exists in the jar as class but I just cannot find them
> in the source package.
>
> Can anyone give me a simple example to access the
> database please?  I only need to access it from a java
> class with jsp in the tomcat.  I do not need to
> perform any advance function.  The only type of the
> queries I would like to perform is  "select $o from
> <rmi://localhost:test#test> where <hfk> <jfkd:title>
> $o".



More information about the Mulgara-general mailing list