You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by su...@apache.org on 2012/07/24 14:57:06 UTC
svn commit: r1365023 [1/2] - in /incubator/stanbol:
branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/
branches/contenthub-two-layered-structure/contenthub/index/
branches/contenthub-two-layered-structure/contenthub/index...
Author: suat
Date: Tue Jul 24 12:57:04 2012
New Revision: 1365023
URL: http://svn.apache.org/viewvc?rev=1365023&view=rev
Log:
STANBOL-701:
-Package refactorings:
org.apache.stanbol.contenthub.servicesapi.index -> org.apache.commons.semanticindex.index
org.apache.stanbol.contenthub.servicesapi.store -> org.apache.commons.semanticindex.store
-Updated other dependent classes
Other changes:
-Added LDPathSemanticIndexManagerTest
-Modified/added some tests in LDPathSemanticIndexTest
Added:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexManagerTest.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/EndpointTypeEnum.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/EndpointTypeEnum.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/IndexException.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexException.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/IndexManagementException.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexManagementException.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/IndexState.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexState.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/SemanticIndex.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/SemanticIndex.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/index/SemanticIndexManager.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/SemanticIndexManager.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/ChangeSet.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/ChangeSet.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/Store.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/StoreException.java
- copied, changed from r1364966, incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/StoreException.java
Removed:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/EndpointTypeEnum.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexException.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexManagementException.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/IndexState.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/SemanticIndex.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/SemanticIndexManager.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/ChangeSet.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/Store.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/store/StoreException.java
Modified:
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/list.xml
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexManagerImpl.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndexManager.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathUtils.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/featured/FeaturedSearch.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/solr/SolrSearch.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/pom.xml
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/ChangeSetImpl.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileRevisionManager.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStore.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStoreDBManager.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobDeserializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobSerializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializer.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializer.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/GraphDeserializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/MGraphDeserializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/TripleCollectionSerializerProvider.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartDeserializerTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartSerializerTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreDBManagerTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreTest.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/FeaturedSearchResource.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/LDPathSemanticIndexResource.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/util/JSONUtils.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/writers/SemanticIndexWriter.java
incubator/stanbol/trunk/commons/semanticindex/servicesapi/pom.xml
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/list.xml?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/list.xml (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/bundlelist/src/main/bundles/list.xml Tue Jul 24 12:57:04 2012
@@ -58,6 +58,11 @@
<version>0.10.0-incubating-SNAPSHOT</version>
</bundle>
<bundle>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.semanticindex.servicesapi</artifactId>
+ <version>0.10.0-incubating-SNAPSHOT</version>
+ </bundle>
+ <bundle>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
<version>1.0.6</version>
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/pom.xml Tue Jul 24 12:57:04 2012
@@ -78,6 +78,11 @@
</dependency>
<dependency>
<groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.semanticindex.servicesapi</artifactId>
+ <version>0.10.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.entityhub.ldpath</artifactId>
<version>0.11.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexManagerImpl.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexManagerImpl.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/SemanticIndexManagerImpl.java Tue Jul 24 12:57:04 2012
@@ -24,11 +24,10 @@ import java.util.Set;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
import org.apache.stanbol.commons.solr.utils.ServiceReferenceRankingComparator;
-import org.apache.stanbol.contenthub.servicesapi.index.EndpointTypeEnum;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -73,12 +72,12 @@ public class SemanticIndexManagerImpl im
@Override
public SemanticIndex<?> getIndex(String name, String endpointType) throws IndexManagementException {
List<SemanticIndex<?>> result = getIndexList(name, endpointType, false);
- if(result.size() == 0){
+ if (result.size() == 0) {
return null;
} else {
return result.get(0);
}
-
+
}
@Override
@@ -93,7 +92,7 @@ public class SemanticIndexManagerImpl im
ServiceReference[] refs = bundleContext.getServiceReferences(SemanticIndex.class.getName(), null);
if (refs != null) {
if (refs.length > 1) {
- //TODO: rw move the ServiceReferenceRankingComperator to a utils module
+ // TODO: rw move the ServiceReferenceRankingComperator to a utils module
Arrays.sort(refs, ServiceReferenceRankingComparator.INSTANCE);
}
for (ServiceReference ref : refs) {
@@ -102,17 +101,17 @@ public class SemanticIndexManagerImpl im
if (endpointType == null) {
results.add(si);
} else {
- //search both the RESTful and the JAVA interfaces
+ // search both the RESTful and the JAVA interfaces
Set<String> endpointTypes = si.getRESTSearchEndpoints().keySet();
if (endpointTypes != null && endpointTypes.contains(endpointType)) {
results.add(si);
} else {
- endpointTypes = si.getSearchEndPoints().keySet();
- if(endpointTypes != null && endpointTypes.contains(endpointType)){
- results.add(si);
- } else { //service does not match requirements -> unget the service
- bundleContext.ungetService(ref);
- }
+ endpointTypes = si.getSearchEndPoints().keySet();
+ if (endpointTypes != null && endpointTypes.contains(endpointType)) {
+ results.add(si);
+ } else { // service does not match requirements -> unget the service
+ bundleContext.ungetService(ref);
+ }
}
}
}
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java Tue Jul 24 12:57:04 2012
@@ -47,20 +47,20 @@ import org.apache.solr.client.solrj.Solr
import org.apache.solr.client.solrj.request.LukeRequest;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.util.NamedList;
+import org.apache.stanbol.commons.semanticindex.index.EndpointTypeEnum;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.IndexState;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.commons.solr.IndexReference;
import org.apache.stanbol.commons.solr.RegisteredSolrServerTracker;
import org.apache.stanbol.commons.solr.managed.IndexMetadata;
import org.apache.stanbol.commons.solr.managed.ManagedSolrServer;
-import org.apache.stanbol.contenthub.servicesapi.index.EndpointTypeEnum;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexState;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
import org.apache.stanbol.contenthub.servicesapi.index.search.featured.FeaturedSearch;
import org.apache.stanbol.contenthub.servicesapi.index.search.solr.SolrSearch;
-import org.apache.stanbol.contenthub.servicesapi.store.ChangeSet;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary;
import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
import org.apache.stanbol.enhancer.servicesapi.Blob;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndexManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndexManager.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndexManager.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndexManager.java Tue Jul 24 12:57:04 2012
@@ -33,11 +33,11 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
import org.apache.stanbol.commons.solr.managed.IndexMetadata;
import org.apache.stanbol.commons.solr.managed.ManagedSolrServer;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
import org.apache.stanbol.entityhub.servicesapi.site.SiteManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathUtils.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathUtils.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathUtils.java Tue Jul 24 12:57:04 2012
@@ -42,8 +42,8 @@ import org.apache.commons.compress.archi
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.io.IOUtils;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
import org.apache.stanbol.contenthub.servicesapi.Constants;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
import org.apache.stanbol.entityhub.ldpath.backend.SiteManagerBackend;
import org.apache.stanbol.entityhub.servicesapi.site.SiteManager;
import org.osgi.framework.Bundle;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/featured/FeaturedSearch.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/featured/FeaturedSearch.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/featured/FeaturedSearch.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/featured/FeaturedSearch.java Tue Jul 24 12:57:04 2012
@@ -19,7 +19,6 @@ package org.apache.stanbol.contenthub.se
import java.util.List;
import org.apache.solr.common.params.SolrParams;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
import org.apache.stanbol.contenthub.servicesapi.index.search.SearchException;
import org.apache.stanbol.contenthub.servicesapi.index.search.related.RelatedKeywordSearch;
import org.apache.stanbol.contenthub.servicesapi.index.search.solr.SolrSearch;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/solr/SolrSearch.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/solr/SolrSearch.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/solr/SolrSearch.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/index/search/solr/SolrSearch.java Tue Jul 24 12:57:04 2012
@@ -18,7 +18,6 @@ package org.apache.stanbol.contenthub.se
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.params.SolrParams;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
import org.apache.stanbol.contenthub.servicesapi.index.search.SearchException;
/**
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/pom.xml?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/pom.xml (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/pom.xml Tue Jul 24 12:57:04 2012
@@ -67,6 +67,11 @@
<version>0.10.0-incubating-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.semanticindex.servicesapi</artifactId>
+ <version>0.10.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.clerezza</groupId>
<artifactId>rdf.core</artifactId>
</dependency>
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/ChangeSetImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/ChangeSetImpl.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/ChangeSetImpl.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/ChangeSetImpl.java Tue Jul 24 12:57:04 2012
@@ -18,8 +18,8 @@ package org.apache.stanbol.contenthub.st
import java.util.Set;
-import org.apache.stanbol.contenthub.servicesapi.store.ChangeSet;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.Store;
public class ChangeSetImpl<Item> implements ChangeSet<Item> {
private long from;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileRevisionManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileRevisionManager.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileRevisionManager.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileRevisionManager.java Tue Jul 24 12:57:04 2012
@@ -26,9 +26,9 @@ import java.util.Set;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.ChangeSet;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.lucene.document.Field.Store;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStore.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStore.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStore.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStore.java Tue Jul 24 12:57:04 2012
@@ -51,9 +51,9 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.commons.indexedgraph.IndexedMGraph;
-import org.apache.stanbol.contenthub.servicesapi.store.ChangeSet;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.serializer.ContentPartDeserializer;
import org.apache.stanbol.contenthub.store.file.serializer.ContentPartSerializer;
import org.apache.stanbol.enhancer.servicesapi.Blob;
@@ -186,9 +186,9 @@ public class FileStore implements Store<
@Override
public Class<ContentItem> getItemType() {
- return ContentItem.class;
+ return ContentItem.class;
}
-
+
@Override
public ContentItem remove(String id) throws StoreException {
checkStoreFolder();
@@ -569,13 +569,11 @@ public class FileStore implements Store<
String headerString = writer.toString();
header = new JSONObject(headerString);
} catch (IOException e) {
- throw new StoreException(
- String.format("Failed to get header entry from the zip for of the content item: %s",
- id), e);
- } catch (JSONException e) {
- throw new StoreException(
- String.format("Failed to get header entry from the zip for of the content item: %s",
- id), e);
+ throw new StoreException(String.format(
+ "Failed to get header entry from the zip for of the content item: %s", id), e);
+ } catch (JSONException e) {
+ throw new StoreException(String.format(
+ "Failed to get header entry from the zip for of the content item: %s", id), e);
}
// deserialize metadata
@@ -691,7 +689,8 @@ public class FileStore implements Store<
@Override
public ChangeSet<ContentItem> changes(long revision, int batchSize) throws StoreException {
- ChangeSetImpl<ContentItem> changesSet = (ChangeSetImpl<ContentItem>) revisionManager.getChanges(revision, batchSize);
+ ChangeSetImpl<ContentItem> changesSet = (ChangeSetImpl<ContentItem>) revisionManager.getChanges(
+ revision, batchSize);
changesSet.setStore(this);
return changesSet;
}
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStoreDBManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStoreDBManager.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStoreDBManager.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/FileStoreDBManager.java Tue Jul 24 12:57:04 2012
@@ -34,7 +34,7 @@ import java.sql.Statement;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobDeserializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobDeserializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobDeserializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobDeserializerProvider.java Tue Jul 24 12:57:04 2012
@@ -26,7 +26,7 @@ import java.util.Set;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.enhancer.servicesapi.Blob;
import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory;
import org.apache.stanbol.enhancer.servicesapi.impl.StreamSource;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobSerializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobSerializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobSerializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/BlobSerializerProvider.java Tue Jul 24 12:57:04 2012
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.enhancer.servicesapi.Blob;
/**
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializer.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializer.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializer.java Tue Jul 24 12:57:04 2012
@@ -30,7 +30,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.ReferenceStrategy;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -107,7 +107,7 @@ public class ContentPartDeserializer {
}
return deserializer.deserialize(is, mimeType);
}
-
+
/**
* Deserializes the content part which will be read from the given {@link InputStream} using a
* {@link ContentPartDeserializerProvider} which will be obtained by the given class name. In the first
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartDeserializerProvider.java Tue Jul 24 12:57:04 2012
@@ -21,7 +21,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.apache.stanbol.enhancer.servicesapi.ContentSource;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializer.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializer.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializer.java Tue Jul 24 12:57:04 2012
@@ -30,7 +30,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.ReferenceStrategy;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
/**
* This is the manager class delegating the content part serialize requests to the suitable
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/ContentPartSerializerProvider.java Tue Jul 24 12:57:04 2012
@@ -20,7 +20,7 @@ import java.io.OutputStream;
import java.util.List;
import java.util.Set;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
/**
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/GraphDeserializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/GraphDeserializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/GraphDeserializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/GraphDeserializerProvider.java Tue Jul 24 12:57:04 2012
@@ -29,7 +29,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.commons.indexedgraph.IndexedGraph;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
/**
* This {@link ContentPartDeserializerProvider} implementation supports {@link Graph} parts. As a result, an
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/MGraphDeserializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/MGraphDeserializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/MGraphDeserializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/MGraphDeserializerProvider.java Tue Jul 24 12:57:04 2012
@@ -29,7 +29,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.commons.indexedgraph.IndexedMGraph;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
/**
* This {@link ContentPartDeserializerProvider} implementation supports {@link IndexedMGraph} parts. As a
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/TripleCollectionSerializerProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/TripleCollectionSerializerProvider.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/TripleCollectionSerializerProvider.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/store/file/src/main/java/org/apache/stanbol/contenthub/store/file/serializer/TripleCollectionSerializerProvider.java Tue Jul 24 12:57:04 2012
@@ -27,7 +27,7 @@ import org.apache.clerezza.rdf.core.seri
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
/**
* {@link ContentPartSerializerProvider} for {@link TripleCollection} objects. It serializes
Added: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexManagerTest.java?rev=1365023&view=auto
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexManagerTest.java (added)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexManagerTest.java Tue Jul 24 12:57:04 2012
@@ -0,0 +1,229 @@
+/*
+ * 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.stanbol.contenthub.test.index.ldpath;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
+import org.apache.sling.junit.annotations.TestReference;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
+import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex;
+import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndexManager;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(SlingAnnotationsTestRunner.class)
+public class LDPathSemanticIndexManagerTest {
+ private static Logger logger = LoggerFactory.getLogger(LDPathSemanticIndexManagerTest.class);
+
+ private final static String INDEX_METADATA_FOLDER_PATH = "LDPathSemanticIndexMetadata";
+
+ @TestReference
+ private LDPathSemanticIndexManager ldPathSemanticIndexManager;
+
+ @TestReference
+ private SemanticIndexManager semanticIndexManager;
+
+ @TestReference
+ private BundleContext bundleContext;
+
+ @Test
+ public void ldPathSemanticIndexManagerTest() {
+ assertNotNull("Expecting LDPathSemanticIndexManager to be injected by Sling test runner",
+ ldPathSemanticIndexManager);
+ }
+
+ @Test
+ public void semanticIndexManagerTest() {
+ assertNotNull("Expecting SemanticIndexManager to be injected by Sling test runner",
+ semanticIndexManager);
+ }
+
+ @Test
+ public void bundleContextTest() {
+ assertNotNull("Expecting BundleContext to be injected by Sling test runner", bundleContext);
+ }
+
+ @Test
+ public void testCreateIndexWithoutName() {
+ Properties indexMetadata = new Properties();
+ indexMetadata
+ .put(LDPathSemanticIndex.PROP_LD_PATH_PROGRAM,
+ "@prefix dbp-ont : <http://dbpedia.org/ontology/>; city = dbp-ont:city / rdfs:label :: xsd:string; ");
+ try {
+ ldPathSemanticIndexManager.createIndex(indexMetadata);
+ assertTrue("An Index cannot be created without name", false);
+ } catch (IndexManagementException e) {
+
+ }
+ }
+
+ @Test
+ public void testCreateIndexWithoutProgram() {
+ Properties indexMetadata = new Properties();
+ indexMetadata.put(SemanticIndex.PROP_NAME, "test_index_name");
+ try {
+ ldPathSemanticIndexManager.createIndex(indexMetadata);
+ assertTrue("An Index cannot be created without program", false);
+ } catch (IndexManagementException e) {
+
+ }
+ }
+
+ @Test
+ public void testCreateRemoveIndex() throws IndexManagementException, InterruptedException {
+ String name = "test_index_name";
+ String program = "@prefix dbp-ont : <http://dbpedia.org/ontology/>; city = dbp-ont:city / rdfs:label :: xsd:string;";
+ Properties indexMetadata = new Properties();
+ indexMetadata.put(SemanticIndex.PROP_NAME, name);
+ indexMetadata.put(LDPathSemanticIndex.PROP_LD_PATH_PROGRAM, program);
+ String pid = ldPathSemanticIndexManager.createIndex(indexMetadata);
+
+ // create and retrieve LDPathSemanticIndex
+ LDPathSemanticIndex semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ int timeoutCount = 0;
+ while (semanticIndex == null) {
+ if (timeoutCount == 8) break;
+ Thread.sleep(500);
+ semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ timeoutCount++;
+ }
+ assertNotNull("Failed to create LDPathSemanticIndex with name " + name, semanticIndex);
+
+ // check IndexMetadata folder exists
+ File indexMetadataDirectory = bundleContext
+ .getServiceReference(LDPathSemanticIndexManager.class.getName()).getBundle()
+ .getBundleContext().getDataFile(INDEX_METADATA_FOLDER_PATH);
+ assertTrue("IndexMetadata Directory does not exist", indexMetadataDirectory.exists());
+
+ // check IndexMetadata files of indexes before remove index
+ String indexMetadataFilePath = indexMetadataDirectory.getAbsolutePath() + File.separator + pid
+ + ".props";
+ File file = new File(indexMetadataFilePath);
+ assertTrue("IndexMetadata File cannot be found for pid: " + pid, file.exists());
+
+ // remove LDPathSemanticIndex
+ ldPathSemanticIndexManager.removeIndex(pid);
+
+ semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+
+ assertNull(String.format("LDPathSemanticIndex with name %s cannot be removed", name), semanticIndex);
+ if (semanticIndex == null) {
+ assertFalse("SemanticIndex is removed, but still appears configured.",
+ ldPathSemanticIndexManager.isConfigured(pid));
+ }
+
+ // check IndexMetadata files of indexes after remove index
+ indexMetadataFilePath = indexMetadataDirectory.getAbsolutePath() + File.separator + pid + ".props";
+ file = new File(indexMetadataFilePath);
+ assertFalse("IndexMetadata File cannot be removed for pid: " + pid, file.exists());
+
+ }
+
+ @Test
+ public void testIndexMetaData() throws IndexManagementException, InterruptedException {
+
+ String name1 = "test_index_name1";
+ String name2 = "test_index_name2";
+ String program = "@prefix dbp-ont : <http://dbpedia.org/ontology/>; city = dbp-ont:city / rdfs:label :: xsd:string;";
+
+ Properties indexMetadata = new Properties();
+ indexMetadata.put(SemanticIndex.PROP_NAME, name1);
+ indexMetadata.put(LDPathSemanticIndex.PROP_LD_PATH_PROGRAM, program);
+ String pid1 = ldPathSemanticIndexManager.createIndex(indexMetadata);
+ String pid2 = ldPathSemanticIndexManager.createIndex(name2, "Test Index Description", program);
+
+ // create and retrieve LDPathSemanticIndex
+ LDPathSemanticIndex semanticIndex1 = (LDPathSemanticIndex) semanticIndexManager.getIndex(name1);
+ LDPathSemanticIndex semanticIndex2 = (LDPathSemanticIndex) semanticIndexManager.getIndex(name2);
+ int timeoutCount = 0;
+ while (semanticIndex1 == null || semanticIndex2 == null) {
+ if (timeoutCount == 8) break;
+ Thread.sleep(500);
+ semanticIndex1 = (LDPathSemanticIndex) semanticIndexManager.getIndex(name1);
+ semanticIndex2 = (LDPathSemanticIndex) semanticIndexManager.getIndex(name2);
+ timeoutCount++;
+ }
+
+ File indexMetadataDirectory = bundleContext
+ .getServiceReference(LDPathSemanticIndexManager.class.getName()).getBundle()
+ .getBundleContext().getDataFile(INDEX_METADATA_FOLDER_PATH);
+
+ Map<String,Properties> indexMetadataMap = new HashMap<String,Properties>();
+ // load index metadata to memory
+ File[] metadataList = indexMetadataDirectory.listFiles();
+ for (File configFile : metadataList) {
+ String pid = configFile.getName().substring(0, configFile.getName().lastIndexOf('.'));
+ Properties props = new Properties();
+ InputStream is = null;
+ try {
+ is = new FileInputStream(configFile);
+ props.load(is);
+ indexMetadataMap.put(pid, props);
+ logger.info("Index metadata has been loaded from the location: {}",
+ configFile.getAbsolutePath());
+ } catch (FileNotFoundException e) {
+ logger.error("IndexMetadata file cannot be found");
+ throw new IndexManagementException("IndexMetadata file cannot be found");
+ } catch (IOException e) {
+ logger.error("Failed to read from input stream");
+ throw new IndexManagementException("Failed to read from input stream");
+ } finally {
+ IOUtils.closeQuietly(is);
+ }
+ }
+
+ // test getAllIndexMetadata
+ Map<String,Properties> allIndexMetadata = ldPathSemanticIndexManager.getAllIndexMetadata();
+ assertTrue("getAllIndexMetadata() cannot return the expected value",
+ allIndexMetadata.equals(indexMetadataMap));
+
+ // check IndexMetadata map entries
+ assertTrue(String.format("IndexMetadata for %s is not match with the expected value", pid1),
+ ldPathSemanticIndexManager.getIndexMetadata(pid1).equals(indexMetadataMap.get(pid1)));
+ assertTrue(String.format("IndexMetadata for %s is not match with the expected value", pid1),
+ ldPathSemanticIndexManager.getIndexMetadata(pid2).equals(indexMetadataMap.get(pid2)));
+
+ // update indexMetadataMap
+ indexMetadataMap.get(pid1).put("test field", "test value");
+ ldPathSemanticIndexManager.updateIndexMetadata(pid1, indexMetadataMap.get(pid1));
+ assertTrue("IndexMetadata cannot be updated properly",
+ ldPathSemanticIndexManager.getIndexMetadata(pid1).equals(indexMetadataMap.get(pid1)));
+
+ // remove LDPathSemanticIndex
+ ldPathSemanticIndexManager.removeIndex(pid1);
+ ldPathSemanticIndexManager.removeIndex(pid2);
+ }
+}
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/index/ldpath/LDPathSemanticIndexTest.java Tue Jul 24 12:57:04 2012
@@ -21,9 +21,11 @@ import static org.junit.Assert.assertTru
import java.io.IOException;
import java.lang.reflect.Field;
+import java.util.Dictionary;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Properties;
import org.apache.clerezza.rdf.core.UriRef;
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
@@ -31,18 +33,22 @@ import org.apache.sling.junit.annotation
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrInputDocument;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex;
import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndexManager;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
+import org.apache.stanbol.contenthub.servicesapi.index.search.SearchException;
+import org.apache.stanbol.contenthub.servicesapi.index.search.solr.SolrSearch;
import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory;
+import org.apache.stanbol.enhancer.servicesapi.EnhancementException;
+import org.apache.stanbol.enhancer.servicesapi.EnhancementJobManager;
import org.apache.stanbol.enhancer.servicesapi.impl.StringSource;
import org.junit.After;
import org.junit.Before;
@@ -50,6 +56,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,18 +66,24 @@ public class LDPathSemanticIndexTest {
private static Logger logger = LoggerFactory.getLogger(LDPathSemanticIndexTest.class);
- private static final int TESTCOUNT = 12;
+ private static final int TESTCOUNT = 15;
@TestReference
- private ContentItemFactory contentItemFactory;
+ private LDPathSemanticIndexManager ldPathSemanticIndexManager;
@TestReference
- private LDPathSemanticIndexManager ldPathSemanticIndexManager;
+ private ContentItemFactory contentItemFactory;
@TestReference
private SemanticIndexManager semanticIndexManager;
@TestReference
+ private SolrSearch solrSearch;
+
+ @TestReference
+ private EnhancementJobManager jobManager;
+
+ @TestReference
private BundleContext bundleContext;
private static LDPathSemanticIndex semanticIndex;
@@ -108,8 +122,9 @@ public class LDPathSemanticIndexTest {
}
@Test
- public void bundleContextTest() {
- assertNotNull("Expecting BundleContext to be injected by Sling test runner", bundleContext);
+ public void ldPathSemanticIndexManagerTest() {
+ assertNotNull("Expecting LDPathSemanticIndexManager to be injected by Sling test runner",
+ ldPathSemanticIndexManager);
}
@Test
@@ -118,18 +133,27 @@ public class LDPathSemanticIndexTest {
}
@Test
- public void ldPathSemanticIndexManagerTest() {
- assertNotNull("Expecting LDPathSemanticIndexManager to be injected by Sling test runner",
- ldPathSemanticIndexManager);
- }
-
- @Test
public void semanticIndexManagerTest() {
assertNotNull("Expecting SemanticIndexManager to be injected by Sling test runner",
semanticIndexManager);
}
@Test
+ public void solrSearchTest() {
+ assertNotNull("Expecting SolrSearch to be injected by Sling test runner", solrSearch);
+ }
+
+ @Test
+ public void jobManagerTest() {
+ assertNotNull("Expecting EnhancementJobManager to be injected by Sling test runner", jobManager);
+ }
+
+ @Test
+ public void bundleContextTest() {
+ assertNotNull("Expecting BundleContext to be injected by Sling test runner", bundleContext);
+ }
+
+ @Test
public void testIndex() throws IndexException {
String name = semanticIndex.getName();
String id = "test_document_id";
@@ -200,23 +224,14 @@ public class LDPathSemanticIndexTest {
@Test
public void testPersist() throws IndexException {
- String name = semanticIndex.getName();
semanticIndex.persist(3);
assertTrue("Revision cannot be persist with given value 3", semanticIndex.getRevision() == 3);
- SolrQuery solrQuery = new SolrQuery();
- solrQuery.setQuery(SolrFieldName.ID.toString() + ":" + SolrFieldName.REVISIONID.toString());
- SolrDocumentList sdl = null;
- try {
- sdl = solrServer.query(solrQuery).getResults();
- } catch (SolrServerException e) {
- logger.error("Failed to get revision from solr for index " + name, e);
- throw new IndexException("Failed to get revision from solr for index " + name, e);
- }
- SolrDocument solrDocument = sdl.get(0);
- assertTrue("Return value of getRevision() is not match with the revision stored in Solr",
- (semanticIndex.getRevision() == (Long) solrDocument.getFieldValue(SolrFieldName.REVISION
- .toString())));
+ Properties indexMetadata = ldPathSemanticIndexManager.getIndexMetadata(pid);
+ long revision = Long.parseLong((String) indexMetadata.get(SemanticIndex.PROP_REVISION));
+ assertTrue(
+ "Return value of getRevision() is not match with the revision stored in IndexMetadata File",
+ (semanticIndex.getRevision() == revision));
}
@Test
@@ -292,6 +307,69 @@ public class LDPathSemanticIndexTest {
}
+ @Test
+ public void testReindexingState() throws IndexManagementException,
+ InterruptedException,
+ IOException,
+ IndexException,
+ SearchException,
+ StoreException,
+ EnhancementException {
+ String name = "test_index_name_for_reindexing";
+ String program = "@prefix dbp-ont: <http://dbpedia.org/ontology/>; person_entities = .[rdf:type is dbp-ont:Person]:: xsd:anyURI (termVectors=\"true\");";
+ String newProgram = "@prefix dbp-ont: <http://dbpedia.org/ontology/>; place_entities = .[rdf:type is dbp-ont:Place]:: xsd:anyURI (termVectors=\"true\");";
+ String pid = ldPathSemanticIndexManager.createIndex(name, "", program);
+
+ try {
+ LDPathSemanticIndex semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ int timeoutCount = 0;
+ while (semanticIndex == null) {
+ if (timeoutCount == 8) break;
+ Thread.sleep(500);
+ semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ timeoutCount++;
+ }
+
+ ContentItem ci = contentItemFactory.createContentItem(new StringSource(
+ "Michael Jackson is a very famous person, and he was born in Indiana."));
+ jobManager.enhanceContent(ci);
+ semanticIndex.index(ci);
+ String query = "person_entities:\"http://dbpedia.org/resource/Michael_Jackson\"";
+ SolrDocumentList sdl = solrSearch.search(query, name).getResults();
+ assertNotNull("Result must not be null for query " + query, sdl);
+
+ ServiceReference reference = bundleContext
+ .getServiceReference(ConfigurationAdmin.class.getName());
+ ConfigurationAdmin configAdmin = (ConfigurationAdmin) bundleContext.getService(reference);
+ Configuration config = configAdmin.getConfiguration(pid);
+ Dictionary<String,String> properties = config.getProperties();
+ properties.put(LDPathSemanticIndex.PROP_LD_PATH_PROGRAM, newProgram);
+ properties.put(LDPathSemanticIndex.PROP_DESCRIPTION, "reindexing");
+ config.update(properties);
+
+ semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ timeoutCount = 0;
+ while (!semanticIndex.getDescription().equals("reindexing")) {
+ if (timeoutCount == 8) break;
+ Thread.sleep(500);
+ semanticIndex = (LDPathSemanticIndex) semanticIndexManager.getIndex(name);
+ timeoutCount++;
+ }
+ // index ci to new semantic index
+ semanticIndex.index(ci);
+
+ Properties indexMetadata = ldPathSemanticIndexManager.getIndexMetadata(pid);
+ assertTrue("LDPathSemanticIndex is changed, but it uses old program",
+ indexMetadata.get(LDPathSemanticIndex.PROP_LD_PATH_PROGRAM).equals(newProgram));
+ query = "place_entities:\"http://dbpedia.org/resource/Indiana\"";
+ sdl = solrSearch.search(query, name).getResults();
+ assertNotNull("Result must not be null for query " + query, sdl);
+
+ } finally {
+ ldPathSemanticIndexManager.removeIndex(pid);
+ }
+ }
+
@After
public void after() throws IndexManagementException {
counter++;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartDeserializerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartDeserializerTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartDeserializerTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartDeserializerTest.java Tue Jul 24 12:57:04 2012
@@ -36,7 +36,7 @@ import org.apache.commons.compress.utils
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
import org.apache.sling.junit.annotations.TestReference;
import org.apache.stanbol.commons.indexedgraph.IndexedMGraph;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.serializer.ContentPartDeserializer;
import org.apache.stanbol.enhancer.servicesapi.Blob;
import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartSerializerTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartSerializerTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/ContentPartSerializerTest.java Tue Jul 24 12:57:04 2012
@@ -33,7 +33,7 @@ import org.apache.clerezza.rdf.core.seri
import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
import org.apache.sling.junit.annotations.TestReference;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.serializer.ContentPartSerializer;
import org.apache.stanbol.enhancer.servicesapi.Blob;
import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileRevisionManagerTest.java Tue Jul 24 12:57:04 2012
@@ -27,8 +27,8 @@ import java.util.Set;
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
import org.apache.sling.junit.annotations.TestReference;
-import org.apache.stanbol.contenthub.servicesapi.store.ChangeSet;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.FileRevisionManager;
import org.apache.stanbol.contenthub.store.file.FileStoreDBManager;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreDBManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreDBManagerTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreDBManagerTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreDBManagerTest.java Tue Jul 24 12:57:04 2012
@@ -24,7 +24,7 @@ import java.sql.SQLException;
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
import org.apache.sling.junit.annotations.TestReference;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.FileStoreDBManager;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreTest.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreTest.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/test/src/main/java/org/apache/stanbol/contenthub/test/store/file/FileStoreTest.java Tue Jul 24 12:57:04 2012
@@ -34,8 +34,8 @@ import org.apache.clerezza.rdf.core.UriR
import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
import org.apache.sling.junit.annotations.TestReference;
import org.apache.stanbol.commons.indexedgraph.IndexedMGraph;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
+import org.apache.stanbol.commons.semanticindex.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.contenthub.store.file.FileStore;
import org.apache.stanbol.contenthub.store.file.FileStoreDBManager;
import org.apache.stanbol.enhancer.servicesapi.Blob;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/FeaturedSearchResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/FeaturedSearchResource.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/FeaturedSearchResource.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/FeaturedSearchResource.java Tue Jul 24 12:57:04 2012
@@ -46,11 +46,11 @@ import org.apache.clerezza.rdf.core.UriR
import org.apache.clerezza.rdf.core.access.TcManager;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
import org.apache.stanbol.commons.web.base.ContextHelper;
import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
import org.apache.stanbol.contenthub.search.solr.util.SolrQueryUtil;
import org.apache.stanbol.contenthub.servicesapi.Constants;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
import org.apache.stanbol.contenthub.servicesapi.index.search.SearchException;
import org.apache.stanbol.contenthub.servicesapi.index.search.featured.FacetResult;
import org.apache.stanbol.contenthub.servicesapi.index.search.featured.FeaturedSearch;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/LDPathSemanticIndexResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/LDPathSemanticIndexResource.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/LDPathSemanticIndexResource.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/LDPathSemanticIndexResource.java Tue Jul 24 12:57:04 2012
@@ -44,12 +44,12 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
import org.apache.stanbol.commons.web.base.ContextHelper;
import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndex;
import org.apache.stanbol.contenthub.index.ldpath.LDPathSemanticIndexManager;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
import org.osgi.framework.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource.java Tue Jul 24 12:57:04 2012
@@ -39,13 +39,13 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.UriInfo;
+import org.apache.stanbol.commons.semanticindex.index.EndpointTypeEnum;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.IndexManagementException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndexManager;
import org.apache.stanbol.commons.web.base.ContextHelper;
import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
-import org.apache.stanbol.contenthub.servicesapi.index.EndpointTypeEnum;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexManagementException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndexManager;
import org.apache.stanbol.contenthub.web.util.JSONUtils;
import org.apache.stanbol.contenthub.web.util.RestUtil;
import org.codehaus.jettison.json.JSONException;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/StoreResource.java Tue Jul 24 12:57:04 2012
@@ -82,10 +82,10 @@ import org.apache.clerezza.rdf.core.seri
import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.apache.stanbol.commons.semanticindex.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.commons.web.base.ContextHelper;
import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
-import org.apache.stanbol.contenthub.servicesapi.store.Store;
-import org.apache.stanbol.contenthub.servicesapi.store.StoreException;
import org.apache.stanbol.contenthub.store.file.FileStore;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/util/JSONUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/util/JSONUtils.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/util/JSONUtils.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/util/JSONUtils.java Tue Jul 24 12:57:04 2012
@@ -25,8 +25,8 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.solr.client.solrj.response.FacetField;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
import org.apache.stanbol.contenthub.servicesapi.index.search.featured.SearchResult;
import org.apache.stanbol.contenthub.servicesapi.index.search.related.RelatedKeyword;
import org.codehaus.jettison.json.JSONArray;
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/writers/SemanticIndexWriter.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/writers/SemanticIndexWriter.java?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/writers/SemanticIndexWriter.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/writers/SemanticIndexWriter.java Tue Jul 24 12:57:04 2012
@@ -33,9 +33,9 @@ import javax.ws.rs.ext.MessageBodyWriter
import javax.ws.rs.ext.Provider;
import org.apache.commons.io.IOUtils;
+import org.apache.stanbol.commons.semanticindex.index.IndexException;
+import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
import org.apache.stanbol.contenthub.servicesapi.Constants;
-import org.apache.stanbol.contenthub.servicesapi.index.IndexException;
-import org.apache.stanbol.contenthub.servicesapi.index.SemanticIndex;
import org.apache.stanbol.contenthub.web.util.JSONUtils;
import org.apache.stanbol.contenthub.web.util.RestUtil;
import org.codehaus.jettison.json.JSONException;
Modified: incubator/stanbol/trunk/commons/semanticindex/servicesapi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/semanticindex/servicesapi/pom.xml?rev=1365023&r1=1365022&r2=1365023&view=diff
==============================================================================
--- incubator/stanbol/trunk/commons/semanticindex/servicesapi/pom.xml (original)
+++ incubator/stanbol/trunk/commons/semanticindex/servicesapi/pom.xml Tue Jul 24 12:57:04 2012
@@ -22,6 +22,7 @@
</parent>
<artifactId>org.apache.stanbol.commons.semanticindex.servicesapi</artifactId>
+ <version>0.10.0-incubating-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Stanbol Commons Semantic Index API Bundle</name>
@@ -37,23 +38,9 @@
</build>
<dependencies>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
- <version>0.10.0-incubating-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.entityhub.servicesapi</artifactId>
- <version>0.11.0-incubating-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-solrj</artifactId>
- </dependency>
- <dependency>
- <groupId>at.newmedialab.ldpath</groupId>
- <artifactId>ldpath-core-bundle</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
</dependencies>
</project>