org.semanticweb.triple.application
Class TripleServiceImpl

java.lang.Object
  extended byorg.semanticweb.triple.application.TripleServiceImpl
All Implemented Interfaces:
TripleService

public class TripleServiceImpl
extends java.lang.Object
implements TripleService

TRIPLE Service API

Version:
Author:
Andreas Harth http://www.deri.ie/

Constructor Summary
TripleServiceImpl()
           
 
Method Summary
 void add(java.net.URL uri)
          Add statements or rules in RDF/XML, N3, or TRIPLE syntax, according to the content type of the URI that contains the data.
 void addN3File(java.lang.String filename)
          Compiles the N3 definitions provided by the file and adds the content incrementally to the into XSB.
 void addN3Stream(java.io.InputStream n3Stream)
          Compiles the RDF definitions provided by the InputStream and adds the content temporarily to the internal Knowledge Base into the RDF model whose URI is constructed out of the provided namespace and localname.
 void addN3String(java.lang.String n3String)
          Compiles the N3 definitions provided by the file and adds the content incrementally to the into XSB.
 void addRDFFile(java.lang.String filename, java.lang.String ns, java.lang.String localname)
          Compiles the RDF definitions provided by the file and adds the content incrementally to the into the RDF model whose URI is constructed out of the provided namespace and localname.
 void addRDFFile(java.lang.String filename, java.lang.String ns, java.lang.String localname, java.lang.String appendix)
           
 void addRDFStream(java.io.InputStream rdfStream, java.lang.String ns, java.lang.String localname)
          Compiles the RDF definitions provided by the InputStream and adds the content temporarily to the internal Knowledge Base into the RDF model whose URI is constructed out of the provided namespace and localname.
 void addRDFString(java.lang.String rdfString, java.lang.String ns, java.lang.String localname)
          Compiles the RDF definitions provided by the String and adds the content incrementally to the into the RDF model whose URI is constructed out of the provided namespace and localname.
 void addRDFString(java.lang.String rdfString, java.lang.String ns, java.lang.String localname, java.lang.String appendix)
           
 void addTripleFile(java.lang.String filename)
          Compiles the Triple definitions contained in the file and adds the content incrementally to the internal Knowledge Base.
 void addTripleStream(java.io.InputStream ruleStream)
          Compiles the Triple definitions provided by the InputStream and adds the content incrementally to the internal Knowledge Base.
 void addTripleString(java.lang.String rules)
          Compiles the Triple definitions contained in the string and adds the content incrementally to the internal Knowledge Base.
 void addXSBFile(java.lang.String filename)
          Add XSB commands directly (suggested by Jose Luis).
 void addXSBStream(java.io.InputStream xsbStream)
          Add XSB commands directly (suggested by Jose Luis).
 void addXSBString(java.lang.String xsbString)
          Add XSB commands directly (suggested by Jose Luis).
 ResultSet askTripleQueryFile(java.lang.String filename)
          Ask a query that's stored in a file.
 ResultSet askTripleQueryStream(java.io.InputStream queryStream)
          Ask a query that's in a stream.
 ResultSet askTripleQueryString(java.lang.String queryString)
          Ask a query that's stored in a string.
 void closeTriple()
          Cleanup
 java.lang.String getDetails(java.lang.String ns, java.lang.String localname, java.lang.String appendix)
          Get the RDF/XML data back that has been added before.
 void initTriple(java.lang.String rmiLocation)
          Init.
 ResultSet query(java.net.URL uri)
          Ask a query in TRIPLE syntax according to the content type of the URI that contains the query.
 void removeModel(java.lang.String ns, java.lang.String localname)
          Deletes the content of the RDF model who's ID is given by the namespace and the localname.
 void removeN3File(java.lang.String ns, java.lang.String localname, java.lang.String appendix)
          Remove an RDF file.
 void removeRDFFile(java.lang.String ns, java.lang.String localname, java.lang.String appendix)
          Remove an RDF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleServiceImpl

public TripleServiceImpl()
Method Detail

initTriple

public void initTriple(java.lang.String rmiLocation)
                throws XSBException,
                       java.rmi.RemoteException
Init. Connect to XSB engine via RMI.

Specified by:
initTriple in interface TripleService
Throws:
XSBException
java.rmi.RemoteException

closeTriple

public void closeTriple()
                 throws XSBException,
                        java.rmi.RemoteException
Cleanup

Specified by:
closeTriple in interface TripleService
Throws:
XSBException
java.rmi.RemoteException

getDetails

public java.lang.String getDetails(java.lang.String ns,
                                   java.lang.String localname,
                                   java.lang.String appendix)
                            throws java.io.IOException
Get the RDF/XML data back that has been added before.

Specified by:
getDetails in interface TripleService
Throws:
java.io.IOException

add

public void add(java.net.URL uri)
         throws ParseException,
                java.io.IOException,
                XSBException,
                org.xml.sax.SAXException
Add statements or rules in RDF/XML, N3, or TRIPLE syntax, according to the content type of the URI that contains the data.

Specified by:
add in interface TripleService
Throws:
ParseException
java.io.IOException
XSBException
org.xml.sax.SAXException

query

public ResultSet query(java.net.URL uri)
                throws java.io.IOException,
                       ParseException,
                       XSBException
Ask a query in TRIPLE syntax according to the content type of the URI that contains the query.

Specified by:
query in interface TripleService
Throws:
java.io.IOException
ParseException
XSBException

removeModel

public void removeModel(java.lang.String ns,
                        java.lang.String localname)
                 throws XSBException,
                        java.rmi.RemoteException
Deletes the content of the RDF model who's ID is given by the namespace and the localname.

Specified by:
removeModel in interface TripleService
Throws:
XSBException
java.rmi.RemoteException

askTripleQueryFile

public ResultSet askTripleQueryFile(java.lang.String filename)
                             throws ParseException,
                                    XSBException,
                                    java.io.IOException
Ask a query that's stored in a file.

Specified by:
askTripleQueryFile in interface TripleService
Throws:
ParseException
XSBException
java.io.IOException

askTripleQueryString

public ResultSet askTripleQueryString(java.lang.String queryString)
                               throws ParseException,
                                      XSBException,
                                      java.io.IOException
Ask a query that's stored in a string.

Specified by:
askTripleQueryString in interface TripleService
Throws:
ParseException
XSBException
java.io.IOException

askTripleQueryStream

public ResultSet askTripleQueryStream(java.io.InputStream queryStream)
                               throws ParseException,
                                      XSBException,
                                      java.io.IOException
Ask a query that's in a stream.

Specified by:
askTripleQueryStream in interface TripleService
Throws:
ParseException
XSBException
java.io.IOException

removeRDFFile

public void removeRDFFile(java.lang.String ns,
                          java.lang.String localname,
                          java.lang.String appendix)
                   throws org.xml.sax.SAXException,
                          java.io.IOException,
                          XSBException
Remove an RDF file.

Specified by:
removeRDFFile in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

removeN3File

public void removeN3File(java.lang.String ns,
                         java.lang.String localname,
                         java.lang.String appendix)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         XSBException
Remove an RDF file.

Specified by:
removeN3File in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addTripleString

public void addTripleString(java.lang.String rules)
                     throws ParseException,
                            XSBException
Compiles the Triple definitions contained in the string and adds the content incrementally to the internal Knowledge Base.

Specified by:
addTripleString in interface TripleService
Throws:
ParseException
XSBException

addTripleFile

public void addTripleFile(java.lang.String filename)
                   throws ParseException,
                          java.io.IOException,
                          XSBException
Compiles the Triple definitions contained in the file and adds the content incrementally to the internal Knowledge Base.

Specified by:
addTripleFile in interface TripleService
Throws:
ParseException
java.io.IOException
XSBException

addTripleStream

public void addTripleStream(java.io.InputStream ruleStream)
                     throws ParseException,
                            XSBException
Compiles the Triple definitions provided by the InputStream and adds the content incrementally to the internal Knowledge Base.

Specified by:
addTripleStream in interface TripleService
Throws:
ParseException
XSBException

addN3File

public void addN3File(java.lang.String filename)
               throws java.io.IOException,
                      XSBException
Compiles the N3 definitions provided by the file and adds the content incrementally to the into XSB.

Specified by:
addN3File in interface TripleService
Throws:
java.io.IOException
XSBException

addN3String

public void addN3String(java.lang.String n3String)
                 throws java.io.IOException,
                        XSBException
Compiles the N3 definitions provided by the file and adds the content incrementally to the into XSB.

Specified by:
addN3String in interface TripleService
Throws:
java.io.IOException
XSBException

addN3Stream

public void addN3Stream(java.io.InputStream n3Stream)
                 throws java.io.IOException,
                        XSBException
Compiles the RDF definitions provided by the InputStream and adds the content temporarily to the internal Knowledge Base into the RDF model whose URI is constructed out of the provided namespace and localname.

Specified by:
addN3Stream in interface TripleService
Throws:
java.io.IOException
XSBException

addRDFFile

public void addRDFFile(java.lang.String filename,
                       java.lang.String ns,
                       java.lang.String localname)
                throws org.xml.sax.SAXException,
                       java.io.IOException,
                       XSBException
Compiles the RDF definitions provided by the file and adds the content incrementally to the into the RDF model whose URI is constructed out of the provided namespace and localname.

Specified by:
addRDFFile in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addRDFFile

public void addRDFFile(java.lang.String filename,
                       java.lang.String ns,
                       java.lang.String localname,
                       java.lang.String appendix)
                throws org.xml.sax.SAXException,
                       java.io.IOException,
                       XSBException
Specified by:
addRDFFile in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addRDFString

public void addRDFString(java.lang.String rdfString,
                         java.lang.String ns,
                         java.lang.String localname)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         XSBException
Compiles the RDF definitions provided by the String and adds the content incrementally to the into the RDF model whose URI is constructed out of the provided namespace and localname.

Specified by:
addRDFString in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addRDFString

public void addRDFString(java.lang.String rdfString,
                         java.lang.String ns,
                         java.lang.String localname,
                         java.lang.String appendix)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         XSBException
Specified by:
addRDFString in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addRDFStream

public void addRDFStream(java.io.InputStream rdfStream,
                         java.lang.String ns,
                         java.lang.String localname)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         XSBException
Compiles the RDF definitions provided by the InputStream and adds the content temporarily to the internal Knowledge Base into the RDF model whose URI is constructed out of the provided namespace and localname.

Specified by:
addRDFStream in interface TripleService
Throws:
org.xml.sax.SAXException
java.io.IOException
XSBException

addXSBFile

public void addXSBFile(java.lang.String filename)
                throws java.io.IOException,
                       XSBException
Add XSB commands directly (suggested by Jose Luis).

Specified by:
addXSBFile in interface TripleService
Throws:
java.io.IOException
XSBException

addXSBString

public void addXSBString(java.lang.String xsbString)
                  throws java.io.IOException,
                         XSBException
Add XSB commands directly (suggested by Jose Luis).

Specified by:
addXSBString in interface TripleService
Throws:
java.io.IOException
XSBException

addXSBStream

public void addXSBStream(java.io.InputStream xsbStream)
                  throws java.io.IOException,
                         XSBException
Add XSB commands directly (suggested by Jose Luis).

Specified by:
addXSBStream in interface TripleService
Throws:
java.io.IOException
XSBException