On 05/11/15 17:22, A. Soroka wrote:
I just pushed an update to simplify this PR as discussed. It looks pretty similar to what you are showing below, but I used ja:data in both places (i.e. into the dataset and into a given graph, default or named) to allow for directly reading files into either. If ja:data is on the root, it reads either quads into the dataset or triples into the default graph, depending on what is on the other end of the ja:data triple. If ja:data is on the object of a ja:namedGraph triple, it reads into the appropriate named graph as specified by a ja:graphName triple, so:root a ja:MemoryDataset ; ja:data <file://myQuads.nq> ; ja:data <file://myTriplesforDefaultGraph.nt> ; ja:namedGraph [ ja:graphName <info:mygraph> ; ja:data <file://someTriplesForMyGraph> ] . I don’t understand what you mean by the method readGraphDesc? Is that supposed to read an assembler description of some kind? I thought we were excising that?
See earlier: it handles the [] case which takes a touch more code so I put it a name to that.
// May need better checking for expected Resource/String things. private void readGraphDesc(Dataset dataset, Resource r) { String gn = null ; if ( r.hasProperty(pGraphName)) { Resource rgn = r.getProperty(pGraphName).getResource() ; gn = rgn.getURI() ; } String dataFn = getAsStringValue(r, data) ; if ( gn == null ) RDFDataMgr.read(dataset.getDefaultModel(), dataFn); else RDFDataMgr.read(dataset.getNamedModel(gn), dataFn); }
