Lecture notes on Semantic Web

how semantic web works and how to build semantic web application. Practical Semantic Web and Linked Data Applications pdf free download
Dr.HenryEvans Profile Pic
Published Date:10-07-2017
Your Website URL(Optional)
PracticalSemanticWeband LinkedDataApplications Java, JRuby, Scala, and Clojure Edition Mark Watson Copyright 2010 Mark Watson. All rights reserved. This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works Version 3.0 United States License. March 12, 2011Contents Preface ix I. IntroductiontoAllegroGraphandSesame 1 1. Introduction 3 1.1. Why use RDF? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Who is this Book Written for? . . . . . . . . . . . . . . . . . . . . . 5 1.3. Why is a PDF Copy of this Book Available Free on My Web Site? . . 5 1.4. Book Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.5. Important Notes on Using the Book Examples . . . . . . . . . . . . . 6 1.6. Organization of this Book . . . . . . . . . . . . . . . . . . . . . . . . 7 1.7. Why Graph Data Representations are Better than the Relational Database Model for Dealing with Rapidly Changing Data Requirements . . . . 8 1.8. Wrap Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2. AnOverviewofAllegroGraph 9 2.1. Starting AllegroGraph . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.1. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2. Working with RDF Data Stores . . . . . . . . . . . . . . . . . . . . . 10 2.2.1. Connecting to a Server and Creating Repositories . . . . . . . 11 2.2.2. Support for Free Text Indexing and Search . . . . . . . . . . 12 2.2.3. Support for Geo Location . . . . . . . . . . . . . . . . . . . 13 2.3. Other AllegroGraph-based Products . . . . . . . . . . . . . . . . . . 14 2.3.1. AllegroGraph AGWebView . . . . . . . . . . . . . . . . . . 14 2.3.2. Gruff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4. Comparing AllegroGraph With Other Semantic Web Frameworks . . 14 2.5. AllegroGraph Overview Wrap Up . . . . . . . . . . . . . . . . . . . 15 3. AnOverviewofSesame 17 3.1. Using Sesame Embedded in Java Applications . . . . . . . . . . . . . 17 3.2. Using Sesame Web Services . . . . . . . . . . . . . . . . . . . . . . 19 3.3. Wrap Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 II. Implementing High Level Wrappers for AllegroGraph iiiPreface This book is intended to be a practical guide for using RDF data in information processing, linked data, and semantic web applications using both the AllegroGraph product and the Sesame open source project. RDF data represents a graph. You probably are familiar to at least some extent with graph theory from computer science. Graphs are a natural way to represent things and the relationships between them. RDF 1 data stores are optimized to efficiently recognize graph sub-patterns and there is a standard query language SPARQL that we will use to query RDF graph data stores. You will learn how to use SPARQL first with simple examples and later by using SPARQL in applications. This book will show you how to effectively use AllegroGraph, a commercial prod- uct written and supported by Franz and the open source Sesame platform. While AllegroGraph itself is written in Common Lisp, this book is primarily written for programmers using either Java or other JVM languages like Scala, Clojure, and JRuby. A separate edition of this book covers using AllegroGraph in Lisp applications. I take an unusual approach in both Java and Lisp editions of this book. Instead of digging too deeply into proprietary APIs for available data stores (for example, AllegroGraph, Jena, Sesame, 4Store, etc.) we will concentrate on a more standards- based approach: we will deal with RDF data stored in easy to read N-Triple and N3 formats and perform all queries using the standard SPARQL query language. I am more interested in showing you how to model data with RDF and write practical applications than in covering specific tools that already have sufficient documentation. While I cover most of the Java AllegroGraph client APIs provided by Franz, my approach is to introduce these APIs and then write a Java wrapper that covers most of the underlying functionality but is, I think, easier to use. I also provide my wrapper in Scala, Clojure, and JRuby versions. Once you understand the functionality of AllegroGraph and work through the examples in this book, you should be able to use any combination of Java, Scala, Closure, and JRuby to develop information processing applications. I have another motivation for writing my own wrapper: I use both AllegroGraph and the open source Sesame system for my own projects. I did some extra work so my 1 Other types of graph data stores like Neo4j are optimized to traverse graphs. Given a starting node you can efficiently traverse the graph in the region around that node. In this book we will concentrate on applications that use sub-graph matching. xiPreface Book Software Road Map JRuby JRuby Wrappers application Java application Scala Scala Wrappers application KnowledgeBooks Java Wrappers Clojure Clojure Wrappers application Franz Sesame AllegroGraph AllegroGraph Java APIs Java APIs Sesame Java Sesame Embedded AllegroGraph Server Libraries Server and RDF and RDF Datastore Datastore Figure 1.: Software developed and used in this book wrapper also supports Sesame (including my own support for geolocation). You can develop using my wrapper and Sesame and then deploy using either AllegroGraph or Sesame. I appreciate this flexibility and you probably will also. Figure 1 shows the general architecture roadmap of the software developed and used in this book. AllegroGraph is written in Common Lisp and comes in several ”flavors”: 1. As a standalone server that supports Lisp, Ruby, Java, Clojure, Scala, and Python clients. A free version (limited to 50 million RDF triples - a large limit) that can be used for any purpose, including commercial use. This book (the Java, Scala, Clojure, and JRuby edition) uses the server version of AllegroGraph. 2. The WebView interface for exploring, querying, and managing AllegroGraph triple stores. WebView is standalone because it contains an embedded Allegro- Graph server. You can see examples of AGWebView in Section 16.4. 3. The Gruff for exploring, querying, and managing AllegroGraph triple stores us- ing table and graph views. Gruff is standalone because it contains an embedded AllegroGraph server. I use Gruff throughout this book to generate screenshots of RDF graphs. xii4. AllegrGraph is compatible with several other commercial products: TopBraid Composer, IO Informatics Sentient, and RacerSystems RacerPorter. 5. A library that is used embedded in Franz Common Lisp applications. A free version is available (with some limitations) for non-commercial use. I covered this library in the Common Lisp edition of this book. Sesame is an open source (BSD style license) project that provides an efficient RDF data store, support for the standard SPARQL query language, and deployment as either an embedded Java library or as a web service. Unlike AllegroGraph, Sesame does not natively support geolocation and free text indexing, but my KnowledgeBooks Java Wrapper adds this support so for the purposes of this book, you can run the examples using either AllegroGraph or Sesame ”back ends.” Most of the programming examples will use the Java client APIs so this book will be of most interest to Java, JRuby, Clojure, and Scala developers. I assume that most readers will have both the free server version of AllegroGraph and Sesame installed. However, the material in this book is also relevant to writing applications using the very large data store capabilities of the commercial version of AllegroGraph. Regardless of which programming languages that you use, the basic techniques of using AllegroGraph are very similar. The example code snippets and example applications and libraries in this book are licensed using the AGPL. As an individual developer, if you purchase the either the print edition of this book or purchase the for-fee PDF book, then I give you a commercial use waiver to the AGPL deploying your applications: you can use my examples in commercial applications without the requirement of releasing the source code for your application under the AGPL. If you work for a company that would like use my examples with a commercial use waiver, then have your company purchase two print copies of this book for use by your development team. Both the AGPL and my own commercial use licenses are included with the source code for this book. Acknowledgements I would like to thank my wife Carol Watson for editing this book. I would like to thank Alex Ott for text corrections and improvements in the Clojure code examples. I would also like to thank the developers of the software that I use in this book: AllegroGraph, Sesame, Lucene, JavaDB, and D2R. xiii1. Introduction Franz has good online documentation for all of their AllegroGraph products and the Sesame open source project also has good online documentation. While I do not duplicate the available documentation, I do aim to make this book self contained, providing you with an introduction to AllegroGraph and Sesame. The broader purpose of this book is to provide application programming examples using RDF and RDFS data models and data stores. I also covers some of my own open source projects that you may find useful for Semantic Web and general information processing applications. AllegroGraph is an RDF data repository that can use RDFS and RDFS+ inferencing. AllegroGraph also provides three non-standard extensions: 1. Test indexing and search 2. Geo Location support 3. Network traversal and search for social network applications I provide you with a wrapper for Sesame that adds text indexing and search, and geo location support. 1.1. WhyuseRDF? We may use many different types of data storage in our work and research, including: 1. Relational Databases 2. NoSQL document-based systems (for example, MongoDB and CouchDB) 3. NoSQL key/value systems (for example, Redis, MemcacheDB, SimpleDB, 1 Voldemort, Dynamo , Big Table, and Linda style tuple stores) 4. RDF data stores I would guess that you are most familiar with the use of relational database systems but NoSQL and RDF type data stores are becoming more commonly used. Although I 1 SimpleDB, Voldemort and Dynamo are ”eventually consistent” so readers do not always see the most current writes but they are easier to scale. 31. Introduction have used NoSQL data stores like MongoDB, CouchDB, and SimpleDB on projects I am not going to cover them here except to say that they share some of the benefits 2 of RDF data stores: no pre-defined schema required and decentralized data store without having to resort to sharding. AllegroGraph and Sesame can also be used for 3 general purpose graph-based applications . The biggest advantages of using RDF are: 1. RDF and RDFS (the RDF Schema language) are standards, as is the more descriptive Web Ontology Language (OWL) that is built on RDF and RDFS and 4 offers richer class and property modeling and inferencing. The SPARQL query language is a standard and is roughly similar to SQL except that it matches patterns in graphs rather than in related database tables. 2. More flexibility: defining properties used with classes is similar to defining the columns in a relational database table. However, you do not need to define properties for every instance of a class. This is analogous to a database table that can be missing columns for rows that do not have values for these columns (a sparse data representation). Furthermore, you can make ad hoc RDF statements about any resource without the need to update global schemas. SPARQL queries can contain optional matching clauses that work well with sparse data representations. 3. Shared Ontologies facilitate merging data from different sources. 4. Being based on proven Internet protocols like HTTP naturally supports web- wide scaling. 5. RDF and RDFS inference creates new information automatically about such things as class membership. Inference is supported by several different logics. Inference supports merging data that is defined using different Ontologies or schemas by making statements about the equivalence of classes and properties. 6. There is a rich and growing corpus of RDF data on the web that can be used as-is or merged with proprietary data to increase the value of in-house data stores. 7. Graph theory is well understood and some types of problems are better solved using graph data structures (more on this topic in Section 1.7) 2 I argue that this increases the agility of developing systems: you can quickly add attributes to documents and add RDF statements about existing things in an RDF data store 3 Like Neo4j 4 I am not covering OWL in this book. However, AllegroGraph supports RDFS++ which is a very useful subset of OWL. There are backend OWL reasoners for Sesame available but I will not use them in this book. I believe that the ”low hanging fruit” for using Semantic Web and Linked Data applications can be had using RDF and RDFS. RDF and RDFS have an easier learning curve than does OWL. 41.2. WhoisthisBookWrittenfor? 1.2. WhoisthisBookWrittenfor? I wrote this book to give you a quick start for learning how to write applications that take advantage of Semantic Web and Linked Data technologies. I also hope that you have fun with the examples in this book and get ideas for your own projects. You can use either the open source Sesame project or the commercially supported AllegroGraph product as you work through this book. I recommend that you try using them both, even though almost all of the examples in this book will work using either one. AllegroGraph is a powerful tool for handling large amounts of data. This book focuses mostly on Java clients and I also provide wrappers so that you can also easily use JRuby, Clojure, and Scala. Franz documentation covers writing clients in Python and C-Ruby and I will not be covering these languages. Since AllegroGraph is implemented is Common Lisp, Franz also provides support for embedding AllegroGraph in Lisp applications. The Common Lisp edition of this book covers embedded Lisp use. If you are a Lisp developer then you should probably be reading the Lisp edition of this book. If you own a AllegroGraph development license, then you are set to go, as far as using this book. If not, you need to download and install a free edition copy at: http://www.franz.com/downloads/ You might also want download and install the free versions of the standalone server, Gruff (Section 2.3.2), and WebView (Section 2.3.1). You can download Sesame from http://openrdf.org and also access the online docu- mentation. 1.3. WhyisaPDFCopyofthisBookAvailable FreeonMyWebSite? As an author I want to both earn a living writing and have many people read and enjoy my books. By offering for sale the print version of this book I can earn some money for my efforts and also allow readers who can not afford to buy many books or may only be interested in a few chapters of this book to read it from the free PDF on my web site. Please note that I do not give permission to post the PDF version of this book on other people’s web sites. I consider this to be at least indirectly commercial exploitation in violation the Creative Commons License that I have chosen for this book. 51. Introduction Typical Semantic Web Application Information Sources (web sites, relational Data to RDF databases, document RDF Filters Repository repositories) RDF/RDFS/OWL Application APIs Program Figure 1.1.: Example Semantic Web Application As I mentioned in the Preface, if you purchase a print copy of this book then I grant you a ”AGPL waiver” so that you can use the book example code in your own projects without the requirement of licensing your code using the AGPL. (See the commercial use software license on my web site or read the copy included with the example code for this book.) 1.4. BookSoftware You can get both the KnowledgeBooks Sesame/AllegroGraph wrapper library and the book example applications from the following git repository: git clone \\ http://github.com/mark-watson/java_practical_semantic_web.git This git repository also contains the version of my NLP library seen in Chapter 12 and all of the other utilities developed in this book. 61.5. ImportantNotesonUsingtheBookExamples 1.5. ImportantNotesonUsingtheBook Examples All of the examples can be run and experimented with using either the AllegroGraph back end or My Sesame back end. If you are using the free version of AllegroGraph and you need to set some environment variables to define a connection with the server: ALLEGROGRAPH_SERVER=localhost or an IP address of a remote server ALLEGROGRAPH_PORT=10035 ALLEGROGRAPH_USERNAME=root ALLEGROGRAPH_PASSWD=z8dj3jk7dqa You should set the username and password to match what you used when installing and setting up AllegroGraph following Franz’s directions. You can set these environment variables in your .profile file for OS X, in your .bashrc or .profile file for Linux, or using ”Edit System Environment Variables” on Windows 7. If you don’t set these values then you will get a runtime error followed by a message telling you which environment variables were not set. Some Java IDEs like IntelliJ do not ”pick up” system environment variables so you will have to set them per project in the IDE. If you want to use Sesame and my wrappers for Java, Scala, JRuby, and Clojure, then you are already set up if you fetched the git repository for this book because I have the required JAR files in the repository. 1.6. OrganizationofthisBook The book examples are organized in subdirectories organized by topic:  Part I contains an overview of AllegroGraph and Sesame including code samples for calling the native AllegroGraph and Sesame APIs.  Part II implements high level wrappers for AllegroGraph and Sesame including code examples in Java, Scala, Clojure, and JRuby.  Part III provides you with an overview of Semantic Web Technologies: RDF, RDFS, SPARQL query language, and linked data. 71. Introduction  Part IV contains utilities for information processing and ends with a large application example. I cover web spidering, Open Calais, my library for Natural Language Processing (NLP), Freebase, SPARQL client for DBpedia, and the GeoNames web services. 1.7. WhyGraphDataRepresentationsareBetter thantheRelationalDatabaseModelfor DealingwithRapidlyChangingData Requirements When people are first introduced to Semantic Web technologies their first reaction is often something like, “I can just do that with a database.” The relational database model is an efficient way to express and work with slowly changing data models. There are some clever tools for dealing with data change requirements in the database world (ActiveRecord and migrations being a good example) but it is awkward to have end users and even developers tagging on new data attributes to relational database tables. A major theme in this book is convincing you that modeling data with RDF and RDFS facilitates freely extending data models and also allows fairly easy integration of data from different sources using different schemas without explicitly converting data from one schema to another for reuse. You will learn how to use the SPARQL query language to use information in different RDF repositories. It is also possible to publish 5 relational data with a SPARQL interface. 1.8. WrapUp Before proceeding to the next two chapters I recommend that you take the time to set up your development system so that you can follow along with the examples. Chapter 2 will give you an overview of AllegroGraph while Chapter 3 will introduce you to the Sesame platform. The first part of this book is very hands on: I’ll give you a quick introduction to AllegroGraph and Sesame via short example programs and later the implementation of my wrapper that allows you to use AllegroGraph and Sesame using the same APIs. In Chapter 6 I will cover Semantic Web technologies from a more theoretical and 5 The open source D2R project (see Appendix B for information on setting up D2R) provides a wrapper for relational databases that provides a SPARQL query interface. If you have existing relational databases that you want to use with RDF data stores then I recommend using D2R. 81.8. WrapUp reference point of view. The book will end with information gathering and processing tools for public lined data sources and larger example applications. 92. AnOverviewofAllegroGraph This chapter will show you how to start the AllegroGraph server on a Linux laptop or server and use the AllegroGraph Java APIs with some small example programs. In Chapters 4 and 5, I will wrap these APIs and the Sesame RDF data store APIs in a common wrapper so that the remaining example programs in this book will work with either the AllegroGraph or Sesame back ends and you will be able to use my Scala, Clojure, or JRuby wrappers if you prefer a more concise (or alternative) language to Java. 2.1. StartingAllegroGraph When you downloaded a copy of the AllegroGraph server from Franz’s web site, there were installation instructions provided for 64-bit editions of Linux, Windows, and OS 12 X. Note that AllegroGraph version 4 specifically requires a 64-bit operating system. When you run the installation script assign a non-obvious password for your Allegro- Graph root account. This is especially important if you are installing the server on a public server. I use the following commands to start and stop the AllegroGraph service on my Linux server: cd /home/mark/agraph-4.0/ agraph-control config /home/mark/AG/agraph.cfg start agraph-control config /home/mark/AG/agraph.cfg stop 1 While writing this book, I kept AllegroGraph running on a low cost 64-bit Linux VPS (I use RimuHosting, but most Linux hosting companies also support 64-bit kernels). Because I work using laptops (usually Ubuntu Linux and OS X, sometimes Windows 7) I find it convenient keeping server processes like AllegroGraph, MongoDB, PostgreSQL, etc. running on separate servers so these services are always available during development and deployment small systems. Commercial VPS hosting and Amazon EC2 instances are inexpensive enough that I have given up running my own servers in my home office. 2 Initially, only the Linux 64 bit edition will be available, followed later with the Windows and OS X editions. 112. AnOverviewofAllegroGraph 2.1.1. Security For my purposes developing this book I was initially satisfied with the security from using a long and non-obvious password on a small dedicated server. If you are going to be running AllegroGraph on a public server that contains sensitive information you might want to install it for local access only when running the installation script and then use a SSH tunnel to remotely access it; for example: ssh -i ˜/.ssh/id_rsa-gsg-keypair \\ -L 10035:localhost:10035 \\ markagtest123.com Here I assume that you have SSH installed on both your laptop and your remote server and that you have copied your public key to the server. I often use SSH tunnels for secure access of remote CouchDB, MongoDB, etc. services. 2.2. WorkingwithRDFDataStores 3 Chapter 6 will provide an introduction to RDF data modeling. For now, it is enough to know that RDF triples have three parts: a subject, predicate, and object. Subjects and predicates are almost always web URIs while an object can be a typed literal value or a URI. RDF data stores provide the services for storing RDF triple data and provide some means of making queries to identify some subset of the triples in the store. I think that it is important to keep in mind that the mechanism for maintaining triple stores varies in different implementations. Triples can be stored in memory, in disk-based btree stores like BerkeleyDB, in relational databases, and in custom stores like AllegroGraph. While much of this book is specific to Sesame and AllegroGraph the concepts that you will learn and experiment with can be useful if you also use other languages and platforms like Java (Sesame, Jena, OwlAPIs, etc.), Ruby (Redland RDF), etc. For Java developers Franz offers a Java version of AllegroGraph (implemented in Lisp with a network interface that also supports Python and Ruby clients) that I will be using in this book and that you now have installed so that you can follow along with my examples. The following sections will give you a brief overview of Franz’s Java APIs and we will take a closer look in Chapter 4. After developing a wrapper in Chapter 4, we will use the wrapper in the rest of this book. 3 I considered covering the more formal aspects of RDF and RDFS early in this book but decided that most people would like to see example code early on. You might want to read through to Chapters 6 and 7 now if you have never worked with any Semantic Web technologies before and do not know what RDF and RDFS are. 122.2. WorkingwithRDFDataStores 2.2.1. ConnectingtoaServerandCreatingRepositories The code in this section uses the Franz Java APIs. While it is important for you to be familiar with the Franz APIs, I will be writing an easier to use wrapper class in Chapter 4 that we will be using in the remainder of this book. The Java class AGServer acts as a proxy to communicate with a remote server: String host = "example.com"; int port = 10035; String username = "root"; String password = "kjfdsji7rfs"; AGServer server = new AGServer("http://" + host + ":" + port, userName, password); Once a connection is made, then we can make a factory root catalog object that we can use, for example, to create a new repository and RDF triples. I am using the SPARQL query language to retrieve triples from the datastore. We will look at SPARQL in some depth in Chapter 8. AGCatalog rootCatalog = server.getRootCatalog(); AGRepository currentRepository = rootCatalog.createRepository("new-repo-1"); AGRepositoryConnection conn = currentRepository.getConnection(); AGValueFactory valueFactory = conn.getRepository().getValueFactory(); // register a predicate for full text // indexing and search: conn.registerFreetextPredicate(valueFactory. createURI("http://example.org/ontology/name")); // create a RDF triple: URI subject = valueFactory. createURI("http://example.org/people/mark"); URI predicate = valueFactory. createURI(http://example.org/ontology/name"); String object = "Mark Watson; conn.add(subject, predicate, object); // perform a SPARQL query: 132. AnOverviewofAllegroGraph String query = "SELECT ?s ?p ?o WHERE ?s ?p ?o ."; TupleQuery tupleQuery = conn. prepareTupleQuery(QueryLanguage.SPARQL, sparql); TupleQueryResult result = tupleQuery.evaluate(); try ListString bindingNames = result.getBindingNames(); while (result.hasNext()) BindingSet bindingSet = result.next(); int size2 = bindingSet.size(); ArrayListString vals = new ArrayListString(size2); for (int i=0; isize2; i++) String variable_name = bindingNames.get(i)); String variable_value = bindingSet. getValue(variable_name).stringValue(); System.out.println(" var: " + variable_name + ", val: " + variable_value); finally result.close(); 2.2.2. SupportforFreeTextIndexingandSearch The AllegroGraph support for free text indexing is very useful and we will use it often in this book. The example code snippets use the same setup code used in the last example - only the SPARQL query string is different: // using free text search; substitute the SPARQL // query string, and re-run the last exaple: String query = "SELECT ?s ?p ?o WHERE ?s ?p ?o . ?s fti:match ’Mark ’ . "; The SPARQL language allows you to add external functions that can be used in matching conditions. Here Franz has defined a function fti:match that interfaces with their custom text index and search functionality. I will be wrapping text search both to make it slightly easier to use and also for compatibility with my text indexing and search wrapper for Sesame. We will not be using the fti:match function in the remainder of this book. 142.2. WorkingwithRDFDataStores 2.2.3. SupportforGeoLocation Geo Location support in AllegroGraph is more general than 2D map coordinates or other 2D coordinate systems. I will be wrapping Geo Location search and using my wrapper for later examples in this book. Here I will briefly introduce you to the Geo Location APIs and then refer you to Franz’s online documentation. // geolocation example: start with a one-time // initialization for this repository: URI location = valueFactory. createURI("http://knowledgebooks.com/rdf/location"); // specify a resolution of 5 miles, and units in degrees: URI sphericalSystemDegree = conn.registerSphericalType(5f, "degree"); // create a geolocation RDF triple: URI subject = valueFactory. createURI("http://example.org/people/mark"); URI predicate = location; // reuse the URI location float latitude = 37.81385; float longitude = -122.3230; String object = valueFactory. createLiteral(latitude + longitude, sphericalSystemDegree); conn.add(subject, predicate, object); // perform a geolocation query: URI location = valueFactory. createURI("http://knowledgebooks.com/rdf/location"); float latitude = 37.7; float longitude = -122.4; float radius_in_km = 800f; RepositoryResultStatement result = conn.getGeoHaversine(sphericalSystemDegree, location, latitude, longitude, radius_in_km, "km", 0, false); try while (result.hasNext()) Statement statement = result.next(); Value s = statement.getSubject(); Value p = statement.getPredicate(); Value o = statement.getObject(); System.out.println("subject: " + s + ", predicate: " + p + 152. AnOverviewofAllegroGraph ", object: " + o);) finally result.close(); We will be using Geo Location later in this book. 2.3. OtherAllegroGraph-basedProducts Franz has auxiliary products that extend AllegroGraph adding a web service interface (WebView) and an interactive RDF graph browser (Gruff). 2.3.1. AllegroGraphAGWebView AGWebView is packaged with the AllegroGraph server. After installing AllegroGraph 4.0 server, you can open a browser at http://localhost:10035 to use AGWebView. I will be using AGWebView in Chapter 16 to show generated RDF data. You might want to use it instead of or in addition to AllegroGraph if you would like a web-based RDF browser and administration tool for managing RDF repositories. AGWebView is 4 available for Linux, Windows, and OS X . 2.3.2. Gruff Gruff is an interactive RDF viewer and editor. I use Gruff to create several screen shot figures later in this book; for example Figure 11.1. When you generate or otherwise collect RDF triple data then Gruff is a good tool to visually explore it. Gruff is only 5 available for Linux and requires AllegroGraph 4. 2.4. ComparingAllegroGraphWithOther SemanticWebFrameworks Although this book is about developing Semantic Web applications using just Allegro- Graph and/or Sesame, it is also worthwhile looking at alternative technologies that you 4 Initially available for Linux, followed by Windows and OS X. 5 As an alternative to using Gruff, you can use the open source GrapViz program to generate technical figures showing RDF graphs. I covered this in my book ”Scripting Intelligence, Web 3.0 Information Gathering and Processing” Watson 2009, Apress/Springer-Verlag, pages 145-149 162.5. AllegroGraphOverviewWrapUp can use. The alternative technology that I have used for Semantic Web applications is Swi-Prolog with its Semantic Web libraries (open source, LGPL). Swi-Prolog is an excellent tool for experimenting and learning about the Semantic Web. The Java Jena toolkit is also widely used. These alternatives have the advantage of being free to use but lack advantages of scalability and utility that a commercial product like AllegroGraph has. Although I do not cover OpenLink Virtuoso, you might want to check out either the open source or commercial version. OpenLink Virtuoso is used to host the public SPARQL endpoint for the DBPedia linked data web service that I will use later in two example programs. 2.5. AllegroGraphOverviewWrapUp This short chapter gave you a brief introduction to running AllegroGraph as a service and showed some Java client code snippets to introduce you to the most commonly used Franz client APIs. Before implementing a Java wrapper for the AllegroGraph in Chapter 4, we will first take a look at the Sesame toolkit in the next chapter. If you are do not plan on using Sesame, at least in the near term, then you can skip directly to Chapter 4 where I develop the wrapper for Franz’s Java APIs. AllegroGraph is a great platform for building Semantic Web Applications and I encourage you to more fully explore the online dcoumentation. There are interesting and useful aspects of AllegroGraph (e.g., federated AllegroGraph instances on multiple servers) that I will not be covering in this book. 17

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.