Happy Easter! Time for some RDF hacking..
I started a draft interface for preparing and running an RDF parser: https://github.com/apache/incubator-commonsrdf/blob/parser-writer-interface/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java This builds on a previous idea I had at https://github.com/stain/commonsrdf-parser-jena and Andy's work at https://github.com/afs/commonsrdf-jena An equivalent interface for writers would be pretty much the same but with .write(). The idea is that of a builder pattern - so you can set parameters like base() and contentType() if you want to - and must call one of the source() variants (or any third-party extensions like source(URL)). The parsing happens not until parse() -- which return a Future<Graph> -- allowing asynchronous parsing. If you don't specify intoGraph() or rdfTermFactory() the implementation is free to choose what kind of Graph it will return. Then we can try out integrations with Jena, Sesame, JSONLD-Java etc. that provide such builders. I've not thought too much about how you would discover those builders or find the right one depending on the format you may want to parse - would through the RDFTermFactory.createParser() ? (in which case RDFTermFActory -> RDFFactory ) Thoughts? -- Stian Soiland-Reyes Apache Taverna (incubating), Apache Commons RDF (incubating) http://orcid.org/0000-0001-9842-9718
