All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.rdf.SiRPAC
java.lang.Object
|
+----org.w3c.rdf.SiRPAC
- public class SiRPAC
- extends Object
- implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler, DataSource
-
RDFMS
-
-
RDFSCHEMA
-
-
REVISION
-
-
XMLSCHEMA
-
-
SiRPAC()
-
-
SiRPAC(String)
-
-
addError(String)
- Generate an error message as a string
-
addTriple(Resource, Resource, RDFnode)
- Create a new triple and add it to the m_triples Vector
-
addWarning(String)
- Generate a warning message as a string
-
characters(char[], int, int)
-
-
createBags(boolean)
- createBags method allows one to determine whether SiRPAC
produces Bag instances for each Description block.
-
createParser(String)
-
-
doctype(String, String, String)
-
-
endConsumers()
- Notify all registered consumers that were
are at the end of the parsing process
-
endDocument()
-
-
endElement(String)
-
For each end of an element scope step back in the
element and namespace stack
-
error(SAXParseException)
- Report all recoverable errors, and try to continue parsing.
-
errors()
-
-
fatalError(SAXParseException)
- Report all fatal errors, and try to continue parsing.
-
fetchRDF()
-
-
fetchSchema(String)
-
-
fetchSchemas(boolean)
- Set whether parser recursively fetches and parses
every RDF schema it finds in the namespace declarations
-
getRDFSource()
-
-
ignorableWhitespace(char[], int, int)
-
-
isAlternative(Element)
- Is the element an Alternative
-
isBag(Element)
- Is the element a Bag
-
isContainer(Element)
- Is the element a Container
-
isDescription(Element)
- Is the element a Description
-
isListItem(Element)
- Is the element a ListItem
-
isRDF(Element)
- Check if the element e is from the namespace
of the RDF schema by comparing only the beginning of
the expanded element name with the canonical RDFMS
URI
-
isRDFroot(Element)
-
-
isSequence(Element)
- Is the element a Sequence
-
isTypedPredicate(Element)
- This method matches all properties but those from RDF namespace
-
listNamespaces()
- Return all non-RDF namespace URIs recognized by the parser
-
lookforNode(String)
- Look for a node by name sID from the Hashtable
m_hIDtable of all registered IDs.
-
main(String[])
- main method for running SiRPAC as an application
-
makeMarkupChar(String)
-
-
makeMarkupET(String)
-
-
makeMarkupST(Element)
-
-
namespace(String)
- Return the full namespace URI for a given prefix sPrefix.
-
newReificationID()
- Create a new reification ID by using a name part and an
incremental counter m_iReificationCounter.
-
notationDecl(String, String, String)
-
-
parseLiteral()
- Methods to determine whether we are parsing
parseType="Literal" or parseType="Resource"
-
parseResource()
-
-
preserveWhiteSpace()
-
-
printTriples(PrintStream)
- Print all triples to the ps PrintStream
-
processDescription(Element, boolean, boolean, boolean)
- processDescription manages Description elements
-
processingInstruction(String, String)
-
-
processRDF(Element)
- Start processing an RDF/XML document instance from the
root element rdf.
-
processTypedNode(Element)
- Manage the typedNode production in the RDF grammar.
-
processXML(Element)
- Given an XML document (well-formed HTML, for example),
look for a suitable element to start parsing from
-
register(RDFConsumer)
- One can register multiple RDFConsumer objects which will
receive notifications about new triples
-
registerID(String, Element)
- Add an element e to the Hashtable m_hIDtable
which stores all nodes with an ID
-
registerResource(Element)
- Add an element e to the Vector m_vResources
which stores all nodes with an URI
-
resolve()
- Go through the m_vResolveQueue and assign
direct object reference for each symbolic reference
-
resolveEntity(String, String)
-
-
resolveLater(Element)
- Add the element e to the m_vResolveQueue
to be resolved later.
-
root()
- Return the root element pointer.
-
setDocumentLocator(Locator)
-
-
setRDFSource(InputSource)
-
-
setSource(String)
- setSource methods saves the name of the source document for
later inspection if needed
-
source()
-
-
startConsumers()
- Notify all registered consumers that were
are about to start parsing
-
startDocument()
-
-
startElement(String, AttributeList)
- Called for each new element.
-
triples()
- Return all created triples in an Enumeration instance
-
unparsedEntityDecl(String, String, String, String)
- Display unparsed entity declarations as they are reported.
-
unregister(RDFConsumer)
- Remove an RDFConsumer object from SiRPAC
-
warning(SAXParseException)
- Report all warnings, and continue parsing.
-
warnings()
-
REVISION
public static final String REVISION
RDFMS
public static final String RDFMS
RDFSCHEMA
public static final String RDFSCHEMA
XMLSCHEMA
public static final String XMLSCHEMA
SiRPAC
public SiRPAC()
SiRPAC
public SiRPAC(String sXMLParser)
parseLiteral
public boolean parseLiteral()
- Methods to determine whether we are parsing
parseType="Literal" or parseType="Resource"
preserveWhiteSpace
public boolean preserveWhiteSpace()
parseResource
public boolean parseResource()
createBags
public void createBags(boolean b)
- createBags method allows one to determine whether SiRPAC
produces Bag instances for each Description block.
The default setting is to generate them.
fetchSchemas
public void fetchSchemas(boolean b)
- Set whether parser recursively fetches and parses
every RDF schema it finds in the namespace declarations
setSource
public void setSource(String sSource)
- setSource methods saves the name of the source document for
later inspection if needed
source
public String source()
listNamespaces
public Enumeration listNamespaces()
- Return all non-RDF namespace URIs recognized by the parser
namespace
public String namespace(String sPrefix)
- Return the full namespace URI for a given prefix sPrefix.
The default namespace is identified with xmlns prefix.
The namespace of xmlns attribute is an empty string.
register
public void register(RDFConsumer c)
- One can register multiple RDFConsumer objects which will
receive notifications about new triples
unregister
public void unregister(RDFConsumer c)
- Remove an RDFConsumer object from SiRPAC
startConsumers
public void startConsumers()
- Notify all registered consumers that were
are about to start parsing
endConsumers
public void endConsumers()
- Notify all registered consumers that were
are at the end of the parsing process
setRDFSource
public void setRDFSource(InputSource source)
getRDFSource
public InputSource getRDFSource()
fetchRDF
public void fetchRDF() throws Exception
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
notationDecl
public void notationDecl(String name,
String publicId,
String systemId)
unparsedEntityDecl
public void unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
- Display unparsed entity declarations as they are reported.
- See Also:
- unparsedEntityDecl
setDocumentLocator
public void setDocumentLocator(Locator locator)
startDocument
public void startDocument()
endDocument
public void endDocument() throws SAXException
doctype
public void doctype(String name,
String publicID,
String systemID)
startElement
public void startElement(String name,
AttributeList al) throws SAXException
- Called for each new element.
Build up the document tree using an element stack
- Throws: SAXException
- Passed on since we don't handle it.
endElement
public void endElement(String name) throws SAXException
- For each end of an element scope step back in the
element and namespace stack
- Throws: SAXException
- Passed on since we don't handle it.
root
public Element root()
- Return the root element pointer. This requires the parsing
has been already done.
characters
public void characters(char ch[],
int start,
int length) throws SAXException
ignorableWhitespace
public void ignorableWhitespace(char ch[],
int start,
int length)
processingInstruction
public void processingInstruction(String target,
String data)
warning
public void warning(SAXParseException exception)
- Report all warnings, and continue parsing.
- See Also:
- warning
error
public void error(SAXParseException exception)
- Report all recoverable errors, and try to continue parsing.
- See Also:
- error
fatalError
public void fatalError(SAXParseException exception)
- Report all fatal errors, and try to continue parsing.
Note: results are no longer reliable once a fatal error has
been reported.
- See Also:
- fatalError
addError
public void addError(String sMsg)
- Generate an error message as a string
errors
public String errors()
addWarning
public void addWarning(String sMsg)
- Generate a warning message as a string
warnings
public String warnings()
createParser
public static Parser createParser(String className)
processXML
public void processXML(Element ele) throws SAXException
- Given an XML document (well-formed HTML, for example),
look for a suitable element to start parsing from
- Throws: SAXException
- Passed on since we don't handle it.
fetchSchema
public void fetchSchema(String sURI)
processRDF
public void processRDF(Element rdf) throws SAXException
- Start processing an RDF/XML document instance from the
root element rdf.
- Throws: SAXException
- Passed on since we don't handle it.
processTypedNode
public String processTypedNode(Element typedNode) throws SAXException
- Manage the typedNode production in the RDF grammar.
- Throws: SAXException
- Passed on since we don't handle it.
processDescription
public String processDescription(Element description,
boolean inPredicate,
boolean reificate,
boolean createBag) throws SAXException
- processDescription manages Description elements
- Parameters:
- description - The Description element itself
- inPredicate - Is this is a nested description
- reificate - Do we need to reificate
- createBag - Do we create a bag container
- Returns:
- An ID for the description
- Throws: SAXException
- Passed on since we don't handle it.
addTriple
public void addTriple(Resource predicate,
Resource subject,
RDFnode object)
- Create a new triple and add it to the m_triples Vector
printTriples
public void printTriples(PrintStream ps)
- Print all triples to the ps PrintStream
triples
public Enumeration triples()
- Return all created triples in an Enumeration instance
isDescription
public boolean isDescription(Element e)
- Is the element a Description
isListItem
public boolean isListItem(Element e)
- Is the element a ListItem
isContainer
public boolean isContainer(Element e)
- Is the element a Container
- See Also:
- isSequence, isAlternative, isBag
isSequence
public boolean isSequence(Element e)
- Is the element a Sequence
isAlternative
public boolean isAlternative(Element e)
- Is the element an Alternative
isBag
public boolean isBag(Element e)
- Is the element a Bag
isTypedPredicate
public boolean isTypedPredicate(Element e)
- This method matches all properties but those from RDF namespace
isRDFroot
public boolean isRDFroot(Element e)
isRDF
public boolean isRDF(Element e)
- Check if the element e is from the namespace
of the RDF schema by comparing only the beginning of
the expanded element name with the canonical RDFMS
URI
resolveLater
public void resolveLater(Element e)
- Add the element e to the m_vResolveQueue
to be resolved later.
resolve
public void resolve()
- Go through the m_vResolveQueue and assign
direct object reference for each symbolic reference
lookforNode
public Element lookforNode(String sID)
- Look for a node by name sID from the Hashtable
m_hIDtable of all registered IDs.
registerID
public void registerID(String sID,
Element e)
- Add an element e to the Hashtable m_hIDtable
which stores all nodes with an ID
newReificationID
public String newReificationID()
- Create a new reification ID by using a name part and an
incremental counter m_iReificationCounter.
registerResource
public void registerResource(Element e)
- Add an element e to the Vector m_vResources
which stores all nodes with an URI
makeMarkupST
public void makeMarkupST(Element ele)
makeMarkupET
public void makeMarkupET(String name)
makeMarkupChar
public void makeMarkupChar(String s)
main
public static void main(String args[]) throws Exception
- main method for running SiRPAC as an application
All Packages Class Hierarchy This Package Previous Next Index