--- a/src/main/scala/SPARQL.scala Sun Feb 14 10:00:21 2010 -0500
+++ b/src/main/scala/SPARQL.scala Sun Feb 14 12:49:06 2010 -0500
@@ -19,7 +19,7 @@
}
case class Construct(head:TriplesBlock, gp:GraphPattern)
case class SparqlAttributeList(attributelist:List[Var]) {
- override def toString = "SELECT "+(attributelist.toList.sortWith((l, r) => l.s < r.s).mkString(", "))
+ override def toString = "SELECT "+(attributelist.toList.sortWith((l, r) => l.s < r.s).mkString(" "))
}
sealed abstract class GraphPattern {
@@ -111,7 +111,7 @@
}
case class TriplesBlock(triplepatterns:List[TriplePattern]) extends GraphPattern {
- override def toString = "{\n " + (triplepatterns.toList.map(s => s.toString.replace("\n", "\n ")).mkString(".\n ")) + "\n}"
+ override def toString = "{\n " + (triplepatterns.toList.map(s => s.toString.replace("\n", "\n ")).mkString("", " .\n ", " .\n")) + "}"
override def equals (other:Any):Boolean = other match {
case that:TriplesBlock => (that canEqual this) && triplepatterns.toSet == that.triplepatterns.toSet
case _ => false
@@ -153,7 +153,10 @@
}
case class Literal(lit:RDFLiteral) {
- override def toString = "" + lit
+ override def toString = lit match {
+ case RDFLiteral(s, RDFLiteral.IntegerDatatype) => s
+ case _ => lit.toString
+ }
}
case class Var(s:String) {