clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [3/3] git commit: CLEREZZA-846:simplification as suggested by Andy Seaborne
Date Wed, 04 Dec 2013 14:50:21 GMT
CLEREZZA-846:simplification as suggested by Andy Seaborne

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

Branch: refs/heads/master
Commit: a7d9d0fc3928541c4a17bb391ce94ed9034155dd
Parents: 8447814
Author: retobg <reto@apache.org>
Authored: Wed Dec 4 15:50:05 2013 +0100
Committer: retobg <reto@apache.org>
Committed: Wed Dec 4 15:50:05 2013 +0100

----------------------------------------------------------------------
 rdf.jena.sparql/nbactions.xml                   |  11 ++
 .../rdf/jena/sparql/JenaSparqlEngine.java       |   5 +-
 .../clerezza/rdf/jena/sparql/TcDataset.java     | 168 -------------------
 3 files changed, 15 insertions(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/a7d9d0fc/rdf.jena.sparql/nbactions.xml
----------------------------------------------------------------------
diff --git a/rdf.jena.sparql/nbactions.xml b/rdf.jena.sparql/nbactions.xml
new file mode 100644
index 0000000..49e8307
--- /dev/null
+++ b/rdf.jena.sparql/nbactions.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+    <action>
+        <actionName>CUSTOM-deploy to localhost:8080</actionName>
+        <displayName>deploy to localhost:8080</displayName>
+        <goals>
+            <goal>install</goal>
+            <goal>org.apache.sling:maven-sling-plugin:install</goal>
+        </goals>
+    </action>
+</actions>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/a7d9d0fc/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/JenaSparqlEngine.java
----------------------------------------------------------------------
diff --git a/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/JenaSparqlEngine.java
b/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/JenaSparqlEngine.java
index 8d9da34..f7f39d0 100644
--- a/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/JenaSparqlEngine.java
+++ b/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/JenaSparqlEngine.java
@@ -28,11 +28,13 @@ import org.apache.clerezza.rdf.core.sparql.query.Query;
 import org.apache.clerezza.rdf.jena.storage.JenaGraphAdaptor;
 
 import com.hp.hpl.jena.query.Dataset;
+import com.hp.hpl.jena.query.DatasetFactory;
 import com.hp.hpl.jena.query.QueryException;
 import com.hp.hpl.jena.query.QueryExecException;
 import com.hp.hpl.jena.query.QueryExecution;
 import com.hp.hpl.jena.query.QueryExecutionFactory;
 import com.hp.hpl.jena.query.QueryFactory;
+import com.hp.hpl.jena.sparql.core.DatasetGraph;
 import com.hp.hpl.jena.update.GraphStore;
 import com.hp.hpl.jena.update.GraphStoreFactory;
 import com.hp.hpl.jena.update.UpdateAction;
@@ -57,7 +59,8 @@ public class JenaSparqlEngine implements QueryEngine {
     @Override
     public Object execute(TcManager tcManager, TripleCollection defaultGraph,
             final String query) {
-        final Dataset dataset = new TcDataset(tcManager, defaultGraph);
+        final DatasetGraph datasetGraph = new TcDatasetGraph(tcManager, defaultGraph);
+        final Dataset dataset = DatasetFactory.create(datasetGraph);
 
         // Missing permission (java.lang.RuntimePermission getClassLoader)
         // when calling QueryFactory.create causes ExceptionInInitializerError

http://git-wip-us.apache.org/repos/asf/clerezza/blob/a7d9d0fc/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/TcDataset.java
----------------------------------------------------------------------
diff --git a/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/TcDataset.java
b/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/TcDataset.java
deleted file mode 100644
index 48b70a3..0000000
--- a/rdf.jena.sparql/src/main/java/org/apache/clerezza/rdf/jena/sparql/TcDataset.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.rdf.jena.sparql;
-
-import com.hp.hpl.jena.query.Dataset;
-import com.hp.hpl.jena.query.LabelExistsException;
-import com.hp.hpl.jena.query.ReadWrite;
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.rdf.model.ModelFactory;
-import com.hp.hpl.jena.shared.Lock;
-import com.hp.hpl.jena.sparql.core.DatasetGraph;
-import com.hp.hpl.jena.sparql.util.Context;
-
-import java.util.Iterator;
-import org.apache.clerezza.rdf.core.TripleCollection;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.jena.facade.JenaGraph;
-
-/**
- *
- * @author rbn
- */
-public class TcDataset implements Dataset {
-
-    private TcManager tcManager;
-    private TripleCollection defaultGraph;
-
-    TcDataset(TcManager tcManager, TripleCollection defaultGraph) {
-        this.tcManager = tcManager;
-        this.defaultGraph = defaultGraph;
-    }
-
-    @Override
-    public Model getDefaultModel() {
-        final JenaGraph jenaGraph = new JenaGraph(defaultGraph);
-        final Model model = ModelFactory.createModelForGraph(jenaGraph);
-        return model;
-    }
-
-    @Override
-    public Model getNamedModel(String name) {
-        final JenaGraph jenaGraph = new JenaGraph(
-                tcManager.getTriples(new UriRef(name)));
-        final Model model = ModelFactory.createModelForGraph(jenaGraph);
-        return model;
-    }
-
-    @Override
-    public boolean containsNamedModel(String name) {
-        try {
-            tcManager.getTriples(new UriRef(name));
-            return true;
-        } catch (NoSuchEntityException e) {
-            return false;
-        }
-    }
-
-    @Override
-    public Iterator<String> listNames() {
-        final Iterator<UriRef> tcs = tcManager.listTripleCollections().iterator();
-        return new Iterator<String>() {
-
-            @Override
-            public boolean hasNext() {
-                return tcs.hasNext();
-            }
-
-            @Override
-            public String next() {
-                UriRef next = tcs.next();
-                return next != null ? next.getUnicodeString() : null;
-            }
-
-            @Override
-            public void remove() {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-        };
-
-    }
-
-    @Override
-    public Lock getLock() {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @Override
-    public DatasetGraph asDatasetGraph() {
-        return new TcDatasetGraph(tcManager, defaultGraph);
-    }
-
-    @Override
-    public void close() {
-    }
-
-    @Override
-    public void setDefaultModel( Model model ) {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public void addNamedModel( String uri, Model model ) throws LabelExistsException {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public void removeNamedModel( String uri ) {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public void replaceNamedModel( String uri, Model model ) {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public Context getContext() {
-      return null;
-    }
-  
-    @Override
-    public boolean supportsTransactions() {
-      return false;
-    }
-  
-    @Override
-    public void begin( ReadWrite readWrite ) {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public void commit() {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public void abort() {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-  
-    @Override
-    public boolean isInTransaction() {
-      return false;
-    }
-  
-    @Override
-    public void end() {
-      throw new UnsupportedOperationException("Not supported yet.");
-    }
-}


Mime
View raw message