Skip to content

Commit

Permalink
Updated to Scala 2.9, added a Main method
Browse files Browse the repository at this point in the history
  • Loading branch information
LeifW committed Aug 12, 2011
1 parent 99f6d5d commit 090a223
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build.sbt
@@ -1,10 +1,8 @@
// scalaVersion := "2.9.0-1"
scalaVersion := "2.9.0-1"

resolvers += "Twitter Repo" at "http://maven.twttr.com"
resolvers += "funes" at "http://funesrdf.info/maven"

libraryDependencies ++= Seq(
"com.twitter" %% "json" % "2.1.6",
"org.scardf" % "scardf" % "0.5" from "http://scardf.googlecode.com/files/scardf-0.5.jar",
"joda-time" % "joda-time" % "1.6.1", // Used by scardf
"org.scalatest" %% "scalatest" % "1.5.1" % "test"
"org.scardf" % "scardf" % "0.6-SNAPSHOT",
"org.scalatest" %% "scalatest" % "1.6.1" % "test"
)
19 changes: 19 additions & 0 deletions src/main/scala/Main.scala
@@ -0,0 +1,19 @@
import org.scardf.{Turtle, NTriple, UriRef, Serializator}
//import org.scardf.jena.JenaSerializator
import java.io.{BufferedReader, InputStreamReader, FileReader}

object Main {
def main( args:Array[String] ) {
args match {
case Array(filename, startNode) =>
val file = new BufferedReader(new FileReader(filename))
val graph = new Serializator(NTriple) readFrom file
println( Treeify( graph/UriRef(startNode) ) )
case Array(startNode) =>
val stdin = new BufferedReader(new InputStreamReader(System.in))
val graph = new Serializator(NTriple) readFrom stdin
println( Treeify( graph/UriRef(startNode) ) )
case other => println("Usage: treeify <rdf_graph.nt> <start-node> ")
}
}
}

0 comments on commit 090a223

Please sign in to comment.