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 2017/06/21 10:14:10 UTC

[1/4] jena git commit: JENA-1363: Register the ES index assembler.

Repository: jena
Updated Branches:
  refs/heads/master 7e763ece5 -> 63e452eef


JENA-1363: Register the ES index assembler.

Use same pattern as elsewhere even if it is a bit heavy here.

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

Branch: refs/heads/master
Commit: ebf678ca57d593f37a650e025e5887a552b182a1
Parents: 201c3c9
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Jun 20 16:51:02 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Jun 20 20:55:39 2017 +0100

----------------------------------------------------------------------
 .../jena/query/text/es/InitJenaTextES.java      |  3 +-
 .../org/apache/jena/query/text/es/TextES.java   | 47 ++++++++++++++++++++
 .../apache/jena/query/text/es/TextIndexES.java  |  2 +-
 .../apache/jena/query/text/es/TextVocabES.java  | 35 +++++++++++++++
 .../text/es/assembler/TextAssemblerES.java      | 37 +++++++++++++++
 .../text/es/assembler/TextIndexESAssembler.java |  5 ++-
 6 files changed, 124 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/InitJenaTextES.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/InitJenaTextES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/InitJenaTextES.java
index 17869d3..6ee7591 100644
--- a/jena-text-es/src/main/java/org/apache/jena/query/text/es/InitJenaTextES.java
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/InitJenaTextES.java
@@ -19,13 +19,12 @@
 package org.apache.jena.query.text.es;
 
 import org.apache.jena.query.text.InitJenaText ;
-import org.apache.jena.query.text.TextQuery;
 import org.apache.jena.system.JenaSubsystemLifecycle ;
 
 public class InitJenaTextES implements JenaSubsystemLifecycle {
     @Override
     public void start() {
-        TextQuery.init() ;
+        TextES.init() ;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextES.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextES.java
new file mode 100644
index 0000000..fc12d4d
--- /dev/null
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextES.java
@@ -0,0 +1,47 @@
+/*
+ * 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.jena.query.text.es;
+
+import org.apache.jena.query.text.es.assembler.TextAssemblerES;
+import org.apache.jena.system.JenaSystem;
+
+public class TextES {
+    private static volatile boolean initialized = false ;
+    private static Object lock = new Object() ;
+    
+    public static void init() 
+    {
+        if ( initialized ) 
+            return ;
+        synchronized(lock) {
+            if ( initialized ) {
+                JenaSystem.logLifecycle("TextES.init - skip") ;
+                return ; 
+            }
+            initialized = true ;
+            JenaSystem.logLifecycle("TextES.init - start") ;
+            TextAssemblerES.init() ;
+            
+//            SystemInfo sysInfo = new SystemInfo(IRI, PATH, VERSION, BUILD_DATE) ;
+//            SystemARQ.registerSubSystem(sysInfo) ;
+            
+            JenaSystem.logLifecycle("TextES.init - finish") ;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
index 7c55488..b433a98 100644
--- a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java
@@ -168,7 +168,7 @@ public class TextIndexES implements TextIndex {
      */
     public TextIndexES(TextIndexConfig config, Client client, String indexName) {
         this.docDef = config.getEntDef();
-        this.client = client;
+        TextIndexES.client = client;
         this.indexName = indexName;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextVocabES.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextVocabES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextVocabES.java
new file mode 100644
index 0000000..d1918a0
--- /dev/null
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextVocabES.java
@@ -0,0 +1,35 @@
+/*
+ * 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.jena.query.text.es;
+
+import static org.apache.jena.query.text.assembler.TextVocab.NS;
+import org.apache.jena.rdf.model.Property;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.tdb.assembler.Vocab;
+
+public class TextVocabES {
+    
+    public static final Resource textIndexES        = Vocab.resource(NS, "TextIndexES") ;
+    
+    public static final Property pServerList        = Vocab.property(NS, "serverList");
+    public static final Property pClusterName       = Vocab.property(NS, "clusterName");
+    public static final Property pShards            = Vocab.property(NS, "shards");
+    public static final Property pReplicas          = Vocab.property(NS, "replicas");
+    public static final Property pIndexName          = Vocab.property(NS, "indexName");
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextAssemblerES.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextAssemblerES.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextAssemblerES.java
new file mode 100644
index 0000000..82899e3
--- /dev/null
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextAssemblerES.java
@@ -0,0 +1,37 @@
+/*
+ * 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.jena.query.text.es.assembler;
+
+import org.apache.jena.query.text.assembler.*;
+import org.apache.jena.query.text.es.TextVocabES;
+import org.apache.jena.sparql.core.assembler.AssemblerUtils;
+
+public class TextAssemblerES {
+    
+    public static void init()
+    {
+        AssemblerUtils.init() ;
+        TextAssembler.init();
+
+        // Register the index type used in: 
+        //    <#indexES> a text:TextIndexES
+        
+        AssemblerUtils.registerDataset(TextVocabES.textIndexES, new TextIndexESAssembler());
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/ebf678ca/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextIndexESAssembler.java
----------------------------------------------------------------------
diff --git a/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextIndexESAssembler.java b/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextIndexESAssembler.java
index 0ed4384..747e4b5 100644
--- a/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextIndexESAssembler.java
+++ b/jena-text-es/src/main/java/org/apache/jena/query/text/es/assembler/TextIndexESAssembler.java
@@ -25,6 +25,7 @@ import org.apache.jena.query.text.EntityDefinition;
 import org.apache.jena.query.text.TextIndex;
 import org.apache.jena.query.text.TextIndexConfig;
 import org.apache.jena.query.text.TextIndexException;
+import org.apache.jena.query.text.assembler.TextVocab;
 import org.apache.jena.query.text.es.*;
 import org.apache.jena.rdf.model.Resource;
 import org.apache.jena.sparql.util.graph.GraphUtils;
@@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.apache.jena.query.text.assembler.TextVocab.*;
+import static org.apache.jena.query.text.es.TextVocabES.*;
 
 public class TextIndexESAssembler extends AssemblerBase {
 
@@ -96,7 +97,7 @@ public class TextIndexESAssembler extends AssemblerBase {
                 indexName = "jena-text";
             }
 
-            Resource r = GraphUtils.getResourceValue(root, pEntityMap) ;
+            Resource r = GraphUtils.getResourceValue(root, TextVocab.pEntityMap) ;
             EntityDefinition docDef = (EntityDefinition)a.open(r) ;
             TextIndexConfig config = new TextIndexConfig(docDef);
 


[4/4] jena git commit: JENA-1363: Merge commit 'refs/pull/264/head' of github.com:apache/jena

Posted by an...@apache.org.
JENA-1363: Merge commit 'refs/pull/264/head' of github.com:apache/jena

This closes #264.


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

Branch: refs/heads/master
Commit: 63e452eefd45148c93dbb1207153692a3218ed35
Parents: 7e763ec ebf678c
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Jun 21 10:34:35 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Jun 21 10:34:35 2017 +0100

----------------------------------------------------------------------
 .../jena/query/text/es/InitJenaTextES.java      |  3 +-
 .../org/apache/jena/query/text/es/TextES.java   | 47 ++++++++++++++
 .../apache/jena/query/text/es/TextIndexES.java  |  2 +-
 .../apache/jena/query/text/es/TextVocabES.java  | 35 +++++++++++
 .../text/es/assembler/TextAssemblerES.java      | 37 +++++++++++
 .../text/es/assembler/TextIndexESAssembler.java |  5 +-
 .../apache/jena/query/text/InitJenaText.java    |  2 +-
 .../jena/query/text/assembler/TextVocab.java    |  7 ---
 jena-text/src/main/resources/text-config-es.ttl | 64 --------------------
 9 files changed, 125 insertions(+), 77 deletions(-)
----------------------------------------------------------------------



[2/4] jena git commit: Move the Elasticsearch constants.

Posted by an...@apache.org.
Move the Elasticsearch constants.

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

Branch: refs/heads/master
Commit: 201c3c9325b78eb3c5fbc1bd371a771c7d59d1ea
Parents: 56b238d
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Jun 20 15:07:01 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Jun 20 20:55:39 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/jena/query/text/InitJenaText.java    | 2 +-
 .../java/org/apache/jena/query/text/assembler/TextVocab.java  | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/201c3c93/jena-text/src/main/java/org/apache/jena/query/text/InitJenaText.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/InitJenaText.java b/jena-text/src/main/java/org/apache/jena/query/text/InitJenaText.java
index 5016a90..4ac288b 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/InitJenaText.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/InitJenaText.java
@@ -22,7 +22,7 @@ import org.apache.jena.system.JenaSubsystemLifecycle ;
 
 public class InitJenaText implements JenaSubsystemLifecycle {
 
-	// Subsystems of jena-text shoudl initailizae after jena-text.
+	// Subsystems of jena-text should initialize after jena-text.
     public static int LEVEL       = 50;
     public static int LEVEL_ES    = 52;
     public static int LEVEL_SOLR  = 52;

http://git-wip-us.apache.org/repos/asf/jena/blob/201c3c93/jena-text/src/main/java/org/apache/jena/query/text/assembler/TextVocab.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/assembler/TextVocab.java b/jena-text/src/main/java/org/apache/jena/query/text/assembler/TextVocab.java
index b5d4df8..bee550f 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/assembler/TextVocab.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/assembler/TextVocab.java
@@ -77,12 +77,5 @@ public class TextVocab
     public static final Resource standardFilter     = Vocab.resource(NS, "StandardFilter");
     public static final Resource lowerCaseFilter    = Vocab.resource(NS, "LowerCaseFilter");
     public static final Resource asciiFoldingFilter = Vocab.resource(NS, "ASCIIFoldingFilter");
-
-    public static final Property pServerList        = Vocab.property(NS, "serverList");
-    public static final Property pClusterName       = Vocab.property(NS, "clusterName");
-    public static final Property pShards            = Vocab.property(NS, "shards");
-    public static final Property pReplicas          = Vocab.property(NS, "replicas");
-    public static final Property pIndexName          = Vocab.property(NS, "indexName");
-
 }
 


[3/4] jena git commit: Duplicate and unused copy of text-config-es

Posted by an...@apache.org.
Duplicate and unused copy of text-config-es

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

Branch: refs/heads/master
Commit: 56b238d873939539ebae0d76f6d506ae56f6c34e
Parents: 7e763ec
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Jun 20 13:36:13 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Jun 20 20:55:39 2017 +0100

----------------------------------------------------------------------
 jena-text/src/main/resources/text-config-es.ttl | 64 --------------------
 1 file changed, 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/56b238d8/jena-text/src/main/resources/text-config-es.ttl
----------------------------------------------------------------------
diff --git a/jena-text/src/main/resources/text-config-es.ttl b/jena-text/src/main/resources/text-config-es.ttl
deleted file mode 100644
index 7a03384..0000000
--- a/jena-text/src/main/resources/text-config-es.ttl
+++ /dev/null
@@ -1,64 +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.
-
- ## Example of a TDB dataset and text index for ElasticSearch
-
-@prefix :        <http://localhost/jena_example/#> .
-@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
-@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
-@prefix text:    <http://jena.apache.org/text#> .
-
-# TDB
-[] ja:loadClass "org.apache.jena.tdb.TDB" .
-tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
-tdb:GraphTDB    rdfs:subClassOf  ja:Model .
-
-# Text
-[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
-text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
-text:TextIndexES      rdfs:subClassOf   text:TextIndex .
-
-## ---------------------------------------------------------------
-## This URI must be fixed - it's used to assemble the text dataset.
-
-:text_dataset rdf:type     text:TextDataset ;
-    text:dataset   <#dataset> ;
-    text:index     <#indexES> ;
-    .
-
-<#dataset> rdf:type      tdb:DatasetTDB ;
-    tdb:location "--mem--" ;
-    .
-
-<#indexES> a text:TextIndexES ;
-    text:serverList "127.0.0.1:9300" ; # A comma-separated list of Host:Port values of the ElasticSearch Cluster nodes.
-    text:clusterName "elasticsearch" ; # Name of the ElasticSearch Cluster. If not specified defaults to 'elasticsearch'
-    text:shards "1" ;                  # The number of shards for the index. Defaults to 1
-    text:replicas "1" ;                # The number of replicas for the index. Defaults to 1
-    text:indexName "jena-text" ;       # Name of the Index. defaults to jena-text
-    text:entityMap <#entMap> ;
-    .
-
-<#entMap> a text:EntityMap ;
-    text:entityField      "uri" ; # Defines the Document Type in the ES Index
-    text:defaultField     "text" ; ## Must be defined in the text:maps
-    text:map (
-         # rdfs:label            
-         [ text:field "text" ; text:predicate rdfs:label ]
-         [ text:field "comment" ; text:predicate rdfs:comment ]
-         ) .