Permalink
Browse files

Updated to Scala 2.9, added a Main method

  • Loading branch information...
1 parent 99f6d5d commit 090a223045501341d1c2048e5c965f773360a02b @LeifW committed Aug 12, 2011
Showing with 23 additions and 6 deletions.
  1. +4 −6 build.sbt
  2. +19 −0 src/main/scala/Main.scala
View
@@ -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"
)
View
@@ -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.