Simple Blog Using jo4neo and Stripes

January 3rd, 2010 § 0

neoblog is a simple application I built to test drive jo4neo.  You are welcome to browse the code here for details not covered in this post. It demonstrates the feasibility of utilizing view tier objects to persist graph relationships.

neoblog with 3 posts

neoblog with 3 posts

» Read the rest of this entry «

User/Roles Pattern in jo4neo

December 18th, 2009 § 0

Roles and Users is a classic domain model well suited to representation as a directed graph. The neo4j team has provided us with a good summary of how to implement this pattern using neo4j here . Utilizing jo4neo we can also solve this problem via a combination of the neo graph database and simple java objects.  The code and maven build for this example are posted here.  I encourage you to run the example and browse the code.  We’ll need two domain classes, » Read the rest of this entry «

How to Truncate a Google Apps Datastore (Java)

April 16th, 2009 § 0

It’s not super simple but possible to truncate your google apps datastore. Please, don’t do as I did and attempt to use the web GUI to delete page after page of data for anything over a few hundred Entities. Instead, use this simple servlet example after changing “myKindOfData” to your own type. It’d even be better if you spend a few minutes and improve the servlet so that it takes a parameter to supply for the “kind” of entity.

public class TruncateServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Query q = new Query("myKindOfData");
ArrayList keys = new ArrayList();
for (Entity taskEntity : datastore.prepare(q).asIterable())
keys.add(taskEntity.getKey());
datastore.delete(keys);
}
}

What I learned doing this activity is that when you’re deleting many rows, you’ll want to first collect the keys, then supply the collection to the delete() method, as opposed to deleting in the query loop, which will time out on you. (GAE is very picky about how long web requests take). I like how GAE applies all these restrictions on us…it forces you to economize and avoid long running servlet requests. Don’t leave this servlet on an open URL for too long, anybody can come along and delete your data.

Easy Jena startup with Eclipse and Maven

April 10th, 2009 § 6

Recently on the Jena news group there was a question regarding classpath and how frustrating it can be to properly configure that aspect of a new project. I began to answer the question and realized I haven’t touched a classpath for years simply because the tools I use make that unnecessary. Eclipse is free and has very good maven integration. At the same time, the Jena team is providing jena as a Maven asset indexed on the main maven repo. The consequences are that you can have eclipse create a new project for you, and add your library dependencies for you by simply declaring that your project “uses” jena.  Here is a quick screentoaster demo to get you going…

Record your screencast online
Reblog this post [with Zemanta]

Article on Java and OWL/RDF

February 2nd, 2009 § 0

My latest article published today at the semantic universe.  It covers some of the tools java developers can use to program the semantic web, including my own little project, jenabean, as well as other notables like Elmo for Aduna’s openrdf tool.  I’ve enjoyed my association with the semantic technology conference.  It’s an interesting grouping of all things “semantic” and provides a good place to get your bearings on all the different sub-groupings that makeup semantic technologies.

Reblog this post [with Zemanta]

Where Am I?

You are currently browsing entries tagged with java at The Web Semantic.