[
https://issues.apache.org/jira/browse/JENA-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16261472#comment-16261472
]
ASF GitHub Bot commented on JENA-1430:
--------------------------------------
Github user ajs6f commented on a diff in the pull request:
https://github.com/apache/jena/pull/314#discussion_r152397704
--- 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 --
@afs What's a good idiom for switching to a new assembler? In other words,
let's say the code tests for the presence of quads and finds them and it's time
to pivot to TIM. Obviously, I could just `new InMemDatasetAssembler()`, but I'm
thinking there must be a more elegant way. I looked at `AssemblerUtils` but
only saw ways to register `Assembler`s, not retrieve them…
> 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)