Simple AllegroGraph Access

From Tetherless World Wiki

Jump to: navigation, search
Event Info [ Edit ]
Type Tutorial
Title Simple AllegroGraph Access
Location Winslow Building
When 2008/10/02 15:30 - 2008/10/02 16:00
Abstract
Webpage

More Details (out-links)

What Links Here (in-links)


Contents

Introduction

At Li's request, I created a (very) simple Java class for using AllegroGraph. The purpose of this class is to provide access to AllegroGraph for those who need a scalable triple store immediately or soon for their research.

Quick Setup

  1. Create an account on plato.cs.rpi.edu. (Contact Li Ding or Jesse Weaver.)
  2. Place RDF files in your home directory (or wherever ON THE SERVER)
  3. Obtain com.franz.agraph-3-0-1.jar from plato.cs.rpi.edu (in directory /usr/local/ag/acl81.64/agraph/). (One option: WinSCP)
  4. Download SimpleAG.zip from Image:SimpleAG.zip. (SimpleAG.zip is actually a jar file, but the extension was changed to zip so that the wiki would accept it.) SimpleAG.zip contains only the class files. If you would like the source code and the javadocs, you can download SimpleAG-src-doc.zip from Image:SimpleAG-src-doc.zip. (Again, it is actually a jar file.)
  5. To test if it's working, execute: java -cp SimpleAG.jar;com.franz.agraph-3-0-1.jar edu.rpi.tw.simple.test.TestSimpleAG. Note that the classpath delimiter might be different on some systems. E.g., you might need to do, java -cp SimpleAG.jar:com.franz.agraph-3-0-1.jar edu.rpi.tw.simple.test.TestSimpleAG (note : vs. ;). Also, note that SimpleAG was developed using Java 1.6, so if you get a java.lang.UnsupportedClassVersionError, you probably have an earlier version of Java and need to upgrade. Alternatively, you could download SimpleAG-src-doc.zip and recompile the code under version 1.5. (The code uses Enums, so versions before 1.5 will not work.)
  6. For details of what's happening in TestSimpleAG, review the tutorial below.
  7. Develop code using the two jar files mentioned in the classpath above.

Tutorial

TestSimpleAG is discussed in the following.

Creating a SimpleAG Object

Create a SimpleAG object.

  SimpleAG ag = new SimpleAG();

This object represents a simple connection to an AllegroGraph knowledge store. Originally, it is disconnected.

Naming the Knowledge Store

To connect to an AllegroGraph knowledge store, four pieces of information are required: host, port, directory, and name. Host, port, and directory have the default values plato.cs.rpi.edu, 4567, and /usr/local/ag/acl81.64/tripleStores. You must specify a name.

  // Sets the name of the triple store to use.
  ag.setName("test");

Connecting

When you connect to the knowledge store, it will open "test" (in accordance with the example in the preceding section) if it already exists, or it will create "test" if it does not already exist.

  // Connects to the knowledge store,
  // opening it if it already exists,
  // creating it if it doesn't.
  ag.connect();

Clearing the Knowledge Store

Just so that we know what to expect, clear the knowledge store first.

  // Clear the triple store.
  ag.clear();

Adding Triples from RDF/XML Files (on the server)

Now, let's add some triples to the knowledge store. It is important to note that the filepath supplied is a filepath ON THE SERVER. In this example, part of the Wine ontology is used. A context URI can be specified. Here, null is used to indicate that triples should be added to the default graph.

  // Load RDF/XML data from a file ON THE SERVER.
  ag.addRdfXml("/home/jrweave/wine.rdf", null);

Indexing Triples

When finished loading data, it is a good idea to index all the triples for fast querying.

  // Index all triples for faster query.
  ag.indexAllTriples();

Running Queries

Let's run some queries.

  String result = null;
  String query = null;
  
  // Get all subclasses of Wine
  query = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
          + "PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\n"
          + "SELECT ?sc\n" 
          + "{\n" 
          + "\t?sc rdfs:subClassOf vin:Wine\n"
          + "}\n";
  
  System.out.println(query);
  System.out.println();
  
  // Get all direct subclasses of Wine
  result = ag.querySparql(false, AGResults.SPARQL_XML, query);
  System.out.println(result);
  System.out.println();

This query finds all direct subclasses of vin:Wine (i.e., no inference). Note in the code above that the result format is specified using AGResults.SPARQL_XML. AGResults is an enum. You must specify an appropriate AGResults for your query. If it is a SPARQL SELECT query, then only those AGResults forSelect() that return true are suitable for SPARQL SELECT. For example, AGResults.SPARQL_XML.forSelect()==true, so AGResults.SPARQL_XML is suitable for SPARQL SELECT queries. Following are the results.

  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
  SELECT ?sc
  {
      ?sc rdfs:subClassOf vin:Wine
  }
  
  
  <?xml version="1.0"?>
  <sparql xmlns="http://www.w3.org/2005/sparql-results#">
    <head>
      <variable name="sc"/>
    </head>
    <results>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#DessertWine</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#EarlyHarvest</uri>
        </binding>
      </result>
    </results>
  </sparql>

Let's repeat the same query, but with RDFS++ inference.

  // Get all direct and inferred subclasses of Wine
  result = ag.querySparql(true, AGResults.SPARQL_XML, query);
  System.out.println(result);
  System.out.println();

Following are the results; notice that more subclasses of Wine have been found.

  <?xml version="1.0"?>
  <sparql xmlns="http://www.w3.org/2005/sparql-results#">
    <head>
      <variable name="sc"/>
    </head>
    <results>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#DessertWine</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#EarlyHarvest</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes</uri>
        </binding>
      </result>
      <result>
        <binding name="sc">
          <uri>http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SweetRiesling</uri>
        </binding>
      </result>
    </results>
  </sparql>

More Querying

Following are more examples of queries.

  // Construct all rdfs:subClassOf triples for Wine.
  query = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
          + "PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\n"
          + "CONSTRUCT\n" 
          + "{\n" 
          + "\t?sc rdfs:subClassOf vin:Wine\n"
          + "}\n" 
          + "{\n" 
          + "\t?sc rdfs:subClassOf vin:Wine\n" 
          + "}";
  
  System.out.println(query);
  System.out.println();
  
  // Construct all direct rdfs:subClassOf triples for Wine.
  result = ag.querySparql(false, AGResults.RDF_XML, query);
  System.out.println(result);
  System.out.println();
  
  // Construct all direct or inferred rdfs:subClassOf triples for Wine.
  result = ag.querySparql(true, AGResults.RDF_XML, query);
  System.out.println(result);
  System.out.println();
  
  // Ask if Sauternes is a subclass of Wine.
  query = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
          + "PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\n"
          + "ASK\n" 
          + "{\n"
          + "\tvin:Sauternes rdfs:subClassOf vin:Wine\n" 
          + "}\n";
  
  System.out.println(query);
  System.out.println();
  
  // Ask if Sauternes is a direct subclass of Wine.
  result = ag.querySparql(false, AGResults.SPARQL_XML, query);
  System.out.println(result);
  System.out.println();
  
  // Ask if Sauternes is a direct or inferred subclass of Wine.
  result = ag.querySparql(true, AGResults.SPARQL_XML, query);
  System.out.println(result);
  System.out.println();
  
  // Tell me about Sauternes.
  query = "PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\n"
          + "DESCRIBE vin:Sauternes\n";
  
  System.out.println(query);
  System.out.println();
  
  // Tell me all direct facts about Sauternes
  result = ag.querySparql(false, AGResults.NTRIPLES, query);
  System.out.println(result);
  System.out.println();
  
  // Tell me all direct and inferred facts about Sauternes
  result = ag.querySparql(true, AGResults.NTRIPLES, query);
  System.out.println(result);
  System.out.println();

The results follow:

  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
  CONSTRUCT
  {
      ?sc rdfs:subClassOf vin:Wine
  }
  {
      ?sc rdfs:subClassOf vin:Wine
  }
  
  <?xml version="1.0"?>
  <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:owl="http://www.w3.org/2002/07/owl#"
       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#EarlyHarvest">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#DessertWine">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
  </RDF>
  
  <?xml version="1.0"?>
  <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:owl="http://www.w3.org/2002/07/owl#"
       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SweetRiesling">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#EarlyHarvest">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#DessertWine">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
    <Description rdf:about="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest">
      <rdfs:subClassOf rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine"/>
    </Description>
  </RDF>
  
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
  ASK
  {
      vin:Sauternes rdfs:subClassOf vin:Wine
  }
  
  
  <?xml version="1.0"?>
  <sparql xmlns="http://www.w3.org/2005/sparql-results#">
    <head/>
    <boolean>false</boolean>
  </sparql>
  
  
  <?xml version="1.0"?>
  <sparql xmlns="http://www.w3.org/2005/sparql-results#">
    <head/>
    <boolean>true</boolean>
  </sparql>
  
  
  PREFIX vin: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
  DESCRIBE vin:Sauternes
  
  
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Bordeaux> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1031 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1032 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1033 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
  _:anon1032 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Medium> .
  _:anon1032 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasBody> .
  _:anon1032 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1031 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SauterneRegion> .
  _:anon1031 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#locatedIn> .
  _:anon1031 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1033 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#White> .
  _:anon1033 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasColor> .
  _:anon1033 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  
  
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Bordeaux> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1031 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1032 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1033 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon924 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon917 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon919 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon921 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Bordeaux> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1031 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1158 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon922 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1159 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon920 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1033 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon923 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#LateHarvest> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#PotableLiquid> .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon918 .
  <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sauternes> <http://www.w3.org/2000/01/rdf-schema#subClassOf> _:anon1032 .
  _:anon1032 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Medium> .
  _:anon1032 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasBody> .
  _:anon1032 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1160 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
  _:anon1160 <http://www.w3.org/2002/07/owl#oneOf> _:anon1162 .
  _:anon1162 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:anon1161 .
  _:anon1162 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Moderate> .
  _:anon922 <http://www.w3.org/2002/07/owl#cardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon922 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasBody> .
  _:anon922 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon920 <http://www.w3.org/2002/07/owl#cardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon920 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasSugar> .
  _:anon920 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1158 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Sweet> .
  _:anon1158 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasSugar> .
  _:anon1158 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon921 <http://www.w3.org/2002/07/owl#cardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon921 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasFlavor> .
  _:anon921 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1031 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SauterneRegion> .
  _:anon1031 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#locatedIn> .
  _:anon1031 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon917 <http://www.w3.org/2002/07/owl#cardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon917 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasMaker> .
  _:anon917 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon1161 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
  _:anon1161 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Strong> .
  _:anon1033 <http://www.w3.org/2002/07/owl#hasValue> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#White> .
  _:anon1033 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasColor> .
  _:anon1033 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon918 <http://www.w3.org/2002/07/owl#allValuesFrom> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Winery> .
  _:anon918 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasMaker> .
  _:anon918 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon919 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#madeFromGrape> .
  _:anon919 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon919 <http://www.w3.org/2002/07/owl#minCardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon1159 <http://www.w3.org/2002/07/owl#allValuesFrom> _:anon1160 .
  _:anon1159 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasFlavor> .
  _:anon1159 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon923 <http://www.w3.org/2002/07/owl#cardinality> "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
  _:anon923 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasColor> .
  _:anon923 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
  _:anon924 <http://www.w3.org/2002/07/owl#someValuesFrom> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Region> .
  _:anon924 <http://www.w3.org/2002/07/owl#onProperty> <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#locatedIn> .
  _:anon924 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .

Disconnecting

Finally, when you're done, always remember to disconnect.

  ag.disconnect();
Facts about Simple AllegroGraph AccessRDF feed
Foaf:name Simple AllegroGraph Access  +
Has end date 2 October 2008 16:00  +
Has location Winslow Building  +
Has organizer Jesse Weaver  +
Has start date 2 October 2008 15:30  +
Has title Simple AllegroGraph Access  +
Personal tools