commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject commons-rdf git commit: COMMONSRDF-66: updated attribute naming as discussed in PR #42
Date Tue, 31 Oct 2017 03:10:14 GMT
Repository: commons-rdf
Updated Branches:
  refs/heads/master 5a998408f -> 151a8ea3f


COMMONSRDF-66: updated attribute naming as discussed in PR #42


Project: http://git-wip-us.apache.org/repos/asf/commons-rdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rdf/commit/151a8ea3
Tree: http://git-wip-us.apache.org/repos/asf/commons-rdf/tree/151a8ea3
Diff: http://git-wip-us.apache.org/repos/asf/commons-rdf/diff/151a8ea3

Branch: refs/heads/master
Commit: 151a8ea3fabdf7d183308b48527e55198cb8b5f1
Parents: 5a99840
Author: Sergio Fernández <sergio@wikier.org>
Authored: Mon Oct 30 20:10:06 2017 -0700
Committer: Sergio Fernández <sergio@wikier.org>
Committed: Mon Oct 30 20:10:06 2017 -0700

----------------------------------------------------------------------
 .../apache/commons/rdf/jena/JenaDataset.java    |  6 +--
 .../commons/rdf/jena/impl/JenaDatasetImpl.java  | 48 ++++++++++----------
 2 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/151a8ea3/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/JenaDataset.java
----------------------------------------------------------------------
diff --git a/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/JenaDataset.java b/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/JenaDataset.java
index 6b0419b..9971c3d 100644
--- a/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/JenaDataset.java
+++ b/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/JenaDataset.java
@@ -28,7 +28,7 @@ import org.apache.jena.sparql.core.DatasetGraph;
  * The underlying Jena {@link DatasetGraph} can be accessed with
  * {@link #asJenaDatasetGraph()}.
  */
-public interface JenaDataset extends org.apache.commons.rdf.api.Dataset {
+public interface JenaDataset extends Dataset {
 
     /**
      * Return the underlying Jena {@link DatasetGraph}.
@@ -38,7 +38,7 @@ public interface JenaDataset extends org.apache.commons.rdf.api.Dataset
{
      *
      * @return A Jena {@link DatasetGraph}
      */
-    public DatasetGraph asJenaDatasetGraph();
+    DatasetGraph asJenaDatasetGraph();
 
     /**
      * Return a union graph view of this dataset.
@@ -51,6 +51,6 @@ public interface JenaDataset extends org.apache.commons.rdf.api.Dataset
{
      *
      * @return A union {@link Graph}
      */
-    public JenaGraph getUnionGraph();
+    JenaGraph getUnionGraph();
 
 }

http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/151a8ea3/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaDatasetImpl.java
----------------------------------------------------------------------
diff --git a/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaDatasetImpl.java
b/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaDatasetImpl.java
index 8529a5c..55204d3 100644
--- a/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaDatasetImpl.java
+++ b/commons-rdf-jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaDatasetImpl.java
@@ -43,45 +43,45 @@ import org.apache.jena.sparql.core.GraphView;
 
 class JenaDatasetImpl implements JenaDataset {
 
-    private final DatasetGraph graph;
+    private final DatasetGraph datasetGraph;
     private final UUID salt;
     private final JenaRDF factory;
 
-    JenaDatasetImpl(final DatasetGraph graph, final UUID salt) {
-        this.graph = graph;
+    JenaDatasetImpl(final DatasetGraph datasetGraph, final UUID salt) {
+        this.datasetGraph = datasetGraph;
         this.salt = salt;
         this.factory = new JenaRDF(salt);
     }
 
     @Override
     public void add(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI
predicate, final RDFTerm object) {
-        graph.add(org.apache.jena.sparql.core.Quad.create(factory.asJenaNode(graphName),
factory.asJenaNode(subject),
+        datasetGraph.add(org.apache.jena.sparql.core.Quad.create(factory.asJenaNode(graphName),
factory.asJenaNode(subject),
                 factory.asJenaNode(predicate), factory.asJenaNode(object)));
     }
 
     @Override
     public void add(final Quad quad) {
-        graph.add(factory.asJenaQuad(quad));
+        datasetGraph.add(factory.asJenaQuad(quad));
     }
 
     @Override
     public DatasetGraph asJenaDatasetGraph() {
-        return graph;
+        return datasetGraph;
     }
 
     @Override
     public void clear() {
-        graph.clear();
+        datasetGraph.clear();
     }
 
     @Override
     public void close() {
-        graph.close();
+        datasetGraph.close();
     }
 
     @Override
     public boolean contains(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI
subject, final IRI predicate, final RDFTerm object) {
-        return graph.contains(toJenaPattern(graphName), toJenaPattern(subject), toJenaPattern(predicate),
+        return datasetGraph.contains(toJenaPattern(graphName), toJenaPattern(subject), toJenaPattern(predicate),
                 toJenaPattern(object));
     }
 
@@ -93,7 +93,7 @@ class JenaDatasetImpl implements JenaDataset {
         if (graphName == null) {
             return ANY;
         }
-        // null: default graph
+        // null: default datasetGraph
         return factory.asJenaNode(graphName.orElse(null));
     }
 
@@ -106,19 +106,19 @@ class JenaDatasetImpl implements JenaDataset {
 
     @Override
     public boolean contains(final Quad quad) {
-        return graph.contains(factory.asJenaQuad(quad));
+        return datasetGraph.contains(factory.asJenaQuad(quad));
     }
 
     @Override
     public void remove(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI
subject, final IRI predicate, final RDFTerm object) {
-        graph.deleteAny(toJenaPattern(graphName), toJenaPattern(subject),
+        datasetGraph.deleteAny(toJenaPattern(graphName), toJenaPattern(subject),
                 toJenaPattern(predicate), toJenaPattern(object));
     }
 
     @Override
     public void remove(final Quad quad) {
         // COMMONSRDF-51:
-        graph.deleteAny(
+        datasetGraph.deleteAny(
                 toJenaPattern(quad.getGraphName()),
                 toJenaPattern(quad.getSubject()),
                 toJenaPattern(quad.getPredicate()),
@@ -127,60 +127,60 @@ class JenaDatasetImpl implements JenaDataset {
 
     @Override
     public long size() {
-        final long quads = Iter.asStream(graph.listGraphNodes())
-                .map(graph::getGraph)
+        final long quads = Iter.asStream(datasetGraph.listGraphNodes())
+                .map(datasetGraph::getGraph)
                 .collect(Collectors.summingLong(org.apache.jena.graph.Graph::size));
-        return quads + graph.getDefaultGraph().size();
+        return quads + datasetGraph.getDefaultGraph().size();
     }
 
     @Override
     public Stream<? extends Quad> stream() {
         final JenaRDF factory = new JenaRDF(salt);
-        return Iter.asStream(graph.find(ANY, ANY, ANY, ANY), true).map(factory::asQuad);
+        return Iter.asStream(datasetGraph.find(ANY, ANY, ANY, ANY), true).map(factory::asQuad);
     }
 
     @Override
     public Stream<? extends Quad> stream(final Optional<BlankNodeOrIRI> g, final
BlankNodeOrIRI s, final IRI p, final RDFTerm o) {
         final JenaRDF factory = new JenaRDF(salt);
-        return Iter.asStream(graph.find(toJenaPattern(g), toJenaPattern(s), toJenaPattern(p),
toJenaPattern(o)), true)
+        return Iter.asStream(datasetGraph.find(toJenaPattern(g), toJenaPattern(s), toJenaPattern(p),
toJenaPattern(o)), true)
                 .map(factory::asQuad);
     }
 
     @Override
     public String toString() {
         final StringWriter sw = new StringWriter();
-        RDFDataMgr.write(sw, graph, Lang.NT);
+        RDFDataMgr.write(sw, datasetGraph, Lang.NT);
         return sw.toString();
     }
 
     @Override
     public Graph getGraph() {
-        final GraphView g = GraphView.createDefaultGraph(graph);
+        final GraphView g = GraphView.createDefaultGraph(datasetGraph);
         return new JenaGraphImpl(g, salt);
     }
 
     @Override
     public JenaGraph getUnionGraph() {
-        final GraphView gv = GraphView.createUnionGraph(graph);
+        final GraphView gv = GraphView.createUnionGraph(datasetGraph);
         return new JenaGraphImpl(gv, salt);
     }
 
     @Override
     public Optional<Graph> getGraph(final BlankNodeOrIRI graphName) {
-        final GraphView gv = GraphView.createNamedGraph(graph, factory.asJenaNode(graphName));
+        final GraphView gv = GraphView.createNamedGraph(datasetGraph, factory.asJenaNode(graphName));
         return Optional.of(new JenaGraphImpl(gv, salt));
     }
 
     @Override
     public Stream<BlankNodeOrIRI> getGraphNames() {
         final JenaRDF factory = new JenaRDF(salt);
-        return Iter.asStream(graph.listGraphNodes()).map(node -> (BlankNodeOrIRI) factory.asRDFTerm(node));
+        return Iter.asStream(datasetGraph.listGraphNodes()).map(node -> (BlankNodeOrIRI)
factory.asRDFTerm(node));
     }
 
     @Override
     public Iterable<Quad> iterate() {
         final JenaRDF factory = new JenaRDF(salt);
-        return Iter.asStream(graph.find(), false).map(q -> (Quad) factory.asQuad(q))::iterator;
+        return Iter.asStream(datasetGraph.find(), false).map(q -> (Quad) factory.asQuad(q))::iterator;
     }
 
 }


Mime
View raw message