[ 
https://issues.apache.org/jira/browse/JENA-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16260788#comment-16260788
 ] 

ASF GitHub Bot commented on JENA-1430:
--------------------------------------

Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/314#discussion_r152289270
  
    --- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/DatasetAssembler.java
 ---
    @@ -58,27 +64,33 @@ public Dataset createDataset(Assembler a, Resource 
root, Mode mode) {
                 // Assembler description did not define one.
                 dftModel = GraphFactory.makeDefaultModel() ;
             Dataset ds = DatasetFactory.create(dftModel) ;
    -        // -------- Named graphs
    -        List<RDFNode> nodes = GraphUtils.multiValue(root, 
DatasetAssemblerVocab.pNamedGraph) ;
    -        for ( RDFNode n : nodes ) {
    -            if ( !(n instanceof Resource) )
    -                throw new DatasetAssemblerException(root, "Not a resource: 
" + FmtUtils.stringForRDFNode(n));
    -            Resource r = (Resource)n;
    -
    -            String gName = GraphUtils.getAsStringValue(r, 
DatasetAssemblerVocab.pGraphName);
    -            Resource g = GraphUtils.getResourceValue(r, 
DatasetAssemblerVocab.pGraph);
    -            if ( g == null ) {
    -                g = GraphUtils.getResourceValue(r, 
DatasetAssemblerVocab.pGraphAlt);
    -                if ( g != null ) {
    -                    Log.warn(this, "Use of old vocabulary: use :graph not 
:graphData");
    -                } else {
    -                    throw new DatasetAssemblerException(root, "no graph 
for: " + gName);
    +        Txn.executeWrite(ds, () -> {
    +            // Load data into the default graph or quads into the dataset.
    +            multiValueAsString(root, data)
    +                .forEach(dataURI -> read(ds, dataURI));
    +    
    --- End diff --
    
    That is to load specialised graphs e.g. inference? In which case the graphs 
themselves need to be pre-created before reading data. We already have a 
mechanism for graphs with `ja:content` on the graph description. Having two 
ways seems bad. Strange things will happen if a graph is in the quads and not 
explicitly created (it will be a plain graph when inference expected). It could 
be done be splitting the quads into separate graphs and generating the 
assembler text. 
    
    It might make sense to have some plain graphs and specialist graphs, that 
is a disjoint set, but to enforce this to stop accidents is not so easy without 
a lot of additional machinery to enforce disjoint.
    
    How about doing this progressively - we make ja:RDFDataset create either 
TIM, or linked datasets. And for now, it is one or the other, not a 
combination. (We can have per graph data loading into TIM as it does at the 
moment with some care - look into the namedGhraph property to see if it has 
`ja:data`+name, and only those, if not, it's a general model).
    
    We leave more exotic combinations until we get a request because that may 
help choose what to do with the corner cases like whether they overlap or not. 
If we provide now, the corner cases are fixed by compatibility.
    



> Quad loading for in-memory assemblers
> -------------------------------------
>
>                 Key: JENA-1430
>                 URL: https://issues.apache.org/jira/browse/JENA-1430
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>            Reporter: A. Soroka
>            Assignee: A. Soroka
>
> In-memory dataset Assemblers should support loading quad files.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to