fipaos.parser.rdf
Class RDFContentHandler


public class RDFContentHandler
implements Parser

This class provides mechanisms for parsing/deparsing RDF to/from Content object containers, using SiRPACHandler If the system property fipaos.parser.xmlparser is set, the classname it contains will be used as an XML parser (providing it uses the SAX 1.0 interface).


Inner Class Summary
 public classRDFContentHandler.RDFDocument
           

Field Summary
 final static StringENDTAG
           
 final static StringFOOTER
           
 final static StringHEADER
           
 final static StringPARSE_TYPE_LITERAL
           
 final static StringRDF
           
 final static StringRDF_HEADER
           
 final static StringRDFABOUT
           
 final static StringRDFNAME
           
 final static StringRDFRESOURCE
           
 final static StringRDFS
           
 final static StringRDFSCHEMA
           
 final static StringRDFSNAME
           
 final static StringRDFSYNTAX
           
 final static StringSTARTTAG
           
 final static StringXMLNS
           

Constructor Summary
RDFContentHandler()
          Initialises the Parser, ready to parse and deparse RDF documents

Method Summary
 booleancanParse(String content)
          Determines if the Parser implementation can parse the given content
 Stringdeparse(Content content)
          Attempts to deparse the given content, and produce a RDF document to represent it.
 StringgetParserType()
          Returns the type of content language that the Parser implementation handles.
 LinkedListgetTriples(LinkedList array_of_triples, Content content)
           
 static booleanisRDF(String content)
           
 static voidmain(String[] args)
           
 Contentparse(String content)
          Attempts to parse the given content, and produce a Content object to represent it.

Field Detail

ENDTAG

public final static String ENDTAG

FOOTER

public final static String FOOTER

HEADER

public final static String HEADER

PARSE_TYPE_LITERAL

public final static String PARSE_TYPE_LITERAL

RDF

public final static String RDF

RDF_HEADER

public final static String RDF_HEADER

RDFABOUT

public final static String RDFABOUT

RDFNAME

public final static String RDFNAME

RDFRESOURCE

public final static String RDFRESOURCE

RDFS

public final static String RDFS

RDFSCHEMA

public final static String RDFSCHEMA

RDFSNAME

public final static String RDFSNAME

RDFSYNTAX

public final static String RDFSYNTAX

STARTTAG

public final static String STARTTAG

XMLNS

public final static String XMLNS
Constructor Detail

RDFContentHandler

public RDFContentHandler()
Initialises the Parser, ready to parse and deparse RDF documents
Method Detail

canParse

public boolean canParse(String content)
Determines if the Parser implementation can parse the given content
Parameters:
A - content String.
Returns: True if the Parser implementation can parse the given String

deparse

public String deparse(Content content)
Attempts to deparse the given content, and produce a RDF document to represent it. Works by using a vector of attributes objects. It keeps on getting more attributenames to get more attributes untill it find primitives Then repackages according to rdf SYNTAX
Parameters:
content - The content to be deparsed
Returns: A RDF document representing the given Content object, null if parsing failed.

getParserType

public String getParserType()
Returns the type of content language that the Parser implementation handles.
Returns: A String representation of the content format (e.g. RDF, SL)

getTriples

public LinkedList getTriples(LinkedList array_of_triples, Content content)

isRDF

public static boolean isRDF(String content)

main

public static void main(String[] args)
throws java.io.IOException

parse

public Content parse(String content)
Attempts to parse the given content, and produce a Content object to represent it.
Parameters:
content - The RDF document to be parsed
Returns: A Content object representing the given RDF document, null if parsing failed.

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class fipaos.parser.rdf.RDFContentHandler.RDFDocument

FIXME: This should be removed one the Parser class has been written Reference to the DocumentRepository to use