Saturday, August 27, 2011

Setup Semantic Web Development Environment

What you need:
The following links will take you to the download area for each tool.

Java JDK
Eclipse
Jena
Protege
Pellet

Jena Tutorial
The following website will give you a step-by-step tutorial for the Jena library in Eclipse.

http://www.iandickinson.me.uk/articles/jena-eclipse-helloworld/

Note:  The following is the completed JenaTutorial example for HelloRDFWorld.java


package tutorial;

import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

public class HelloRDFWorld {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Model m = ModelFactory.createDefaultModel();
		String NS = "http://example.com/test/";
		
		Resource r = m.createResource(NS + "r");
		Property p = m.createProperty(NS + "p");
		
		r.addProperty(p,"hello world", XSDDatatype.XSDstring);
		
		m.write(System.out, "Turtle");
	}

}

The following is a screenshot of the completed HelloSemanticWeb example for Chapter 2 of the book.




What is Semantic Web?

Invented by Timer Berners-Lee, the man behind the World Wide Web.  The Semantic Web is an extension of the web which allows machines to search, aggregate and combine the information stored on the web.  The information is stored in web pages that are designed to be human readable, and so new technologies are required for machine readability.  The RDF and XML technologies are used to turn basic web data in to data that can be processed by machines.