JTP API Documentation

jtp.fol.parser
Interface FirstOrderLogicParser

All Known Implementing Classes:
KIF2CNF, jtp.fol.rdf.RDFParser

public interface FirstOrderLogicParser

This interface performs parsing of first-order logical text. The content can be either specified by a URL where it is located, or a Reader from which it can be extracted. The result of the parsing is a ClauseIterator.


Method Summary
 String getLanguage()
          returns the name of the language of this parser.
 boolean getPolarity()
          A logical text is parsed in different ways depending on whether it is interpreted as an assertion or a query.
 ClauseIterator parse(Reader rdr)
          parses the contents extracted from the given Reader
 ClauseIterator parse(Reader rdr, URL url)
          parses the contents extracted from the given Reader.
 ClauseIterator parse(URL url)
          parses the contents retrieved from the given URL
 ClauseIterator parse(URL url, URL publicLocation)
          parses the contents retrieved from the given URL
 void setPolarity(boolean polarity)
          tells the parser whether to interpret the text as an assertion or a query.
 

Method Detail

parse

public ClauseIterator parse(Reader rdr)
                     throws ParsingException
parses the contents extracted from the given Reader

Parameters:
rdr - the reader to read the content stream from.
Returns:
the iterator of clauses resulting from parsing content
ParsingException

parse

public ClauseIterator parse(Reader rdr,
                            URL url)
                     throws ParsingException
parses the contents extracted from the given Reader. The public location of the document is set to the URL provided.

Parameters:
rdr - the reader to read the content stream from.
url - the public location for the document, i.e. where this document is officially supposed to be coming from.
Returns:
the iterator of clauses resulting from parsing content
ParsingException

parse

public ClauseIterator parse(URL url)
                     throws ParsingException
parses the contents retrieved from the given URL

Parameters:
url - the location of content
Returns:
the iterator of clauses resulting from parsing content
ParsingException

parse

public ClauseIterator parse(URL url,
                            URL publicLocation)
                     throws ParsingException
parses the contents retrieved from the given URL

Parameters:
url - the actual location of content
publicLocation - the public location for the document, i.e. where this document is officially supposed to be coming from.
Returns:
the iterator of clauses resulting from parsing content
ParsingException

getPolarity

public boolean getPolarity()
A logical text is parsed in different ways depending on whether it is interpreted as an assertion or a query. This method returns true if the parser is interpreting input as an assertion.

Returns:
if the parser is interpreting input as an assertion.

setPolarity

public void setPolarity(boolean polarity)
tells the parser whether to interpret the text as an assertion or a query.

Parameters:
polarity - true if input is to be interpreted as an assertion.

getLanguage

public String getLanguage()
returns the name of the language of this parser.

Returns:
the name of the language of this parser.

JTP API Documentation