<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/unit/sparql_parsing_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-sparql Release 0.0.1 (July 15th 2008) 
+sparql Release 0.0.1 (July 17th 2008) 
 ===================================
 
 **Git**:  [http://github.com/pius/sparql](http://github.com/pius/sparql)   
@@ -16,16 +16,17 @@ sparql is a library for Ruby that formally implements the [SPARQL grammar](http:
 FEATURE LIST
 ------------
                                                                               
-1. **As of right now (20:28 EST, July 15, 2008) can parse basic SPARQL statements**: When finished, this library will be able to parse arbitrary SPARQL queries and can serve as a maintainable reference implementation in Ruby.
+1. **As of right now (00:10 EST, July 17, 2008) can parse basic SPARQL statements, check the test cases for precisely what it can support**: When finished, this library will be able to parse arbitrary SPARQL queries and can serve as a maintainable reference implementation in Ruby.
 
 2.  **Starting point for providing SPARQL endpoints for arbitrary datastores**: When completed, this library will provide hooks that allow a Ruby developer to easily define a translation from SPARQL to another query language or API of their choosing.  Ideally, this will be done using a simple YAML configuration file.
 
 3. **Fully Composable**: Because parsing expression grammars are closed under composition, you can compose this grammar with other Treetop grammars with relative ease.
 
+
 USAGE
 -----
 
-First of all, it's worth noting that this library isn't ready to use.  If you insist on using it, then you'll need to do the following:
+Though this library only parses a small subset of SPARQL and I've not added all of the API methods yet, it **is** ready to start playing with.
 
 1. **Install the Gem**
 
@@ -70,13 +71,13 @@ Anyway, you can get started by doing the following in IRB.
 
 4. **Read the documentation**
 
-Actually, scratch that.  I don't have very good documentation yet.  :(  But I do encourage you to take a look at lib/sparql/sparql.treetop and get a sense of the grammar.  In addition, check out the [formal specification of the SPARQL grammar](http://www.w3.org/TR/rdf-sparql-query/#grammar) so you can see how the Treetop grammar relates to it.
+Actually, read the tests -- they will show you the forms that are supported.  Take a look at lib/sparql/sparql.treetop and get a sense of the grammar.  In addition, check out the [formal specification of the SPARQL grammar](http://www.w3.org/TR/rdf-sparql-query/#grammar) so you can see how the Treetop grammar relates to it.
 
 5. **Contribute!**
 
 Fork my repository (http://github.com/pius/sparql), make some changes, and send along a pull request!
 
-**I need help with IRIs.**  If you could take a look at the RDF grammar and write the code for parsing [70] (IRI_REF) in Treetop, that would be a great help.
+The best way to contribute is to add a test case for a specific SPARQL query that does not parse and then tweak the grammar such that your new test case plus all the others pass.
                                                                               
 
 COPYRIGHT</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -148,7 +148,7 @@ table.report tr.dark {
 &lt;/script&gt;
     &lt;/head&gt;
   &lt;body&gt;&lt;h3&gt;C0 code coverage information&lt;/h3&gt;
-    &lt;p&gt;Generated on Wed Jul 16 22:50:25 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
+    &lt;p&gt;Generated on Thu Jul 17 00:24:06 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
       &lt;/p&gt;
     &lt;hr/&gt;
     &lt;table class='report'&gt;&lt;thead&gt;&lt;tr&gt;&lt;td class='heading'&gt;Name&lt;/td&gt;</diff>
      <filename>coverage/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -553,7 +553,7 @@ span.run100 {
 &lt;/style&gt;
     &lt;/head&gt;
   &lt;body&gt;&lt;h3&gt;C0 code coverage information&lt;/h3&gt;
-    &lt;p&gt;Generated on Wed Jul 16 22:50:25 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
+    &lt;p&gt;Generated on Thu Jul 17 00:24:06 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
       &lt;/p&gt;
     &lt;hr/&gt;
     &lt;pre&gt;&lt;span class='marked0'&gt;Code reported as executed by Ruby looks like this...</diff>
      <filename>coverage/lib-sparql-execute_sparql_rb.html</filename>
    </modified>
    <modified>
      <diff>@@ -553,7 +553,7 @@ span.run100 {
 &lt;/style&gt;
     &lt;/head&gt;
   &lt;body&gt;&lt;h3&gt;C0 code coverage information&lt;/h3&gt;
-    &lt;p&gt;Generated on Wed Jul 16 22:50:25 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
+    &lt;p&gt;Generated on Thu Jul 17 00:24:06 -0400 2008 with &lt;a href='http://eigenclass.org/hiki/rcov'&gt;rcov 0.8.1.2&lt;/a&gt;
       &lt;/p&gt;
     &lt;hr/&gt;
     &lt;pre&gt;&lt;span class='marked0'&gt;Code reported as executed by Ruby looks like this...</diff>
      <filename>coverage/lib-sparql_rb.html</filename>
    </modified>
    <modified>
      <diff>@@ -11,8 +11,7 @@ grammar Graph
 	
 	rule a_graph_or_triple_or_something
 		graph_graph_pattern / 
-		group_graph_pattern / 
-		triple_pattern / 
+		group_graph_pattern /
 		triples_block / 
 		blank_node / 
 		collection / 
@@ -23,27 +22,11 @@ grammar Graph
 		verb / 
 		object_list
 	end
-		
-	rule graph_graph_pattern
-		'GRAPH' space var_or_iriref space group_graph_pattern
-	end
-	
-	rule group_graph_pattern
-		 '{' space (triples_block space)? ( ( graph_pattern_not_triples / filter ) space ('.' space)? triples_block? space)* '}'
-	end
 	
 	rule triples_block
 		triples_same_subject ( space '.' space triples_block? )?
 	end
 
-	rule triple_pattern
-		subject space predicate space object space '.' {
-			def subject
-				subject
-			end
-		}
-	end
-	
 	rule blank_node
 		blank_node_label / anon
 	end
@@ -52,18 +35,10 @@ grammar Graph
 		'(' space series_of_graph_nodes space ')'
 	end
 	
-	rule subject
-		variable
-	end
-	
 	rule object
 		graph_node
 	end
 	
-	rule predicate
-		variable / iriref
-	end
-	
 	rule variable
 	  '?' [a-z]+
 	end
@@ -76,6 +51,19 @@ grammar Graph
 		'OPTIONAL' space group_graph_pattern
 	end
 	
+	rule graph_graph_pattern
+		'GRAPH' space var_or_iriref space group_graph_pattern
+	end
+	
+	rule group_or_union_graph_pattern
+		group_graph_pattern ( space 'UNION' group_graph_pattern )*
+	end
+	
+	# '{ ?v ?p &quot;cat&quot; }'
+	rule group_graph_pattern
+		 '{' space (triples_block space)? ( ( graph_pattern_not_triples / filter ) space ('.' space)? (triples_block space)?)* '}'
+	end
+	
 	rule triples_same_subject
 	  var_or_term space property_list_not_empty / triples_node space property_list
 	end
@@ -84,10 +72,6 @@ grammar Graph
 		 collection / blank_node_property_list
 	end
 	
-	rule group_or_union_graph_pattern
-		group_graph_pattern ( space 'UNION' group_graph_pattern )*
-	end
-	
 	rule graph_node
 		var_or_term / triples_node
 	end
@@ -123,4 +107,8 @@ grammar Graph
 	rule object_list
 		object (',' space object)*
 	end
+	
+	rule filter
+		'FILTER' space constraint
+	end
 end
\ No newline at end of file</diff>
      <filename>lib/sparql/graph.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -19,8 +19,4 @@ grammar Series
 	rule series_of_variables
 		variable space series_of_variables / variable
 	end
-
-	rule series_of_triple_patterns
-		triple_pattern space series_of_triple_patterns / triple_pattern
-	end
 end
\ No newline at end of file</diff>
      <filename>lib/sparql/series.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 # Author::    Pius Uzamere, The Uyiosa Corporation (http://uyiosa.com/)
 # Copyright:: 2008 Pius Uzamere
 # License::   MIT
+# query = 'SELECT ?v WHERE { ?v ?p &quot;cat&quot; }'
 
 grammar Sparql
 	include Primitives
@@ -33,7 +34,8 @@ grammar Sparql
 	end
 	
 	rule select_query
-	   'SELECT' space (( 'DISTINCT' / 'REDUCED' ) space)? ( series_of_variables / '*' ) space series_of_dataset_clauses? space where space solution_modifier {
+	   'SELECT' space (( 'DISTINCT' / 'REDUCED' ) space)? ( series_of_variables / '*' ) space (series_of_dataset_clauses space)? where space solution_modifier 
+	{
 		def query_type
 			&quot;SELECT&quot;
 		end
@@ -77,7 +79,7 @@ grammar Sparql
 	end
 
 	rule solution_modifier
-		(order_clause? space limit_offset_clauses?) / order_clause? / limit_offset_clauses?
+		(order_clause space limit_offset_clauses)? / order_clause? / limit_offset_clauses?
 	end
 	
 	rule order_clause
@@ -125,10 +127,6 @@ grammar Sparql
 		iriref arg_list
 	end
 	
-	rule filter
-		'FILTER' space constraint
-	end
-	
 	rule dataset_clause
 		'FROM' space ( default_graph_clause / named_graph_clause )
 	end</diff>
      <filename>lib/sparql/sparql.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,6 @@ require 'rubygems'
 require 'pathname'
 require 'treetop'
 
-#'WHERE'? space '{' space series_of_triple_patterns space '}'
-
 # rule triples_same_subject
 #   var_or_term space property_list_not_empty / triples_node space property_list
 # end</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,18 +8,48 @@ describe &quot;GraphParser&quot;, '#parse' do
     @parser = GraphParser.new
   end
   
-  it &quot;should recognize triple blocks&quot; do
+  it &quot;should recognize a triple block where the predicate is a prefixed name&quot; do
     some_triple_block = '?x foaf:knows ?y'
     @parser.parse(some_triple_block).should_not == nil
     @parser.parse(some_triple_block).triples_same_subject.text_value.should == '?x foaf:knows ?y'
   end
   
+  it &quot;should recognize a triple block where the predicate is a variable&quot; do
+    some_triple_block = '?x ?theta ?y'
+    @parser.parse(some_triple_block).should_not == nil
+    @parser.parse(some_triple_block).triples_same_subject.text_value.should == '?x ?theta ?y'
+  end
+  
   it &quot;should recognize 'triples_same_subject'&quot; do
     some_triple_block = '?x foaf:knows ?y'
     triples_same_subject = @parser.parse(some_triple_block).triples_same_subject
     triples_same_subject.property_list_not_empty.text_value.should == &quot;foaf:knows ?y&quot;
   end
   
+  it &quot;should recognize 'triples_same_subject' when the predicate is a variable&quot; do
+    some_triple_block = '?x ?theta ?y'
+    triples_same_subject = @parser.parse(some_triple_block).triples_same_subject
+    triples_same_subject.property_list_not_empty.text_value.should == '?theta ?y'
+  end
+  
+  it &quot;should recognize 'triples_same_subject' when the object is a literal&quot; # do
+  #     some_triple_block = '?x ?theta &quot;foo&quot;'
+  #     triples_same_subject = @parser.parse(some_triple_block).triples_same_subject
+  #     triples_same_subject.property_list_not_empty.text_value.should == '?theta ?y &quot;foo&quot;'
+  #   end
+  
+  it &quot;should recognize a 'group_graph_pattern'&quot; # do
+  #         some_group_graph_pattern = '?v ?p &quot;cat&quot;'
+  #         parsed = @parser.parse(some_group_graph_pattern)
+  #         parsed.should_not == nil
+  #       end
+  
+  it &quot;should recognize a 'graph_pattern_not_triples'&quot; # do
+  #     some_graph_pattern_not_triples = '{ ?v ?p &quot;cat&quot; }'
+  #     parsed = @parser.parse(some_graph_pattern_not_triples)
+  #     parsed.should_not == nil
+  #   end
+  
   # it &quot;should recognize a basic SELECT query with one variable and one triple pattern&quot; do
   #   basic_valid_select_query = 'SELECT ?foo WHERE { ?x foaf:knows ?y . }'
   #   parser = SparqlParser.new</diff>
      <filename>spec/unit/graph_parsing_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,7 @@
 require 'pathname'
 
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
-		#'http://xmlns.com/foaf/0.1/' / 'foaf:knows' / 'foaf:name'
-		#'&lt;' ([^&lt;&gt;&quot;{}|^`\]-[#x00-#x20])* '&gt;'
-		# 		( [A-Za-z0-9] / '.' )
+
 describe &quot;IriParser&quot;, '#parse' do
   
   before(:all) do
@@ -11,13 +9,12 @@ describe &quot;IriParser&quot;, '#parse' do
   end
   
   it &quot;should be able to recognize an iriref in brackets&quot; do
-    the_iriref = &quot;&lt;xmlns.com&gt;&quot;
+    the_iriref = &quot;&lt;http://purl.org/dc/elements/1.1/title&gt;&quot;
     @parser.parse(the_iriref).should_not == nil
   end
   
   it &quot;should be able to recognize an 'iri_ref'&quot; do
-    #the_iri_ref = &quot;&lt;http://xmlns.com/foaf/0.1/&gt;&quot;
-    the_iri_ref = &quot;&lt;xmlns.com&gt;&quot;
+    the_iri_ref = &quot;&lt;http://xmlns.com/foaf/0.1/&gt;&quot;
     @parser.parse(the_iri_ref).should_not == nil
   end
   </diff>
      <filename>spec/unit/iri_parsing_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/unit/check_parsing_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f8092083d88cba2505854a02afcfd61b5866d34c</id>
    </parent>
  </parents>
  <author>
    <name>Pius Uzamere</name>
    <email>pius+git@alum.mit.edu</email>
  </author>
  <url>http://github.com/pius/sparql/commit/1963c6139e1177378b38d6a5034b02fc723d154e</url>
  <id>1963c6139e1177378b38d6a5034b02fc723d154e</id>
  <committed-date>2008-07-16T21:38:59-07:00</committed-date>
  <authored-date>2008-07-16T21:38:59-07:00</authored-date>
  <message>the library is finally ready for other folks to start hacking on it</message>
  <tree>2feef4c6d782408b7cbdca61f5c86deca181507b</tree>
  <committer>
    <name>Pius Uzamere</name>
    <email>pius+git@alum.mit.edu</email>
  </committer>
</commit>
