jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/2] jena git commit: JENA-1574: Resolve named graph URIs.
Date Fri, 13 Jul 2018 16:03:06 GMT
Repository: jena
Updated Branches:
  refs/heads/master 5fcfb84eb -> af078411f


JENA-1574: Resolve named graph URIs.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/eef54c11
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/eef54c11
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/eef54c11

Branch: refs/heads/master
Commit: eef54c1109bbe7b6110618d609dc431e92238e5a
Parents: 84b6434
Author: Andy Seaborne <andy@apache.org>
Authored: Thu Jul 12 12:01:59 2018 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu Jul 12 12:01:59 2018 +0100

----------------------------------------------------------------------
 jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/eef54c11/jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java
----------------------------------------------------------------------
diff --git a/jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java b/jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java
index 57f0b19..fc256f7 100644
--- a/jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java
+++ b/jena-cmds/src/main/java/arq/cmdline/ModDatasetGeneral.java
@@ -24,10 +24,12 @@ import jena.cmd.ArgDecl;
 import jena.cmd.CmdArgModule;
 import jena.cmd.CmdException;
 import jena.cmd.CmdGeneral;
+import org.apache.jena.atlas.lib.ListUtils;
 import org.apache.jena.query.Dataset ;
 import org.apache.jena.query.DatasetFactory ;
 import org.apache.jena.query.LabelExistsException ;
 import org.apache.jena.riot.RDFDataMgr ;
+import org.apache.jena.riot.system.IRIResolver;
 import org.apache.jena.shared.JenaException ;
 import org.apache.jena.sparql.util.DatasetUtils ;
 import org.apache.jena.system.Txn;
@@ -102,8 +104,11 @@ public class ModDatasetGeneral extends ModDataset
                         RDFDataMgr.read(ds, url);
                 }
             }
-            if ( hasEntries(graphURLs) ||  hasEntries(namedGraphURLs) )
-                DatasetUtils.addInGraphs(ds, graphURLs, namedGraphURLs, null) ;
+            if ( hasEntries(graphURLs) ||  hasEntries(namedGraphURLs) ) {
+                // Resolve named graph URLs so the graphname is an absolute IRI.
+                List<String> x = ListUtils.toList(namedGraphURLs.stream().map(IRIResolver::resolveFileURL));
+                DatasetUtils.addInGraphs(ds, graphURLs, x, null) ;
+            }
         } 
         catch (LabelExistsException ex)
         { throw new CmdException(ex.getMessage()) ; }


Mime
View raw message