gr.forth.ics.rdfsuite.trig
Class DefaultParserHandler

java.lang.Object
  extended by gr.forth.ics.rdfsuite.trig.DefaultParserHandler
All Implemented Interfaces:
gr.forth.ics.rdfsuite.trig.parser.ParserHandler

public class DefaultParserHandler
extends java.lang.Object
implements gr.forth.ics.rdfsuite.trig.parser.ParserHandler


Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
DefaultParserHandler(IRDF_Model model, boolean strict)
          Creates a new instance of DefaultParserHandler.
DefaultParserHandler(IRDF_Model model, java.lang.String baseUri, boolean strict)
          Creates a new instance of DefaultParserHandler.
 
Method Summary
 void endGraph()
          After the call of this method, triples will no longer be added in the graphspace specified in the last call of startGraph.
 void handleBaseUri(java.lang.String baseUri)
          Compares the given base uri with the one given in the constractor if any.
 void handleGraphspacePrefix(java.lang.String prefix, java.lang.String graphspace)
          Associates the prefix with the given graphspace.
 void handleNamespacePrefix(java.lang.String prefix, java.lang.String namespace)
          Associates the prefix with the given namespace.
 void handleTriple(java.lang.String subject, java.lang.String predicate, java.lang.String object)
          Creates an new triple with the given subject, predicate and object and adds it in the model.
 void startGraph(java.lang.String graphUri)
          A new graphspace with the given graphspace uri is added in the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

DefaultParserHandler

public DefaultParserHandler(IRDF_Model model,
                            java.lang.String baseUri,
                            boolean strict)
Creates a new instance of DefaultParserHandler.

Parameters:
model - the model in which all information will be stored
baseUri - the base uri of the file to be loaded
strict - if true all the necessary checks will be performed while if it is false we will perform a good will building

DefaultParserHandler

public DefaultParserHandler(IRDF_Model model,
                            boolean strict)
Creates a new instance of DefaultParserHandler.

Parameters:
model - the model in which all information will be stored
strict - if true all the necessary checks will be performed while if it is false we will perform a good will building
Method Detail

handleNamespacePrefix

public void handleNamespacePrefix(java.lang.String prefix,
                                  java.lang.String namespace)
Associates the prefix with the given namespace.

Specified by:
handleNamespacePrefix in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler
Parameters:
prefix - the prefix of the namespace
namespace - the string representation of the namespace

handleGraphspacePrefix

public void handleGraphspacePrefix(java.lang.String prefix,
                                   java.lang.String graphspace)
Associates the prefix with the given graphspace.

Specified by:
handleGraphspacePrefix in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler
Parameters:
prefix - the prefix of the graphspace
namespace - the string representation of the graphspace

handleBaseUri

public void handleBaseUri(java.lang.String baseUri)
Compares the given base uri with the one given in the constractor if any. and if there is no error, the base uri is saved

Specified by:
handleBaseUri in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler

startGraph

public void startGraph(java.lang.String graphUri)
A new graphspace with the given graphspace uri is added in the model. Any triples added from then on and till the time endGraph is called, will be added in this graphspace.

Specified by:
startGraph in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler
Parameters:
graphUri - the uri of the graphspace

endGraph

public void endGraph()
After the call of this method, triples will no longer be added in the graphspace specified in the last call of startGraph.

Specified by:
endGraph in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler

handleTriple

public void handleTriple(java.lang.String subject,
                         java.lang.String predicate,
                         java.lang.String object)
Creates an new triple with the given subject, predicate and object and adds it in the model. The triple is also added in the graphspace specified in the last call of startGraph and in the namespace specified by its name if any.

Specified by:
handleTriple in interface gr.forth.ics.rdfsuite.trig.parser.ParserHandler
Parameters:
subject - the subject of the triple
predicate - the predicate of the triple
object - the object of the triple