jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1153574 - in /incubator/jena/Scratch/AFS/trunk: ./ src-dev/dev/ src/riot/io/
Date Wed, 03 Aug 2011 16:43:05 GMT
Author: andy
Date: Wed Aug  3 16:43:03 2011
New Revision: 1153574

URL: http://svn.apache.org/viewvc?rev=1153574&view=rev
Log: (empty)

Added:
    incubator/jena/Scratch/AFS/trunk/data
Removed:
    incubator/jena/Scratch/AFS/trunk/D.trig
    incubator/jena/Scratch/AFS/trunk/D.ttl
    incubator/jena/Scratch/AFS/trunk/Q.arq
    incubator/jena/Scratch/AFS/trunk/Q.rq
    incubator/jena/Scratch/AFS/trunk/build.xml
    incubator/jena/Scratch/AFS/trunk/dwim
    incubator/jena/Scratch/AFS/trunk/index-build
    incubator/jena/Scratch/AFS/trunk/index-copy
    incubator/jena/Scratch/AFS/trunk/index-dump
    incubator/jena/Scratch/AFS/trunk/nodes-build
    incubator/jena/Scratch/AFS/trunk/owlf.ofn
    incubator/jena/Scratch/AFS/trunk/owlf2.ofn
    incubator/jena/Scratch/AFS/trunk/prefixes.ttl
    incubator/jena/Scratch/AFS/trunk/rewrite
    incubator/jena/Scratch/AFS/trunk/run
    incubator/jena/Scratch/AFS/trunk/tdbplus
    incubator/jena/Scratch/AFS/trunk/test.omn
    incubator/jena/Scratch/AFS/trunk/testbpt
Modified:
    incubator/jena/Scratch/AFS/trunk/src-dev/dev/RunAFS.java
    incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputStreamBase.java
    incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputStreamWriter.java

Added: incubator/jena/Scratch/AFS/trunk/data
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/data?rev=1153574&view=auto
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/data (added)
+++ incubator/jena/Scratch/AFS/trunk/data Wed Aug  3 16:43:03 2011
@@ -0,0 +1,6 @@
+@prefix : <x> .
+<a> :b 123 .
+"foo" "bar" * .
+*a * .
+
+

Modified: incubator/jena/Scratch/AFS/trunk/src-dev/dev/RunAFS.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src-dev/dev/RunAFS.java?rev=1153574&r1=1153573&r2=1153574&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src-dev/dev/RunAFS.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src-dev/dev/RunAFS.java Wed Aug  3 16:43:03 2011
@@ -17,30 +17,27 @@
  */
 
 package dev;
-import java.util.ArrayList ;
-import java.util.Iterator ;
-import java.util.List ;
-
-import matcher.Match ;
-import matcher.PatternMatch ;
-import matcher.View ;
-import org.openjena.atlas.lib.Bytes ;
-import org.openjena.atlas.logging.Log ;
-import storage.varrecord.VarRecordBuffer ;
-import structure.radix.RadixIndex ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.iri.IRI ;
-import com.hp.hpl.jena.iri.IRIFactory ;
-import com.hp.hpl.jena.iri.Violation ;
-import com.hp.hpl.jena.iri.ViolationCodes ;
-import com.hp.hpl.jena.sparql.core.BasicPattern ;
-import com.hp.hpl.jena.sparql.core.Var ;
-import com.hp.hpl.jena.sparql.engine.optimizer.reorder.PatternTriple ;
-import com.hp.hpl.jena.sparql.sse.SSE ;
-import com.hp.hpl.jena.tdb.base.record.Record ;
-import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.index.bplustree.BPlusTreeParams ;
+import java.io.FileInputStream ;
+import java.io.InputStream ;
+import java.util.Iterator ;
+import java.util.List ;
+
+import org.openjena.atlas.io.BufferingWriter ;
+import org.openjena.atlas.logging.Log ;
+import org.openjena.riot.tokens.Token ;
+import org.openjena.riot.tokens.Tokenizer ;
+import org.openjena.riot.tokens.TokenizerFactory ;
+import riot.io.TokenInputStream ;
+import riot.io.TokenInputStreamBase ;
+import riot.io.TokenOutputStream ;
+import riot.io.TokenOutputStreamWriter ;
+import storage.varrecord.VarRecordBuffer ;
+
+import com.hp.hpl.jena.iri.IRI ;
+import com.hp.hpl.jena.iri.IRIFactory ;
+import com.hp.hpl.jena.iri.Violation ;
+import com.hp.hpl.jena.iri.ViolationCodes ;
+import com.hp.hpl.jena.tdb.base.record.Record ;
 
 public class RunAFS
 {
@@ -55,7 +52,25 @@ public class RunAFS
 
     public static void main(String ... args) throws Exception
     {
-
+        InputStream input = new FileInputStream("data") ;
+        Tokenizer tokenizer = TokenizerFactory.makeTokenizerUTF8(input) ;
+        
+        TokenInputStream in = new TokenInputStreamBase("IN", tokenizer) ;
+        
+        BufferingWriter w = BufferingWriter.create(System.out) ;
+        TokenOutputStreamWriter out = new TokenOutputStreamWriter("OUT", w) ;
+        
+        for ( ; in.hasNext() ; )
+        {
+            out.startTuple() ;
+            List<Token> line = in.next() ;
+            //System.out.println(line) ; System.out.flush() ;
+            
+            for ( Token t : line )
+                out.sendToken(t) ;
+            out.endTuple() ;
+        }
+        w.flush() ;
     }
 
     static IRIFactory iriFactory = new IRIFactory();

Modified: incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputStreamBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputStreamBase.java?rev=1153574&r1=1153573&r2=1153574&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputStreamBase.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputStreamBase.java Wed Aug  3 16:43:03
2011
@@ -107,7 +107,7 @@ public class TokenInputStreamBase implem
                 String iri ;
                 if ( ns == null)
                 {
-                    Log.warn("Can'transformTokenToTuple resolve '"+token.toString(false)+"'",
ns) ;
+                    log.warn("Can't resolve '"+token.toString(false)+"'", ns) ;
                     iri = "unresolved:"+token.getImage()+":"+token.getImage2() ;
                 }
                 else

Modified: incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputStreamWriter.java?rev=1153574&r1=1153573&r2=1153574&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputStreamWriter.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputStreamWriter.java Wed Aug  3 16:43:03
2011
@@ -254,7 +254,10 @@ public class TokenOutputStreamWriter imp
             // Not RDF
             case KEYWORD:
                 return token.getImage() ;
-            case CNTRL:
+            case CNTRL:
+                if ( token.getCntrlCode() == -1 )
+                    return "*" ; 
+                return "*"+Character.toString((char)token.getCntrlCode()) ;
             case VAR:
             case HEX:
                 
@@ -280,7 +283,7 @@ public class TokenOutputStreamWriter imp
             case MINUS:
             case STAR:
             case SLASH:
-            case RSLASH:
+            case RSLASH:
             default:
                 notImplemented(token) ;
                 return null ;



Mime
View raw message