jo4neo: POJO object binding 4 neo4j 4 you!

December 9th, 2009 § 1

I have applied some of what I learned while writing jenabean towards a graph database called neo4j. It is strictly a simple tool for persisting java objects to a graph, and retrieving them back. I was able to get in a few features like auto-indexing. This is version 0.1…a very early release.

http://code.google.com/p/jo4neo/

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.

Your Very Own Google Code Maven Repo

April 11th, 2009 § 6

This post describes how to make a maven repo for your google code project.  I’m a big fan of google code.  It’s a tremendous service for those looking for a place to host their open source code.  The only thing I lacked was a maven repo.  I have to be honest here, while I use maven, it’s still a big mystery to me how things end up in the main maven repo.  If Google were to add one new feature, I’d prefer it be a maven repo and hudson build that autodiscovers maven projects and builds them…but we’re not there yet, so the question I’m going to answer is how you can provide a maven repo for your open source customers hosted on google code.   » Read the rest of this entry «

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]

Writing out SIOC triples using Jena + Jenabean

March 10th, 2009 § 1

(this post deals with features provided jenabean 1.0.1, available from the project site.  You’ll also need Jena, HP’s semenatic web framework.)

In my last post we looked at reading SIOC directly off the web. The other side of the coin is producing syntactically valid SIOC statements from java. You may want to create RDF for another consumer or perhaps you want to persist the SIOC statements directly into a Jena model. Either way, if you use the direct approach of coding to Jena’s RDF api, you’ll be writing quite a few lines of code. This task can be made simpler using Jenabean’s “Thing” utility along with a specialized interface to the Sioc vocabulary.  We’ll be looking at this simple example, which duplicates the primary RDF example givin in the SIOC specification document. » Read the rest of this entry «

Processing SIOC feeds with Jenabean

February 26th, 2009 § 1

This is a simple example of using jenabean’s “Thing” class to process SIOC data. The full example is available here.
SIOC is an OWL ontology for integrating and exchanging online community information.  It’s one of the few but growing public ontologies that have some adoption where you can find examples in the wild.  Jenabean makes it very easy to extract information using the SIOC vocabulary.   Assuming your Jena project is setup, all that’s required is for you to download the jenabean jar file to get started.  The latest snapshot build (0.9) contains a ready made interface for working with SIOC feeds or data.  First create a simple class with a static main… » Read the rest of this entry «

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 the tools category at The Web Semantic.