org.ilrt.inkling.api
Class NTReader

java.lang.Object
  |
  +--org.ilrt.inkling.api.NTReader
All Implemented Interfaces:
LoaderInterface

public class NTReader
extends java.lang.Object
implements LoaderInterface

This is a very very basic Ntriples parser with no datatyping or language 
support.

It will try and read Ntriples document in and interpret it as a query or
an RDF file depending on which method is called.

Because it's here, theoretically you can use Tinkling on its own without 
any external classes; however you would probably be better off using RIO 
or ARP.

The N3Reader.java class uses Jena's N3 parser and code by Andy Seaborne, 
which returns Ntriples; therefore this class is also used there.


Constructor Summary
NTReader()
           
 
Method Summary
 GraphInterface loadGraph(java.lang.String fn)
          LoaderInterface function
 GraphInterface loadGraph(java.lang.String url, GraphInterface rdf)
          LoaderInterface function
 ComplexQuery parseStringToQuery(java.lang.String string)
          Converts a String to an Ntriples query, where the string contains multiple ntriples lines.
 Graph parseStringToStatement(java.lang.String string)
          read in an Ntriples Stringand return a Graph
 Graph parseStringToStatement(java.lang.String string, GraphInterface gr)
          read in an Ntriples text file by filename and return the Graph passed to it
 ComplexQuery parseToQuery(java.lang.String fn)
          Read in an Ntriples text file and return a ComplexQuery for more details see the RDF Query test work: http://www.w3.org/2003/03/rdfqr-tests/ An ntriples file can (unofficially and experimentally) be interpreted as a query, with bnodes representing variables.
 Graph parseToStatement(java.lang.String fn)
          Read in an Ntriples text file by filename and return a Graph
 Graph parseToStatement(java.lang.String fn, GraphInterface gr)
          read in an Ntriples text file by filename and return a Graph
 Query processTripleToQuery(java.lang.String part)
          Nasty Ntriples parser, returning a Query given a String (assumed to be a single line of NTriples)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NTReader

public NTReader()
Method Detail

loadGraph

public GraphInterface loadGraph(java.lang.String fn)
LoaderInterface function
Specified by:
loadGraph in interface LoaderInterface

loadGraph

public GraphInterface loadGraph(java.lang.String url,
                                GraphInterface rdf)
LoaderInterface function
Specified by:
loadGraph in interface LoaderInterface

parseToQuery

public ComplexQuery parseToQuery(java.lang.String fn)
Read in an Ntriples text file and return a ComplexQuery for more details see the RDF Query test work: http://www.w3.org/2003/03/rdfqr-tests/ An ntriples file can (unofficially and experimentally) be interpreted as a query, with bnodes representing variables. Predicates can also be blank/varianbles under this interpretation.

parseStringToQuery

public ComplexQuery parseStringToQuery(java.lang.String string)
Converts a String to an Ntriples query, where the string contains multiple ntriples lines.

processTripleToQuery

public Query processTripleToQuery(java.lang.String part)
Nasty Ntriples parser, returning a Query given a String (assumed to be a single line of NTriples)

parseToStatement

public Graph parseToStatement(java.lang.String fn)
Read in an Ntriples text file by filename and return a Graph

parseToStatement

public Graph parseToStatement(java.lang.String fn,
                              GraphInterface gr)
read in an Ntriples text file by filename and return a Graph

parseStringToStatement

public Graph parseStringToStatement(java.lang.String string,
                                    GraphInterface gr)
read in an Ntriples text file by filename and return the Graph passed to it

parseStringToStatement

public Graph parseStringToStatement(java.lang.String string)
read in an Ntriples Stringand return a Graph