I am forwarding a message I received from David Megginson concerning the status of some of his RDF related efforts. As can be seen, he has identified another layer in-between the parser and the model relative to the Sergey's API proposal. This layer allows streaming access to nested RDF and XML literals. Very cool stuff :-! He gives several reasons why you wouldn't want to have the RDFHandler directly emit "triples" including the fatness of the method signature and the need to bracket literal tokenization. I assume that he won't mind if we CC him on replies to this message as I don't think he is subscribed to www-rdf-interest. Cordially from Corvallis, Gabe Beged-Dov http://www.jfinity.com/gabe
attached mail follows:
[Please feel free to forward this message to any relevant lists.]
Gabe Beged-Dov writes:
> As for you releasing a low-level RDF API, that sounds exciting. Will
> it have a dependancy on Java 1.2 like DATAX or will it leave
> collections to the higher level Model/EntitySet layer? I look forward
> to trying it out.
Basically, it's just a SAX add-on. It looks like this:
public interface RDFHandler
{
public final static int RESOURCE_ID = 1;
public final static int RESOURCE_ABOUT = 2;
public final static int RESOURCE_ABOUTEACH = 3;
public final static int RESOURCE_ABOUTEACHPREFIX = 4;
public abstract void startRDF () throws RDFParseException;
public abstract void endRDF () throws RDFParseException;
public abstract void startRDFResource (int type,
String ident,
String bagID)
throws RDFParseException;
public abstract void endRDFResource ()
throws RDFParseException;
public abstract void doRDFLiteralProperty (String name,
String value,
String lang)
throws RDFParseException;
public abstract void doRDFResourceProperty (String name,
String resource)
throws RDFParseException;
public abstract void startRDFXMLProperty (String name,
String lang)
throws RDFParseException;
public void endRDFXMLProperty ()
throws RDFParseException;
}
These events can occur in the middle of a SAX stream (bracketed by
startRDF() and endRDF()), and regular SAX events can occur between
startRDFXMLProperty() and endRDFXMLProperty(). To my knowledge, this
API captures all of the relevant information in an RDF document (DATAX
will drop some of it, though).
It would be possible to do this in triple form, as
doRDFStatement()
but the function would be nightmareish -- it would have to look
something like this:
doRDFStatement(int subjectType,
String subject,
String predicate,
int objectType,
String object,
String lang);
And even then, you'd still need a start/end variant for
parseType="Literal" to bracket the regular XML content.
I decided to include a start/endResource rather than breaking it down
into statements because many apps will need to take specific actions
when the subject changes, and it's easy enough to save the current
subject (etc.) on a stack.
All the best,
David
--
David Megginson david@megginson.com
http://www.megginson.com/
Received on Wednesday, 8 December 1999 18:15:41 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:42 GMT