com.mkdoc.sax
Class LinkStoreWriter

java.lang.Object
  |
  +--com.mkdoc.sax.AbstractContentHandler
        |
        +--com.mkdoc.sax.AbstractRdfContentHandler
              |
              +--com.mkdoc.sax.AbstractStoreWriter
                    |
                    +--com.mkdoc.sax.LinkStoreWriter
All Implemented Interfaces:
org.xml.sax.ContentHandler, ElementHandler, ElementRdfWriter, RdfContentHandler

public class LinkStoreWriter
extends AbstractStoreWriter
implements org.xml.sax.ContentHandler, ElementRdfWriter

A Sesame repository writer for XHTML link content.

Generates RDF Graph objects and adds them to a Sesame repository. Supports Dublin Core element and qualified terms schemata.

Version:
0.7 2005-11-01
Author:
Philip Shaw
To do:
Reduce the complexity of the addTriples method.

Field Summary
static java.lang.String LINK
          The local name of the link element.
 
Fields inherited from class com.mkdoc.sax.AbstractStoreWriter
graph, manager, subjectUri
 
Fields inherited from class com.mkdoc.sax.AbstractRdfContentHandler
DC_PREFIX, DCTERMS_URI, NODE_PREFIX, NODE_SUFFIX, NS_XHTML1, profile, RDF_TYPE, RDF_VALUE, subject, URI_SCHEMES
 
Fields inherited from class com.mkdoc.sax.AbstractContentHandler
locator
 
Constructor Summary
LinkStoreWriter(StoreManager manager, java.net.URL url)
          Construct from a store manager and initial URI.
 
Method Summary
 boolean acceptElement(java.lang.String uri, java.lang.String localName)
          Report whether an instance accepts named element types.
 void addTriples(org.openrdf.model.URI sourceUri, org.xml.sax.Attributes attributes, org.openrdf.model.Graph graph)
          Add statements to an RDF graph for a source URI.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
          Extract link element content.
 
Methods inherited from class com.mkdoc.sax.AbstractStoreWriter
endDocument, getSubjectUri, setSubjectUri
 
Methods inherited from class com.mkdoc.sax.AbstractRdfContentHandler
escape, expandPredicate, expandPredicates, expandScheme, getBNode, getBNodeId, getSubject, isUri, setApplicationProfile, setSubject
 
Methods inherited from class com.mkdoc.sax.AbstractContentHandler
characters, endElement, endPrefixMapping, getAttributeValue, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 

Field Detail

LINK

public static final java.lang.String LINK
The local name of the link element.

Since:
Version 0.2 2005-02-15
See Also:
Constant Field Values
Constructor Detail

LinkStoreWriter

public LinkStoreWriter(StoreManager manager,
                       java.net.URL url)
Construct from a store manager and initial URI.

Parameters:
manager - A subject manager interface for storing statements.
url - An initial URI subject.
Since:
Version 0.1 2005-02-14
Method Detail

acceptElement

public final boolean acceptElement(java.lang.String uri,
                                   java.lang.String localName)
Report whether an instance accepts named element types.

Specified by:
acceptElement in interface ElementHandler
Parameters:
uri - The namespace URI for the document type.
localName - The local name of the element to check.
Returns:
true if this type is capable of handling the specified element.
Since:
Version 0.2 2005-02-15

startElement

public final void startElement(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName,
                               org.xml.sax.Attributes attributes)
                        throws org.xml.sax.SAXException
Extract link element content.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class AbstractContentHandler
Parameters:
uri - The namespace URI for the element.
localName - The local element name.
qName - The qualified element name.
attributes - A set of attributes.
Throws:
org.xml.sax.SAXException - If the element is not a link element or the instance is was not constructed with an output source and subject URI.
Since:
Version 0.1 2005-02-14

addTriples

public final void addTriples(org.openrdf.model.URI sourceUri,
                             org.xml.sax.Attributes attributes,
                             org.openrdf.model.Graph graph)
Add statements to an RDF graph for a source URI.

Specified by:
addTriples in interface ElementRdfWriter
Parameters:
sourceUri - The URI for the source document.
attributes - The element attribute set to process.
graph - An RDF graph to add the statements to.
Since:
Version 0.1 2005-02-14