Added:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/scoreRange.properties
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/scoreRange.properties?rev=1102379&view=auto
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/scoreRange.properties
(added)
+++
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/scoreRange.properties
Thu May 12 17:04:52 2011
@@ -0,0 +1,2 @@
+# the range is always [0..{upper-bound}]
+upper-bound=1
\ No newline at end of file
Propchange:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/scoreRange.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/resources/rdfData/readme.txt
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/resources/rdfData/readme.txt?rev=1102379&view=auto
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/resources/rdfData/readme.txt
(added)
+++
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/resources/rdfData/readme.txt
Thu May 12 17:04:52 2011
@@ -0,0 +1,12 @@
+This directory should hold the RDF Dump available at
+http://dblp.l3s.de/dblp.rdf.gz
+
+NOTE that you need to rename the file to from "dblp.rdf.gz" to "dblp.nt.gz"
+because it is encoded using N-Triples and not rdf/xml as the file extension
+indicated.
+
+You can execute the following two commands within this directory to get the
+required file
+
+curl -C - -O http://dblp.l3s.de/dblp.rdf.gz
+mv dblp.rdf.gz dblp.nt.gz
\ No newline at end of file
Propchange:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/resources/rdfData/readme.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/log4j.properties
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/log4j.properties?rev=1102379&view=auto
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/log4j.properties
(added)
+++
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/log4j.properties
Thu May 12 17:04:52 2011
@@ -0,0 +1,12 @@
+# Generally print only WARN and ERROR messages
+log4j.rootLogger=WARN, A1
+# to the console
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+#using the pattern layout
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+# with this configuration
+log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %c{2} -
%m%n
+# however log also INFO messages of the indexing components
+log4j.logger.org.apache.stanbol.entityhub.indexing=INFO
+# for loggings during importing RDF data
+log4j.logger.com.hp.hpl.jena=INFO
\ No newline at end of file
Propchange:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/java/org/apache/stanbol/entityhub/indexing/dbpedia/ConfigTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/java/org/apache/stanbol/entityhub/indexing/dbpedia/ConfigTest.java?rev=1102379&view=auto
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/java/org/apache/stanbol/entityhub/indexing/dbpedia/ConfigTest.java
(added)
+++
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/java/org/apache/stanbol/entityhub/indexing/dbpedia/ConfigTest.java
Thu May 12 17:04:52 2011
@@ -0,0 +1,84 @@
+package org.apache.stanbol.entityhub.indexing.dbpedia;
+
+import org.apache.stanbol.entityhub.indexing.core.EntityIterator;
+import org.apache.stanbol.entityhub.indexing.core.IndexerFactory;
+import org.apache.stanbol.entityhub.indexing.core.EntityIterator.EntityScore;
+import org.apache.stanbol.entityhub.indexing.core.config.IndexingConfig;
+import org.apache.stanbol.entityhub.indexing.core.normaliser.ScoreNormaliser;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import static org.junit.Assert.*;
+
+public class ConfigTest {
+
+ private final static Logger log =
LoggerFactory.getLogger(ConfigTest.class);
+
+ /**
+ * mvn copies the resources in "src/test/resources" to target/test-classes.
+ */
+ private static final String TEST_ROOT = "/target/test-classes";
+ private static String userDir;
+ private static String testRoot;
+ /**
+ * The methods resets the "user.dir" system property
+ */
+ @BeforeClass
+ public static void initTestRootFolder(){
+ String baseDir = System.getProperty("basedir");
+ if(baseDir == null){
+ baseDir = System.getProperty("user.dir");
+ }
+ //store the current user.dir
+ userDir = System.getProperty("user.dir");
+ testRoot = baseDir+TEST_ROOT;
+ log.info("ConfigTest Root : "+testRoot);
+ //set the user.dir to the testRoot (needed to test loading of missing
+ //configurations via classpath
+ //store the current user.dir and reset it after the tests
+ System.setProperty("user.dir", testRoot);
+ }
+ /**
+ * resets the "user.dir" system property the the original value
+ */
+ @AfterClass
+ public static void cleanup(){
+ System.setProperty("user.dir", userDir);
+ }
+ @Test
+ public void testEntityIdIteratorConfig(){
+ IndexingConfig config = new IndexingConfig();
+ EntityIterator iterator = config.getEntityIdIterator();
+ ScoreNormaliser normaliser = config.getNormaliser();
+ if(iterator.needsInitialisation()){
+ iterator.initialise();
+ }
+ float lastScore = Float.MAX_VALUE;
+ float lastNormalisedScore = 1f;
+ while(iterator.hasNext()){
+ EntityScore entity = iterator.next();
+ assertNotNull(entity);
+ assertNotNull(entity.id);
+ assertNotNull(entity.score);
+ //log.info("Entity: {}",entity);
+ assertTrue(entity.id.startsWith("http://dbpedia.org/resource/"));
+ float score = entity.score.floatValue();
+ assertTrue(score > 0);
+ assertTrue(score <=lastScore);
+ lastScore = score;
+ Float normalisedScore = normaliser.normalise(entity.score);
+ assertNotNull(normalisedScore);
+ float nScore = normalisedScore.floatValue();
+ assertTrue(nScore <= lastNormalisedScore);
+ if(score < 2){ //the value of "min-score" in minIncomming
+ log.info("score="+score+" nScore="+nScore);
+ assertTrue(nScore < 0);
+ return;
+ } else {
+ assertTrue(nScore > 0);
+ }
+ }
+ }
+}
Propchange:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/java/org/apache/stanbol/entityhub/indexing/dbpedia/ConfigTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/resources/indexing/resources/incoming_links.txt
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/resources/indexing/resources/incoming_links.txt?rev=1102379&view=auto
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/resources/indexing/resources/incoming_links.txt
(added)
+++
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/resources/indexing/resources/incoming_links.txt
Thu May 12 17:04:52 2011
@@ -0,0 +1,25 @@
+ 500893 United_States
+ 495665 Category:Living_people
+ 177285 England
+ 161263 France
+ 143821 United_Kingdom
+ 140301 Germany
+ 133470 Canada
+ 107803 Japan
+ 107414 Australia
+ 100876 India
+ 100869 World_War_II
+ 97530 Italy
+ 94952 London
+ 89177 Animal
+ 78776 California
+ 77904 English_language
+ 2990 S%C3%A3o_Paulo_%28state%29
+ 2949 University_of_Illinois_at_Urbana-Champaign
+ 2948 Sugar
+ 476 Idolatry
+ 57 Greg_Gagne_%28baseball%29
+ 12 William_L._Terry
+ 5 Sanborn
+ 1 Eileen_Norris
+ 1 Eileen_Neff
\ No newline at end of file
Propchange:
incubator/stanbol/trunk/entityhub/indexing/dbpedia/src/test/resources/indexing/resources/incoming_links.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified:
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/destination/solryard/pom.xml?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/destination/solryard/pom.xml
(original)
+++ incubator/stanbol/trunk/entityhub/indexing/destination/solryard/pom.xml Thu
May 12 17:04:52 2011
@@ -83,10 +83,6 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
@@ -133,6 +129,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers</artifactId>
<scope>test</scope>
Modified:
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/main/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestination.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/main/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestination.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/main/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestination.java
(original)
+++
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/main/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestination.java
Thu May 12 17:04:52 2011
@@ -2,39 +2,30 @@ package org.apache.stanbol.entityhub.ind
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
-import java.util.ServiceLoader;
import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
import org.apache.stanbol.entityhub.core.site.CacheUtils;
-import org.apache.stanbol.entityhub.indexing.core.Indexer;
import org.apache.stanbol.entityhub.indexing.core.IndexingDestination;
import org.apache.stanbol.entityhub.indexing.core.config.IndexingConfig;
-import org.apache.stanbol.entityhub.indexing.core.impl.IndexerConstants;
import org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper;
import org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapping;
import org.apache.stanbol.entityhub.servicesapi.model.rdf.RdfResourceEnum;
import org.apache.stanbol.entityhub.servicesapi.yard.Yard;
import org.apache.stanbol.entityhub.servicesapi.yard.YardException;
import org.apache.stanbol.entityhub.yard.solr.SolrDirectoryManager;
-import org.apache.stanbol.entityhub.yard.solr.defaults.SolrConst;
-import org.apache.stanbol.entityhub.yard.solr.impl.EmbeddedSolrPorovider;
import org.apache.stanbol.entityhub.yard.solr.impl.SolrYard;
import org.apache.stanbol.entityhub.yard.solr.impl.SolrYardConfig;
-import org.apache.stanbol.entityhub.yard.solr.impl.install.SolrIndexInstaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -479,17 +470,18 @@ public class SolrYardIndexingDestination
parentPathLength++; //add the missing '/'
}
try {
- ZipArchiveOutputStream out = new
ZipArchiveOutputStream(solrArchive);
+ //Moved over to use java.util.zip because Apache commons
compression
+ //seams not support files > 2Gb
+ ZipOutputStream out = new ZipOutputStream(new
FileOutputStream(solrArchive));
for(File file :
(Collection<File>)FileUtils.listFiles(solrIndexLocation, null, true)){
if(!file.isHidden()){
String name =
file.getAbsolutePath().substring(parentPathLength);
log.info("add "+name);
- ZipArchiveEntry entry = new ZipArchiveEntry(file,
name);
- out.putArchiveEntry(entry);
- if(!entry.isDirectory()){
+ out.putNextEntry(new ZipEntry(name));
+ if(!file.isDirectory()){
FileInputStream fileIn = new FileInputStream(file);
- IOUtils.copy(fileIn,out);
- out.closeArchiveEntry();
+ IOUtils.copyLarge(fileIn,out);
+ out.closeEntry();
IOUtils.closeQuietly(fileIn);
}
}
Modified:
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java
(original)
+++
incubator/stanbol/trunk/entityhub/indexing/destination/solryard/src/test/java/org/apache/stanbol/entityhub/indexing/destination/solryard/SolrYardIndexingDestinationTest.java
Thu May 12 17:04:52 2011
@@ -8,6 +8,7 @@ import java.util.Properties;
import javax.naming.NameParser;
+import org.apache.commons.io.FilenameUtils;
import org.apache.stanbol.entityhub.indexing.core.IndexingDestination;
import org.apache.stanbol.entityhub.indexing.core.config.IndexingConfig;
import org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum;
@@ -43,14 +44,16 @@ import static org.junit.Assert.*;
public class SolrYardIndexingDestinationTest {
private static final Logger log =
LoggerFactory.getLogger(SolrYardIndexingDestinationTest.class);
- private static final String CONFIG_ROOT = "testConfigs/";
+ private static final String CONFIG_ROOT =
+ FilenameUtils.separatorsToSystem("testConfigs/");
/**
* mvn copies the resources in "src/test/resources" to target/test-classes.
* This folder is than used as classpath.<p>
* "/target/test-files/" does not exist, but is created by the
* {@link IndexingConfig}.
*/
- private static final String TEST_ROOT = "/target/test-files";
+ private static final String TEST_ROOT =
+ FilenameUtils.separatorsToSystem("/target/test-files");
private static String userDir;
private static String testRoot;
/**
@@ -139,7 +142,7 @@ public class SolrYardIndexingDestination
Yard yard = destination.getYard();
assertNotNull(yard);
assertEquals(yard.getClass(), SolrYard.class);
- Representation rep = yard.create("http://www.example.com/entity#123");
+ Representation rep =
yard.getValueFactory().createRepresentation("http://www.example.com/entity#123");
rep.add(NamespaceEnum.rdfs+"label", "test");
rep.add(NamespaceEnum.rdfs+"description", "Representation to test
storage while indexing");
rep.add(RdfResourceEnum.signRank.getUri(), Float.valueOf(0.8f));
Modified:
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
(original)
+++
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
Thu May 12 17:04:52 2011
@@ -2,12 +2,10 @@ package org.apache.stanbol.entityhub.ind
import java.io.File;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
-import java.util.Set;
import org.apache.stanbol.entityhub.core.model.InMemoryValueFactory;
import org.apache.stanbol.entityhub.indexing.core.EntityDataIterable;
@@ -287,11 +285,17 @@ public class RdfIndexingSource implement
if(literalValue instanceof BaseDatatype.TypedValue){
//used for unknown data types
// -> in such cases yust use the lecial type
- source.add(field,
((BaseDatatype.TypedValue)literalValue).lexicalValue);
+ String lexicalValue =
((BaseDatatype.TypedValue)literalValue).lexicalValue;
+ if(lexicalValue != null && !lexicalValue.isEmpty()){
+ source.add(field,lexicalValue);
+ }
} else if(literalValue instanceof XSDDateTime) {
source.add(field,
((XSDDateTime)literalValue).asCalendar().getTime()); //Entityhub uses the time
} else if(literalValue instanceof XSDDuration) {
- source.add(field, literalValue.toString());
+ String duration = literalValue.toString();
+ if(duration != null && !duration.isEmpty()) {
+ source.add(field, literalValue.toString());
+ }
} else {
source.add(field, literalValue);
}
@@ -301,11 +305,14 @@ public class RdfIndexingSource implement
literalValue = ll.getLexicalForm();
}
} else { //add a text
- String language = ll.language();
- if(language!=null && language.length()<1){
- language = null;
- }
- source.addNaturalText(field, ll.getLexicalForm(), language);
+ String lexicalForm = ll.getLexicalForm();
+ if(lexicalForm != null && !lexicalForm.isEmpty()){
+ String language = ll.language();
+ if(language!=null && language.length()<1){
+ language = null;
+ }
+ source.addNaturalText(field, lexicalForm, language);
+ } //else ignore empty literals
}
// "" is parsed if there is no language
} else {
Modified:
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java
(original)
+++
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/test/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSourceTest.java
Thu May 12 17:04:52 2011
@@ -2,6 +2,7 @@ package org.apache.stanbol.entityhub.ind
import java.util.Iterator;
+import org.apache.commons.io.FilenameUtils;
import org.apache.stanbol.entityhub.indexing.core.EntityDataIterable;
import org.apache.stanbol.entityhub.indexing.core.EntityDataIterator;
import org.apache.stanbol.entityhub.indexing.core.EntityDataProvider;
@@ -29,14 +30,16 @@ public class RdfIndexingSourceTest {
private static final long NUMBER_OF_ENTITIES_EXPECTED = 3;
- private static final String CONFIG_ROOT = "testConfigs/";
+ private static final String CONFIG_ROOT =
+ FilenameUtils.separatorsToSystem("testConfigs/");
/**
* mvn copies the resources in "src/test/resources" to target/test-classes.
* This folder is than used as classpath.<p>
* "/target/test-files/" does not exist, but is created by the
* {@link IndexingConfig}.
*/
- private static final String TEST_ROOT = "/target/test-files";
+ private static final String TEST_ROOT =
+ FilenameUtils.separatorsToSystem("/target/test-files");
private static String userDir;
private static String testRoot;
/**
@@ -91,6 +94,9 @@ public class RdfIndexingSourceTest {
IndexingConfig config = new IndexingConfig(CONFIG_ROOT+"provider");
EntityIterator entityIdIterator = config.getEntityIdIterator();
assertNotNull("Unable to perform test whithout
EntityIterator",entityIdIterator);
+ if(entityIdIterator.needsInitialisation()){
+ entityIdIterator.initialise();
+ }
EntityDataProvider dataProvider = config.getEntityDataProvider();
assertNotNull(dataProvider);
assertTrue(dataProvider.needsInitialisation());//there are test data
to load
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
Thu May 12 17:04:52 2011
@@ -26,6 +26,7 @@ import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@@ -234,7 +235,7 @@ public final class ConfigUtils {
//URLs with jar:file:/{jarPath}!{classPath} can cause problems
//so try to parse manually by using the substring from the first
//'/' to (including '!')
- String urlString = classLocation.toString();
+ String urlString =
URLDecoder.decode(classLocation.toString(),"UTF-8");
int slashIndex = urlString.indexOf('/');
int exclamationIndex = urlString.indexOf('!');
if(slashIndex >=0 && exclamationIndex > 0){
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/AssignmentEncoder.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/AssignmentEncoder.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/AssignmentEncoder.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/AssignmentEncoder.java
Thu May 12 17:04:52 2011
@@ -61,7 +61,7 @@ public class AssignmentEncoder implement
indexValue = indexValueFactory.createIndexValue(value);
}
//encode the value based on the type
- String[] queryConstraints = SolrUtil.encodeQueryValue(indexValue);
+ String[] queryConstraints = SolrUtil.encodeQueryValue(indexValue,true);
String[] eqConstraints;
if(queryConstraints != null){
eqConstraints = new String[queryConstraints.length];
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/WildcardEncoder.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/WildcardEncoder.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/WildcardEncoder.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/WildcardEncoder.java
Thu May 12 17:04:52 2011
@@ -54,7 +54,7 @@ public class WildcardEncoder implements
throw new IllegalArgumentException(String.format("This encoder
does not support the IndexDataType %s (supported: %s)",
value.getType(),SUPPORTED_TYPES));
} else {
- constraint.addEncoded(POS, SolrUtil.encodeQueryValue(value));
+ constraint.addEncoded(POS, SolrUtil.encodeQueryValue(value,false));
}
}
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/SolrUtil.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/SolrUtil.java?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/SolrUtil.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/SolrUtil.java
Thu May 12 17:04:52 2011
@@ -52,20 +52,25 @@ public final class SolrUtil {
* @param value the index value
* @return the (possible multiple) values that need to be connected with
AND
*/
- public static String[] encodeQueryValue(IndexValue indexValue){
+ public static String[] encodeQueryValue(IndexValue indexValue,boolean
escape){
if(indexValue == null){
return null;
}
String[] queryConstraints;
- String escapedValue =
SolrUtil.escapeSolrSpecialChars(indexValue.getValue());
+ String value;
+ if(escape){
+ value = SolrUtil.escapeSolrSpecialChars(indexValue.getValue());
+ } else {
+ value = indexValue.getValue();
+ }
if(IndexDataTypeEnum.TXT.getIndexType().equals(indexValue.getType())){
- escapedValue = escapedValue.toLowerCase();
- queryConstraints = escapedValue.split(" ");
+ value = value.toLowerCase();
+ queryConstraints = value.split(" ");
} else if(IndexDataTypeEnum.STR.equals(indexValue.getType())){
- escapedValue = escapedValue.toLowerCase();
- queryConstraints = new String[]{escapedValue.replace(' ', '+')};
+ value = value.toLowerCase();
+ queryConstraints = new String[]{value.replace(' ', '+')};
} else {
- queryConstraints = new String[]{escapedValue};
+ queryConstraints = new String[]{value};
}
return queryConstraints;
}
Modified: incubator/stanbol/trunk/parent/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/parent/pom.xml?rev=1102379&r1=1102378&r2=1102379&view=diff
==============================================================================
--- incubator/stanbol/trunk/parent/pom.xml (original)
+++ incubator/stanbol/trunk/parent/pom.xml Thu May 12 17:04:52 2011
@@ -36,7 +36,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<stanbol-version>0.9-SNAPSHOT</stanbol-version>
- <jersey-version>1.1.5.1</jersey-version>
+ <jersey-version>1.6</jersey-version>
<pax-exam-version>1.2.0</pax-exam-version>
</properties>
@@ -637,7 +637,14 @@
</exclusion>
</exclusions>
</dependency>
-
+ <!-- java mail might be usefull for "multipart/form-data"
requests/responses -->
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ <scope>provided</scope>
+ </dependency>
+
<!-- JAX-RS JSR311 -->
<dependency>
<groupId>javax.ws.rs</groupId>