You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/05/29 18:10:00 UTC
[1/3] jena git commit: Update TextDatasetFactory.java
Repository: jena
Updated Branches:
refs/heads/master e789e9f3d -> c7d099d7d
Update TextDatasetFactory.java
Reintroducing previous static methods for backward compatibility
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8b9c0ffb
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8b9c0ffb
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8b9c0ffb
Branch: refs/heads/master
Commit: 8b9c0ffb39bd6b6f4df8f7c359491cde891e1788
Parents: a1b3182
Author: Alexis Miara <al...@hotmail.com>
Authored: Thu May 28 13:15:08 2015 -0400
Committer: Alexis Miara <al...@hotmail.com>
Committed: Thu May 28 13:15:08 2015 -0400
----------------------------------------------------------------------
.../jena/query/text/TextDatasetFactory.java | 45 ++++++++++++++++++++
1 file changed, 45 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/8b9c0ffb/jena-text/src/main/java/org/apache/jena/query/text/TextDatasetFactory.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextDatasetFactory.java b/jena-text/src/main/java/org/apache/jena/query/text/TextDatasetFactory.java
index dc6a094..7b7b0d1 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextDatasetFactory.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextDatasetFactory.java
@@ -24,6 +24,7 @@ import org.apache.jena.query.text.assembler.TextVocab ;
import org.apache.jena.sparql.core.DatasetGraph ;
import org.apache.jena.sparql.core.assembler.AssemblerUtils ;
import org.apache.jena.sparql.util.Context ;
+import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.store.Directory ;
import org.apache.solr.client.solrj.SolrServer ;
@@ -87,6 +88,20 @@ public class TextDatasetFactory
* Create a Lucene TextIndex
*
* @param directory The Lucene Directory for the index
+ * @param def The EntityDefinition that defines how entities are stored in the index
+ * @param queryAnalyzer The analyzer to be used to find terms in the query text. If null, then the analyzer defined by the EntityDefinition will be used.
+ */
+ public static TextIndex createLuceneIndex(Directory directory, EntityDefinition def, Analyzer queryAnalyzer)
+ {
+ TextIndexConfig config = new TextIndexConfig(def);
+ config.setQueryAnalyzer(queryAnalyzer);
+ return createLuceneIndex(directory, config);
+ }
+
+ /**
+ * Create a Lucene TextIndex
+ *
+ * @param directory The Lucene Directory for the index
* @param config The config definition for the index instantiation.
*/
public static TextIndex createLuceneIndex(Directory directory, TextIndexConfig config)
@@ -104,6 +119,21 @@ public class TextDatasetFactory
*
* @param base the base Dataset
* @param directory The Lucene Directory for the index
+ * @param def The EntityDefinition that defines how entities are stored in the index
+ * @param queryAnalyzer The analyzer to be used to find terms in the query text. If null, then the analyzer defined by the EntityDefinition will be used.
+ */
+ public static Dataset createLucene(Dataset base, Directory directory, EntityDefinition def, Analyzer queryAnalyzer)
+ {
+ TextIndexConfig config = new TextIndexConfig(def);
+ config.setQueryAnalyzer(queryAnalyzer);
+ return createLucene(base, directory, config);
+ }
+
+ /**
+ * Create a text-indexed dataset, using Lucene
+ *
+ * @param base the base Dataset
+ * @param directory The Lucene Directory for the index
* @param config The config definition for the index instantiation.
*/
public static Dataset createLucene(Dataset base, Directory directory, TextIndexConfig config)
@@ -117,6 +147,21 @@ public class TextDatasetFactory
*
* @param base the base DatasetGraph
* @param directory The Lucene Directory for the index
+ * @param def The EntityDefinition that defines how entities are stored in the index
+ * @param queryAnalyzer The analyzer to be used to find terms in the query text. If null, then the analyzer defined by the EntityDefinition will be used.
+ */
+ public static DatasetGraph createLucene(DatasetGraph base, Directory directory, EntityDefinition def, Analyzer queryAnalyzer)
+ {
+ TextIndexConfig config = new TextIndexConfig(def);
+ config.setQueryAnalyzer(queryAnalyzer);
+ return createLucene(base, directory, config) ;
+ }
+
+ /**
+ * Create a text-indexed dataset, using Lucene
+ *
+ * @param base the base DatasetGraph
+ * @param directory The Lucene Directory for the index
* @param config The config definition for the index instantiation.
*/
public static DatasetGraph createLucene(DatasetGraph base, Directory directory, TextIndexConfig config)
[2/3] jena git commit: Add GSp access rule checking to Quads
operations
Posted by an...@apache.org.
Add GSp access rule checking to Quads operations
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/19acaecf
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/19acaecf
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/19acaecf
Branch: refs/heads/master
Commit: 19acaecf08a300e13bf7f9e6189a2b94f6d30372
Parents: e789e9f
Author: Andy Seaborne <an...@apache.org>
Authored: Thu May 28 23:08:20 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Thu May 28 23:08:20 2015 +0100
----------------------------------------------------------------------
.../fuseki/servlets/SPARQL_UberServlet.java | 30 ++++++++++++++++----
1 file changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/19acaecf/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
index efc7222..35c27c0 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_UberServlet.java
@@ -82,7 +82,7 @@ public abstract class SPARQL_UberServlet extends ActionSPARQL
@Override protected boolean allowREST_R(HttpAction action) { return isEnabled(action, OperationName.GSP_R) || isEnabled(action, OperationName.GSP) ; }
@Override protected boolean allowREST_W(HttpAction action) { return isEnabled(action, OperationName.GSP) ; }
// Quad operations tied to presence/absence of GSP.
- @Override protected boolean allowQuadsR(HttpAction action) { return isEnabled(action, OperationName.GSP_R) ; }
+ @Override protected boolean allowQuadsR(HttpAction action) { return isEnabled(action, OperationName.GSP_R) || isEnabled(action, OperationName.GSP) ; }
@Override protected boolean allowQuadsW(HttpAction action) { return isEnabled(action, OperationName.GSP) ; }
// Test whether there is a configuration that allows this action as the operation given.
@@ -186,10 +186,30 @@ public abstract class SPARQL_UberServlet extends ActionSPARQL
boolean hasTrailing = ( trailing.length() != 0 ) ;
if ( !hasTrailing && !hasParams ) {
- // Check enabled. But no trailing here.
- // if ( serviceDispatch(action, desc.readWriteGraphStore, trailing, restQuads_RW) ) return ;
- // if ( serviceDispatch(action, desc.readGraphStore, trailing, restQuads_R) ) return ;
- restQuads_RW.executeLifecycle(action) ;
+ // REST quads operations.
+// if ( serviceDispatch(action, OperationName.GSP_R, restQuads_R) ) return ;
+// if ( serviceDispatch(action, OperationName.GSP, restQuads_RW) ) return ;
+
+// boolean isPOST = method.equals(HttpNames.METHOD_POST) ;
+// if ( isPOST ) {
+// // Differentiate SPARQL query, SPARQL update by content type.
+// }
+
+ // REST dataset.
+ boolean isGET = method.equals(HttpNames.METHOD_GET) ;
+ boolean isHEAD = method.equals(HttpNames.METHOD_HEAD) ;
+
+ // Check enabled.
+ if ( isGET || isHEAD ) {
+ if ( allowREST_R(action) )
+ restQuads_R.executeLifecycle(action) ;
+ else
+ ServletOps.errorForbidden("Forbidden: "+method+" on dataset") ;
+ }
+ if ( allowREST_W(action) )
+ restQuads_RW.executeLifecycle(action) ;
+ else
+ ServletOps.errorForbidden("Forbidden: "+method+" on dataset") ;
return ;
}
[3/3] jena git commit: Merge commit 'refs/pull/74/head' of
github.com:apache/jena
Posted by an...@apache.org.
Merge commit 'refs/pull/74/head' of github.com:apache/jena
This closes #74.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/c7d099d7
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/c7d099d7
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/c7d099d7
Branch: refs/heads/master
Commit: c7d099d7d5504a833b002141828b6e6fd90244f7
Parents: 19acaec 8b9c0ff
Author: Andy Seaborne <an...@apache.org>
Authored: Fri May 29 17:07:45 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri May 29 17:08:50 2015 +0100
----------------------------------------------------------------------
.../jena/query/text/TextDatasetFactory.java | 45 ++++++++++++++++++++
1 file changed, 45 insertions(+)
----------------------------------------------------------------------