Introducing Ontopia REST

32 views
Skip to first unread message

Quintin Siebers

unread,
Jun 19, 2017, 10:50:01 AM6/19/17
to Ontopia Mailing List
Dear Ontopia users,

It is with great joy that we announce a new addition to the Ontopia framework: Ontopia REST. This new module aims to provide a complete REST implementation for core Ontopia functionality. 

You can read more on this now module at:

Ontopia REST will be added to the next major release of Ontopia. You can build it from source if you would like to use or test it before the release. You can find the source in the ontopia-rest directory in the master branch:

With regards,

Quintin Siebers

--
(+31) (0)6 - 11 06 16 27


Morpheus Kennistechnologie BV
<URL: http://www.mssm.nl >
postbus 69
3500 CD Utrecht
KVK 30 26 04 30

Chris Marsh

unread,
Jul 12, 2017, 1:06:18 AM7/12/17
to ontopia
This is very exciting. I would like to use Ontopia with REST for an upcoming project. When I do so, I'll try to create a generic javascript client library to contribute.

Motomu Naito

unread,
Dec 4, 2017, 3:42:12 AM12/4/17
to ont...@googlegroups.com
Dear Quintin Siebers-san,

When will the new Ontopia release?

Best regards,

Motomu Naito

--
You received this message because you are subscribed to the Google Groups "ontopia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+unsubscribe@googlegroups.com.
To post to this group, send email to ont...@googlegroups.com.
Visit this group at https://groups.google.com/group/ontopia.
For more options, visit https://groups.google.com/d/optout.

Quintin Siebers

unread,
Dec 4, 2017, 4:44:37 AM12/4/17
to Ontopia Mailing List
Dear Naito San,

When will the new Ontopia release?

I have a lot of big things for Ontopia that aren’t fully completed. I’m hoping we can release a version soon.

With regards,

Quintin Siebers

--
(+31) (0)6 - 11 06 16 27


Morpheus Kennistechnologie BV
<URL: http://www.mssm.nl >
postbus 69
3500 CD Utrecht
KVK 30 26 04 30

To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+u...@googlegroups.com.

Motomu Naito

unread,
Dec 4, 2017, 7:55:37 AM12/4/17
to ont...@googlegroups.com
Dear Quintin Siebers-san,

Thank you for your efforts!
I am longing for it.

Best regards,

Motomu Naito

Andree Chea

unread,
Mar 3, 2018, 6:00:57 AM3/3/18
to ontopia
Hello all,

With Quintin's tips I've gotten a basic REST server started from the test cases.  I can post the full instructions but basically you have to configure the jetty plugin with all the settings in the execute start-jetty block, and then *disable or remove* that start-jetty block as it installs a conflicting shutdown hook, then run `mvn jetty:run` - all the topic maps should now be available in localhost:8080/api/.  It also prints a nice listing of available endpoints.  I'm pretty new to servlets and will investigate how to run a REST servlet without jetty.

Andree

Andree Chea

unread,
Mar 3, 2018, 6:00:57 AM3/3/18
to ontopia
Hello all,

This is a very interesting project as lack of API bindings for non JVM languages prevented me from exploring interoperability.  I'm interested in giving this a try, but I'm not sure how to start it.  What I've done is:  I've build the ontopia-distribution-tomcat from source and can start up the server and navigate to localhost port 8080, but once in, I can't find it.  Omnigator has a list of plugins, but 'REST' is not included.  I can see that the javadocs for `net.ontopia.topicmaps.rest` were built though.

Do you have any pointers on how to start the REST server?

Thanks in advance,

Andree

Andree Chea

unread,
Mar 3, 2018, 6:00:57 AM3/3/18
to ontopia
Hello Quinten,

I had recently compiled Ontopia but am not sure how to start a REST server.  Is it too far off the intended purpose to configure an empty REST API backed by a database so that one can CRUD any topic/association/occurrence?  I have not much experience with Tomcat/Servlets so I don't know how this works.  Any advice will be appreciated, thanks.

Andree

On Monday, June 19, 2017 at 7:50:01 AM UTC-7, Quintin Siebers wrote:

Andree Chea

unread,
Mar 3, 2018, 4:24:44 PM3/3/18
to ont...@googlegroups.com
Apologies everyone for the sudden influx of my messages!  This mailing list apparently has a gate for new posts/members and I've just been approved, so it's likely you'll hear more from me. :-)

I was discussing with Quintin in the meantime over at the ontopia github so you can find some more details about this module there:


Regards,
Andree

--

Quintin Siebers

unread,
Mar 3, 2018, 5:40:08 PM3/3/18
to Ontopia Mailing List
Dear Andree,

Let’s pick up where you left off at the issue:

What this does is configures the jetty plugin with all the settings in the execute start-jetty block, and then disables that start-jetty block as it installs a conflicting shutdown hook. Then I can execute mvn jetty:run to start the test server.

This is possible yes, but not the most convenient way indeed. 

 I'm inexperienced with these Java Servlets though so I'll see how else to run this without jetty or maven.

A quick overview regarding servlets: 
A servlet container such as Tomcat and Jetty provide a way to host web applications. These applications are can be deployed as a folder, or as a War file (web-archive). Servlet containers support technologies based on the Servlet specification. The basic functionality of a Servlet is to respond to a request, for example over http. A servlet that is usually available in servlet containers is a JSP servlet that can host JSP (java server pages) and HTML files. 
Ontopia REST is based on Restlet, which is a REST framework on top of servlet technology. 

The easiest way to get Ontopia REST running without maven hacking would be to take the distribution tomcat (fully configured and sample topicmaps ready to use) and add the an Ontopia REST application. For this you’ll need:
- Use the latest code pull to assure ontopia-rest jar is added to 
- Create a folder ‘rest’ in apache-tomcat/webapps
- Create a folder ‘WEB-INF’ in apache-tomcat/webapps/rest
- Copy the web.xml from https://github.com/ontopia/ontopia/blob/master/ontopia-rest/src/test/webapp/WEB-INF/web.xml to apache-tomcat/webapps/rest/WEB-INF folder
- Start the distribution tomcat

You should now have access to the api at http://localhost:8080/rest/api 

Have a go and let me know :)

Quintin Siebers

--
(+31) (0)6 - 11 06 16 27


Morpheus Kennistechnologie BV
<URL: http://www.mssm.nl >
postbus 69
3500 CD Utrecht
KVK 30 26 04 30

--
You received this message because you are subscribed to the Google Groups "ontopia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+u...@googlegroups.com.

Andree Chea

unread,
Mar 4, 2018, 1:37:44 AM3/4/18
to ont...@googlegroups.com
Quintin,

Yes, that URL was it!  Funnily enough, I had just worked out to copy that web.xml file, but could not get anything but 404 on /api/ and /test/api/, which was confusing since the tomcat logs showed 'rest' was loaded.  I was about to mess around with META-INF/context.xml too... I did not realize how routing worked; how obvious it is in hindsight. :)

Having it loaded from Ontopia proper is nice too as I can load and create new topic maps as desired (or write my own and stick them in the topicmaps folder).  Barring any other issues, this should keep me occupied for a while...

Thanks again,

Andree

Dear Andree,

To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+unsubscribe@googlegroups.com.

To post to this group, send email to ont...@googlegroups.com.
Visit this group at https://groups.google.com/group/ontopia.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ontopia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontopia+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages