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/01/02 16:02:48 UTC
svn commit: r1226437 [2/2] - in /incubator/stanbol/trunk: ./
cmsadapter/cmis/src/main/java/org/apache/stanbol/cmsadapter/cmis/mapping/
cmsadapter/core/
cmsadapter/core/src/main/java/org/apache/stanbol/cmsadapter/core/processor/
cmsadapter/jcr/src/main/...
Added: incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaBlob.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaBlob.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaBlob.java (added)
+++ incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaBlob.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,39 @@
+package org.apache.stanbol.contenthub.store.clerezza;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.clerezza.platform.content.DiscobitsHandler;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.stanbol.enhancer.servicesapi.Blob;
+
+public class ClerezzaBlob implements Blob {
+
+ private final GraphNode idNode;
+ private final DiscobitsHandler handler;
+
+ protected ClerezzaBlob(DiscobitsHandler handler, GraphNode idNode){
+ this.handler = handler;
+ this.idNode = idNode;
+ }
+ @Override
+ public InputStream getStream() {
+ return new ByteArrayInputStream(handler.getData((UriRef) idNode.getNode()));
+ }
+ @Override
+ public String getMimeType() {
+ return handler.getMediaType((UriRef) idNode.getNode()).toString();
+ }
+ @Override
+ public Map<String,String> getParameter() {
+ return Collections.emptyMap();
+ }
+ @Override
+ public long getContentLength() {
+ return -1;
+ }
+
+}
Added: incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaContentItem.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaContentItem.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaContentItem.java (added)
+++ incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaContentItem.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.stanbol.contenthub.store.clerezza;
+
+import org.apache.clerezza.platform.content.DiscobitsHandler;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemImpl;
+
+/**
+ *
+ * @author andreas
+ */
+public class ClerezzaContentItem extends ContentItemImpl {
+
+ public ClerezzaContentItem(GraphNode idNode, MGraph metadataGraph, DiscobitsHandler handler) {
+ super((UriRef) idNode.getNode(),new ClerezzaBlob(handler, idNode),metadataGraph);
+ }
+
+}
Added: incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaStore.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaStore.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaStore.java (added)
+++ incubator/stanbol/trunk/contenthub/store/clerezza/src/main/java/org/apache/stanbol/contenthub/store/clerezza/ClerezzaStore.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,100 @@
+/*
+ * 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.store.clerezza;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.clerezza.platform.content.DiscobitsHandler;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.utils.GraphNode;
+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.Store;
+import org.apache.stanbol.enhancer.servicesapi.ContentItem;
+
+
+/**
+ * test
+ *
+ * @author andreas
+ */
+@Component
+@Service(Store.class)
+public class ClerezzaStore implements Store {
+
+ @Reference
+ DiscobitsHandler handler;
+
+ @Reference
+ ContentGraphProvider cgProvider;
+
+ @Reference
+ TcManager tcManager;
+
+ public ContentItem create(String id, byte[] content, String contentType) {
+
+ // TODO: the semantics of this implementation are wrong: the creation of
+ // a new content item should not touch the persistence backends. The write
+ // operation to the backend should only be performed when calling the
+ // {@link put} method.
+
+ UriRef uriRef = new UriRef(id);
+ MGraph metadataGraph;
+ try {
+ metadataGraph = tcManager.createMGraph(uriRef);
+ } catch (EntityAlreadyExistsException ex) {
+ return null;
+ }
+ handler.put(new UriRef(id), MediaType.valueOf(contentType), content);
+ ContentItem contentItem = new ClerezzaContentItem(new GraphNode(uriRef,
+ cgProvider.getContentGraph()), new SimpleMGraph(metadataGraph), handler);
+ return contentItem;
+ }
+
+ public String put(ContentItem ci) {
+ MGraph metadataGraph = tcManager.getMGraph(new UriRef(ci.getUri().getUnicodeString()));
+ metadataGraph.clear();
+ metadataGraph.addAll(ci.getMetadata());
+ return ci.getUri().getUnicodeString();
+ }
+
+ public ContentItem get(String id) {
+ UriRef uriRef = new UriRef(id);
+ MGraph metadataGraph;
+ try {
+ metadataGraph = tcManager.getMGraph(uriRef);
+ } catch (NoSuchEntityException ex) {
+ throw new IllegalArgumentException("Is not a content item");
+ }
+ ContentItem contentItem = new ClerezzaContentItem(new GraphNode(uriRef,
+ cgProvider.getContentGraph()), metadataGraph, handler);
+ return contentItem;
+ }
+
+ public MGraph getEnhancementGraph() {
+ // TODO: implement me: this should return an aggregate graph with all
+ // the triples of all the content item of this store
+ return new SimpleMGraph();
+ }
+}
Modified: incubator/stanbol/trunk/contenthub/store/inmemory/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/inmemory/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/inmemory/pom.xml (original)
+++ incubator/stanbol/trunk/contenthub/store/inmemory/pom.xml Mon Jan 2 15:02:46 2012
@@ -1,46 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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. -->
+ 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- <relativePath>../../parent</relativePath>
- </parent>
+ <parent>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
- <artifactId>org.apache.stanbol.contenthub.store.inmemory</artifactId>
- <packaging>bundle</packaging>
+ <artifactId>org.apache.stanbol.contenthub.store.inmemory</artifactId>
+ <packaging>bundle</packaging>
- <name>Apache Stanbol Contenthub InMemory Store Implementation</name>
- <description>Persists documents into the InMemory Store (lives in memory)</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <dependencies>
+ <name>Apache Stanbol Contenthub InMemory Store Implementation</name>
+ <description>Persists documents into the InMemory Store (lives in memory)</description>
- </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.core</artifactId>
+ </dependency>
+ </dependencies>
</project>
Added: incubator/stanbol/trunk/contenthub/store/inmemory/src/main/java/org/apache/stanbol/contenthub/store/inmemory/InMemoryStore.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/inmemory/src/main/java/org/apache/stanbol/contenthub/store/inmemory/InMemoryStore.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/inmemory/src/main/java/org/apache/stanbol/contenthub/store/inmemory/InMemoryStore.java (added)
+++ incubator/stanbol/trunk/contenthub/store/inmemory/src/main/java/org/apache/stanbol/contenthub/store/inmemory/InMemoryStore.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,118 @@
+/*
+* 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.store.inmemory;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.contenthub.servicesapi.store.Store;
+import org.apache.stanbol.enhancer.servicesapi.ContentItem;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
+import org.apache.stanbol.enhancer.servicesapi.helper.InMemoryContentItem;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/** Trivial in-memory Store for standalone Stanbol Enhancement server */
+@Component(immediate = false)
+@Service
+// Use a low service ranking so that "real" stores replace this
+@Property(name = "service.ranking", intValue = -1000)
+public class InMemoryStore implements Store {
+
+ private final Logger log = LoggerFactory.getLogger(InMemoryStore.class);
+
+ private final Map<String, ContentItem> data = new HashMap<String, ContentItem>();
+
+ @Reference
+ private WeightedTcProvider tcProvider;
+
+ @Property(value = "http://stanbol.apache.org/enhancer/defaultEnhancementsGraphID")
+ public static final String GRAPH_URI = "org.apache.stanbol.enhancer.standalone.store.graphUri";
+
+ public InMemoryStore() {
+ super();
+ }
+
+ public ContentItem create(String id, byte[] content, String mimeType) {
+ UriRef uri = id == null ? ContentItemHelper.makeDefaultUrn(content)
+ : new UriRef(id);
+ log.debug("create ContentItem for id " + uri + " on TC Manager= "
+ + tcProvider);
+ final MGraph g = new SimpleMGraph();
+ return new InMemoryContentItem(uri.getUnicodeString(), content, mimeType, g);
+ }
+
+ public ContentItem get(String id) {
+ ContentItem result;
+ synchronized (data) {
+ result = data.get(id);
+ }
+ return result;
+ }
+
+ public String put(ContentItem ci) {
+ synchronized (data) {
+
+ data.put(ci.getUri().getUnicodeString(), ci);
+
+ // remove any previously stored data about ci
+ MGraph g = getEnhancementGraph();
+ UriRef uri = ci.getUri();
+ Iterator<Triple> toRemove = g.filter(uri, null, null);
+ while (toRemove.hasNext()) {
+ toRemove.next();
+ toRemove.remove();
+ }
+ toRemove = g.filter(null, null, uri);
+ while (toRemove.hasNext()) {
+ toRemove.next();
+ toRemove.remove();
+ }
+ // TODO: how to handle orphan indirect triples?
+
+ // accumulate all triples recently collected
+ getEnhancementGraph().addAll(ci.getMetadata());
+ }
+ return ci.getUri().getUnicodeString();
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName();
+ }
+
+ public MGraph getEnhancementGraph() {
+ final UriRef graphUri = new UriRef(GRAPH_URI);
+ try {
+ return tcProvider.getMGraph(graphUri);
+ } catch (NoSuchEntityException e) {
+ return tcProvider.createMGraph(graphUri);
+ }
+ }
+}
Modified: incubator/stanbol/trunk/contenthub/store/solr/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/solr/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/solr/pom.xml (original)
+++ incubator/stanbol/trunk/contenthub/store/solr/pom.xml Mon Jan 2 15:02:46 2012
@@ -1,45 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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. -->
+ 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- <relativePath>../../parent</relativePath>
- </parent>
+ <parent>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
- <artifactId>org.apache.stanbol.contenthub.store.solr</artifactId>
- <packaging>bundle</packaging>
+ <artifactId>org.apache.stanbol.contenthub.store.solr</artifactId>
+ <packaging>bundle</packaging>
- <name>Apache Stanbol Contenthub Solr Store</name>
+ <name>Apache Stanbol Contenthub Solr Store</name>
- <description>Given target core, persists text based documents into an Embedded Solr Instance</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- </dependencies>
+ <description>Given target core, persists text based documents into an Embedded Solr Instance</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.jena.facade</artifactId>
+ </dependency>
+
+ <!-- Solr/Lucene dependencies (needed for using embedded Solr servers) -->
+ <dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.solr.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.solr.managed</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ </dependency>
+ </dependencies>
</project>
Added: incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrContentItemImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrContentItemImpl.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrContentItemImpl.java (added)
+++ incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrContentItemImpl.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,130 @@
+/*
+ * 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.store.solr;
+
+import static org.apache.stanbol.contenthub.core.utils.ContentItemIDOrganizer.CONTENT_ITEM_URI_PREFIX;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.stanbol.contenthub.core.utils.ContentItemIDOrganizer;
+import org.apache.stanbol.contenthub.servicesapi.store.solr.SolrContentItem;
+import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemImpl;
+import org.apache.stanbol.enhancer.servicesapi.helper.InMemoryBlob;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author meric
+ * @author anil.sinaci
+ *
+ */
+public class SolrContentItemImpl extends ContentItemImpl implements SolrContentItem {
+
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory.getLogger(SolrContentItem.class);
+
+ private final Map<String,List<Object>> constraints;
+ private String title;
+
+// Do not allow ContentItmes without Content!
+// public SolrContentItemImpl(String id) {
+// this(id, null, null, null, null);
+// }
+
+ public SolrContentItemImpl(byte[] content, String mimetype) {
+ this(null, content, mimetype, null, null);
+ }
+
+ public SolrContentItemImpl(String id, byte[] content, String mimeType) {
+ this(id, content, mimeType, null, null);
+ }
+
+ public SolrContentItemImpl(String id,
+ byte[] content,
+ String mimeType,
+ MGraph metadata,
+ Map<String,List<Object>> constraints) {
+ this(id, "", content, mimeType, metadata, constraints);
+ }
+
+ public SolrContentItemImpl(String id,
+ String title,
+ byte[] content,
+ String mimeType,
+ MGraph metadata,
+ Map<String,List<Object>> constraints) {
+ super(id == null ? ContentItemHelper.makeDefaultUri(CONTENT_ITEM_URI_PREFIX, content) :
+ new UriRef(ContentItemIDOrganizer.attachBaseURI(id)),
+ new InMemoryBlob(content, mimeType),
+ metadata == null ? new SimpleMGraph() : metadata);
+
+ if (metadata == null) {
+ metadata = new SimpleMGraph();
+ }
+ if(constraints == null) {
+ constraints = new HashMap<String,List<Object>>();
+ }
+ this.title = determineTitle(title, getUri().getUnicodeString(), constraints);
+ this.constraints = constraints;
+ }
+
+ public Map<String,List<Object>> getConstraints() {
+ return constraints;
+ }
+
+ public String getTitle() {
+ if (title != null && !title.trim().equals("")) {
+ return title;
+ }
+ return getUri().getUnicodeString();
+ }
+
+ private String determineTitle(String title, String id, Map<String,List<Object>> constraints) {
+ if (title != null && !title.trim().equals("")) {
+ title = title.trim();
+ List<Object> titleList = new ArrayList<Object>();
+ titleList.add(title);
+ constraints.put(SolrFieldName.TITLE.toString(), titleList);
+
+ } else {
+ List<Object> titleList = constraints.get(SolrFieldName.TITLE.toString());
+ if (titleList != null) {
+ String titleCons = titleList.toString();
+ titleCons = titleCons.substring(1,titleCons.length()-1);
+ titleList.clear();
+ titleList.add(titleCons);
+ title = titleList.get(0).toString();
+ } else {
+ title = id;
+ titleList = new ArrayList<Object>();
+ titleList.add(title);
+ constraints.put(SolrFieldName.TITLE.toString(), titleList);
+ }
+ }
+ return title;
+ }
+}
\ No newline at end of file
Added: incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrStoreImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrStoreImpl.java?rev=1226437&view=auto
==============================================================================
--- incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrStoreImpl.java (added)
+++ incubator/stanbol/trunk/contenthub/store/solr/src/main/java/org/apache/stanbol/contenthub/store/solr/SolrStoreImpl.java Mon Jan 2 15:02:46 2012
@@ -0,0 +1,465 @@
+/*
+ * 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.store.solr;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.sparql.ParseException;
+import org.apache.clerezza.rdf.core.sparql.QueryParser;
+import org.apache.clerezza.rdf.core.sparql.ResultSet;
+import org.apache.clerezza.rdf.core.sparql.SolutionMapping;
+import org.apache.clerezza.rdf.core.sparql.query.SelectQuery;
+import org.apache.commons.io.IOUtils;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+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.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.stanbol.commons.solr.IndexReference;
+import org.apache.stanbol.commons.solr.RegisteredSolrServerTracker;
+import org.apache.stanbol.commons.solr.managed.ManagedSolrServer;
+import org.apache.stanbol.contenthub.core.utils.ContentItemIDOrganizer;
+import org.apache.stanbol.contenthub.core.utils.sparql.QueryGenerator;
+import org.apache.stanbol.contenthub.servicesapi.enhancements.vocabulary.EnhancementGraphVocabulary;
+import org.apache.stanbol.contenthub.servicesapi.store.solr.SolrContentItem;
+import org.apache.stanbol.contenthub.servicesapi.store.solr.SolrStore;
+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.ContentItem;
+import org.apache.stanbol.enhancer.servicesapi.EngineException;
+import org.apache.stanbol.enhancer.servicesapi.EnhancementJobManager;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
+import org.apache.stanbol.enhancer.servicesapi.rdf.Properties;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author anil.sinaci
+ *
+ */
+@Component(immediate = false)
+@Service
+public class SolrStoreImpl implements SolrStore {
+
+ private static final Logger logger = LoggerFactory.getLogger(SolrStoreImpl.class);
+
+ @Reference
+ private ManagedSolrServer managedSolrServer;
+
+ @Reference
+ private TcManager tcManager;
+
+ @Reference
+ private EnhancementJobManager jobManager;
+
+ private RegisteredSolrServerTracker serverTracker = null;
+
+ public static final String SOLR_SERVER_NAME = "contenthub";
+
+ @Activate
+ public void activate(ComponentContext context) throws IllegalArgumentException, IOException, InvalidSyntaxException {
+ if (!managedSolrServer.isManagedIndex(SOLR_SERVER_NAME)) {
+ managedSolrServer.createSolrIndex(SOLR_SERVER_NAME, SOLR_SERVER_NAME, null);
+ }
+ serverTracker = new RegisteredSolrServerTracker(context.getBundleContext(),
+ new IndexReference(managedSolrServer.getServerName(), SOLR_SERVER_NAME));
+ serverTracker.open();
+ }
+
+ @Deactivate
+ protected void deactivate(ComponentContext context) {
+ if(serverTracker != null){
+ serverTracker.close();
+ serverTracker = null;
+ }
+ managedSolrServer = null;
+ }
+
+ protected SolrServer getServer(){
+ SolrServer server = serverTracker != null ? serverTracker.getService() : null;
+ if(server == null){
+ throw new IllegalStateException("The SolrServer for the Contenthub " +
+ "is currently not available!");
+ } else {
+ return server;
+ }
+ }
+
+ @Override
+ public SolrContentItem create(String id, byte[] content, String contentType) {
+ return create(id, "", content, contentType, null);
+ }
+
+ @Override
+ public MGraph getEnhancementGraph() {
+ final UriRef graphUri = new UriRef(EnhancementGraphVocabulary.ENHANCEMENTS_GRAPH_URI);
+ MGraph enhancementGraph = null;
+ try {
+ enhancementGraph = tcManager.getMGraph(graphUri);
+ } catch (NoSuchEntityException e) {
+ logger.debug("Creating the enhancement graph!");
+ enhancementGraph = tcManager.createMGraph(graphUri);
+ }
+ return enhancementGraph;
+ }
+
+ @Override
+ public SolrContentItem create(String id,
+ String title,
+ byte[] content,
+ String contentType,
+ Map<String,List<Object>> constraints) {
+ UriRef uri;
+ if (id == null || id.isEmpty()) {
+ uri = ContentItemHelper.makeDefaultUri(ContentItemIDOrganizer.CONTENT_ITEM_URI_PREFIX, content);
+ } else {
+ uri = new UriRef(ContentItemIDOrganizer.attachBaseURI(id));
+ }
+ logger.debug("Created ContentItem with id:{} and uri:{}", id, uri);
+ final MGraph g = new SimpleMGraph();
+ return new SolrContentItemImpl(uri.getUnicodeString(), title, content, contentType, g, constraints);
+ }
+
+ private Object inferObjectType(Object val) {
+ Object ret = null;
+ try {
+ ret = DateFormat.getInstance().parse(val.toString());
+ } catch (Exception e) {
+ try {
+ ret = Long.valueOf(val.toString());
+ } catch (Exception e1) {
+ try {
+ ret = Double.valueOf(val.toString());
+ } catch (Exception e2) {
+ try {
+ ret = String.valueOf(val.toString());
+ } catch (Exception e3) {}
+ }
+ }
+ }
+
+ if (ret == null) ret = val;
+ return ret;
+ }
+
+ private String addSolrDynamicFieldProperties(String fieldName, Object[] values) {
+ for (int i = 0; i < values.length; i++) {
+ values[i] = inferObjectType(values[i]);
+ }
+ Object typed = values[0];
+ String dynamicFieldName = fieldName;
+ if (typed instanceof String) {
+ dynamicFieldName += SolrVocabulary.SOLR_DYNAMIC_FIELD_TEXT;
+ } else if (typed instanceof Long) {
+ dynamicFieldName += SolrVocabulary.SOLR_DYNAMIC_FIELD_LONG;
+ } else if (typed instanceof Double) {
+ dynamicFieldName += SolrVocabulary.SOLR_DYNAMIC_FIELD_DOUBLE;
+ } else if (typed instanceof Date) {
+ dynamicFieldName += SolrVocabulary.SOLR_DYNAMIC_FIELD_DATE;
+ }
+ return dynamicFieldName;
+ }
+
+ @Override
+ public String enhanceAndPut(SolrContentItem sci) {
+ try {
+ jobManager.enhanceContent(sci);
+ } catch (EngineException e) {
+ logger.error("Cannot enhance content with id: {}", sci.getUri().getUnicodeString(), e);
+ }
+
+ updateEnhancementGraph(sci);
+
+ return put(sci);
+ }
+
+ private void updateEnhancementGraph(SolrContentItem sci) {
+ MGraph enhancementGraph = getEnhancementGraph();
+ // Delete old enhancements which belong to this content item from the global enhancements graph.
+ removeEnhancements(sci.getUri().getUnicodeString());
+ // Add new enhancements of this content item to the global enhancements graph.
+ Iterator<Triple> it = sci.getMetadata().iterator();
+ while (it.hasNext()) {
+ Triple triple = null;
+ try {
+ triple = it.next();
+ enhancementGraph.add(triple);
+ } catch (Exception e) {
+ logger.warn("Cannot add triple {} to the TCManager.enhancementgraph", triple, e);
+ continue;
+ }
+ }
+ }
+
+ private void removeEnhancements(String id) {
+ MGraph enhancementGraph = getEnhancementGraph();
+ Iterator<Triple> it = enhancementGraph.filter(new UriRef(id), null, null);
+ List<Triple> willBeRemoved = new ArrayList<Triple>();
+ while (it.hasNext()) {
+ willBeRemoved.add(it.next());
+ }
+ enhancementGraph.removeAll(willBeRemoved);
+ }
+
+ @Override
+ public String put(ContentItem ci) {
+ if (ci.getUri().getUnicodeString() == null || ci.getUri().getUnicodeString().isEmpty()) {
+ logger.debug("ID of the content item cannot be null while inserting to the SolrStore.");
+ throw new IllegalArgumentException(
+ "ID of the content item cannot be null while inserting to the SolrStore.");
+ }
+
+ SolrServer solrServer = getServer();
+ String content = null;
+ try {
+ content = IOUtils.toString(ci.getStream(), "UTF-8");
+ } catch (IOException ex) {
+ logger.error("Cannot read the content.", ex);
+ }
+
+ Calendar cal = Calendar.getInstance();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String creationDate = sdf.format(cal.getTime()).replace(" ", "T") + "Z";
+
+ SolrInputDocument doc = new SolrInputDocument();
+ doc.addField(SolrFieldName.ID.toString(), ci.getUri().getUnicodeString());
+ doc.addField(SolrFieldName.CONTENT.toString(), content);
+ doc.addField(SolrFieldName.MIMETYPE.toString(), ci.getMimeType());
+ doc.addField(SolrFieldName.CREATIONDATE.toString(), creationDate);
+
+ // add the number of enhancemets to the content item
+ long enhancementCount = 0;
+ Iterator<Triple> it = ci.getMetadata().filter(null, Properties.ENHANCER_EXTRACTED_FROM,
+ new UriRef(ci.getUri().getUnicodeString()));
+ while (it.hasNext()) {
+ it.next();
+ enhancementCount++;
+ }
+ doc.addField(SolrFieldName.ENHANCEMENTCOUNT.toString(), enhancementCount);
+
+ if (ci instanceof SolrContentItem) {
+ SolrContentItem sci = (SolrContentItem) ci;
+
+ // add the constraints
+ if (sci.getConstraints() != null) {
+ for (Entry<String,List<Object>> constraint : sci.getConstraints().entrySet()) {
+ Object[] values = constraint.getValue().toArray();
+ if (values == null || values.length == 0) continue;
+ String fieldName = constraint.getKey();
+ if (!SolrFieldName.isNameReserved(fieldName)) {
+ fieldName = addSolrDynamicFieldProperties(constraint.getKey(), values);
+ }
+ doc.addField(fieldName, values);
+ }
+ }
+
+ if (sci.getMetadata() != null) {
+ addSemanticFields(sci, doc);
+ addFacetFields(sci, doc);
+ } else {
+ logger.debug("There are no enhancements for the content item {}", sci.getUri().getUnicodeString());
+ }
+ }
+
+ try {
+ solrServer.add(doc);
+ solrServer.commit();
+ logger.debug("Documents are committed to Solr Server successfully.");
+ } catch (SolrServerException e) {
+ logger.error("Solr Server Exception", e);
+ } catch (IOException e) {
+ logger.error("IOException", e);
+ }
+
+ return ci.getUri().getUnicodeString();
+ }
+
+ private void addSemanticFields(SolrContentItem sci, SolrInputDocument doc) {
+ for (SolrFieldName fn : SolrFieldName.getSemanticFieldNames()) {
+ addField(sci, doc, fn);
+ }
+ }
+
+ private void addFacetFields(SolrContentItem sci, SolrInputDocument doc) {
+ for (SolrFieldName fn : SolrFieldName.getAnnotatedEntityFieldNames()) {
+ addField(sci, doc, fn);
+ }
+ }
+
+ private void addField(SolrContentItem sci, SolrInputDocument doc, SolrFieldName fieldName) {
+ SelectQuery query = null;
+ try {
+ query = (SelectQuery) QueryParser.getInstance().parse(QueryGenerator.getFieldQuery(fieldName));
+ } catch (ParseException e) {
+ logger.debug("Should never reach here!");
+ logger.error("Cannot parse the query generated by QueryGenerator: {}",
+ QueryGenerator.getFieldQuery(fieldName), e);
+ return;
+ }
+
+ sci.getMetadata();
+ ResultSet result = tcManager.executeSparqlQuery(query, sci.getMetadata());
+ List<String> values = new ArrayList<String>();
+ while (result.hasNext()) {
+ SolutionMapping sol = result.next();
+ Resource res = sol.get(fieldName.toString());
+ if (res == null) continue;
+ String value = res.toString();
+ if (res instanceof Literal) {
+ value = ((Literal) res).getLexicalForm();
+ }
+ value = value.replaceAll("_", " ");
+ values.add(value);
+ }
+ if (!values.isEmpty()) doc.addField(fieldName.toString(), values.toArray());
+ }
+
+ // TODO: we can use cache for "Recently uploaded Content Items"..
+ @Override
+ public SolrContentItem get(String id) {
+ id = ContentItemIDOrganizer.attachBaseURI(id);
+ SolrServer solrServer = getServer();
+ String content = null;
+ String mimeType = null;
+ String title = null;
+ Map<String,List<Object>> constraints = new HashMap<String,List<Object>>();
+
+ SolrQuery query = new SolrQuery();
+ StringBuilder queryString = new StringBuilder();
+ queryString.append(SolrFieldName.ID.toString());
+ queryString.append(":\"");
+ queryString.append(id);
+ queryString.append('\"');
+ query.setQuery(queryString.toString());
+ QueryResponse response;
+ try {
+ response = solrServer.query(query);
+ SolrDocumentList results = response.getResults();
+ if (results != null && results.size() > 0) {
+ SolrDocument result = results.get(0);
+ content = (String) result.getFieldValue(SolrFieldName.CONTENT.toString());
+ mimeType = (String) result.getFieldValue(SolrFieldName.MIMETYPE.toString());
+ title = (String) result.getFieldValue(SolrFieldName.TITLE.toString());
+
+ Iterator<Entry<String,Object>> itr = result.iterator();
+ while (itr.hasNext()) {
+ Entry<String,Object> entry = itr.next();
+ String key = entry.getKey();
+ if (!SolrFieldName.isNameReserved(key)) {
+ List<Object> values = (List<Object>) result.getFieldValues(key);
+ constraints.put(key, values);
+ }
+ }
+ } else {
+ logger.warn("No matching item in Solr for the given id {}.", id);
+ }
+ } catch (SolrServerException ex) {
+ logger.error("", ex);
+ }
+
+ String enhancementQuery = QueryGenerator.getEnhancementsOfContent(id);
+ SelectQuery selectQuery = null;
+ try {
+ selectQuery = (SelectQuery) QueryParser.getInstance().parse(enhancementQuery);
+ } catch (ParseException e) {
+ logger.error("", e);
+ }
+
+ ResultSet resultSet = tcManager.executeSparqlQuery(selectQuery, this.getEnhancementGraph());
+ MGraph metadata = new SimpleMGraph();
+ while (resultSet.hasNext()) {
+ SolutionMapping mapping = resultSet.next();
+ UriRef ref = (UriRef) mapping.get("enhancement");
+ Iterator<Triple> tripleItr = this.getEnhancementGraph().filter(ref, null, null);
+ while (tripleItr.hasNext()) {
+ Triple triple = tripleItr.next();
+ metadata.add(triple);
+ }
+ }
+
+ byte[] contentByte = null;
+ if(content != null){
+ contentByte = content.getBytes();
+ }
+ return new SolrContentItemImpl(id, title, contentByte, mimeType, metadata, constraints);
+ }
+
+ @Override
+ public void deleteById(String id) {
+ if (id == null || id.isEmpty()) return;
+ SolrServer solrServer = getServer();
+ id = ContentItemIDOrganizer.attachBaseURI(id);
+ removeEnhancements(id);
+ try {
+ solrServer.deleteById(id);
+ solrServer.commit();
+ } catch (SolrServerException e) {
+ logger.error("Solr Server Exception", e);
+ } catch (IOException e) {
+ logger.error("IOException", e);
+ } catch (Exception e) {
+ logger.error("Exception", e);
+ }
+ }
+
+ @Override
+ public void deleteById(List<String> idList) {
+ SolrServer solrServer = getServer();
+ for (int i = 0; i < idList.size(); i++) {
+ String id = ContentItemIDOrganizer.attachBaseURI(idList.get(i));
+ idList.remove(i);
+ idList.add(i, id);
+ }
+ try {
+ solrServer.deleteById(idList);
+ solrServer.commit();
+ } catch (SolrServerException e) {
+ logger.error("Solr Server Exception", e);
+ } catch (IOException e) {
+ logger.error("IOException", e);
+ }
+ }
+}
Modified: incubator/stanbol/trunk/contenthub/web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/pom.xml (original)
+++ incubator/stanbol/trunk/contenthub/web/pom.xml Mon Jan 2 15:02:46 2012
@@ -1,216 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
+<!-- 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
+ <parent>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.parent</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
- <artifactId>org.apache.stanbol.contenthub.web</artifactId>
- <packaging>bundle</packaging>
+ <artifactId>org.apache.stanbol.contenthub.web</artifactId>
+ <packaging>bundle</packaging>
- <name>Apache Stanbol Content Hub JAX-RS API</name>
- <description>HTTP endpoint to create and search for content items enriched
+ <name>Apache Stanbol Content Hub JAX-RS API</name>
+ <description>HTTP endpoint to create and search for content items enriched
with enhancer's annotations and links to entities from the entity hub.
</description>
- <scm>
- <connection>
+ <scm>
+ <connection>
scm:svn:http://svn.apache.org/repos/asf/incubator/stanbol/trunk/contenthub/web/
</connection>
- <developerConnection>
+ <developerConnection>
scm:svn:https://svn.apache.org/repos/asf/incubator/stanbol/trunk/contentub/web/
</developerConnection>
- <url>http://incubator.apache.org/stanbol/</url>
- </scm>
+ <url>http://incubator.apache.org/stanbol/</url>
+ </scm>
- <build>
- <!-- make it an OSGi bundle -->
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>
- javax.ws.rs.*; version="[0,2)",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- BSD License mentioned in header -->
- <exclude>src/main/resources/org/apache/stanbol/contenthub/web/static/scripts/jit.js</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <!-- dependencies on other Stanbol modules -->
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.web.base</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.core</artifactId>
- </dependency>
-
- <!-- Search Helper -->
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.contenthub.helper.cnn</artifactId>
- </dependency>
-
- <!-- needed for the ContentItem resource -->
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.jersey</artifactId>
- </dependency>
-
- <!-- Clerezza dependencies -->
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>rdf.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.hp.hpl.jena</groupId>
- <artifactId>jena</artifactId>
- </dependency>
-
- <!-- Jersey -->
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
- </dependency>
- <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId>
- </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId>
- </dependency> -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- </dependency>
-
- <!-- generic tax -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
- <groupId>eu.medsea.mimeutil</groupId>
- <artifactId>mime-util</artifactId>
- </dependency>
-
-
- <!-- OSGi tax -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.solr.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.solr.managed</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- </dependency>
- <!-- for tests -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
+ <build>
+ <!-- make it an OSGi bundle -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ javax.ws.rs.*; version="[0,2)",
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- BSD License mentioned in header -->
+ <exclude>src/main/resources/org/apache/stanbol/contenthub/web/static/scripts/jit.js</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.web.base</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.store.solr</artifactId>
+ </dependency>
+
+ <!-- Search Helper -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.helper.cnn</artifactId>
+ </dependency>
+
+ <!-- needed for the ContentItem resource -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.enhancer.jersey</artifactId>
+ </dependency>
+
+ <!-- Clerezza dependencies -->
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.hp.hpl.jena</groupId>
+ <artifactId>jena</artifactId>
+ </dependency>
+
+ <!-- Jersey -->
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-multipart</artifactId>
+ </dependency>
+ <!-- <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId>
+ </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId>
+ </dependency> -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ </dependency>
+
+ <!-- generic tax -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>eu.medsea.mimeutil</groupId>
+ <artifactId>mime-util</artifactId>
+ </dependency>
+
+
+ <!-- OSGi tax -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.solr.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.solr.managed</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ </dependency>
+ <!-- for tests -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
</project>
Modified: incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/fragment/ContenthubWebFragment.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/fragment/ContenthubWebFragment.java?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/fragment/ContenthubWebFragment.java (original)
+++ incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/fragment/ContenthubWebFragment.java Mon Jan 2 15:02:46 2012
@@ -33,11 +33,11 @@ import org.apache.stanbol.commons.web.ba
import org.apache.stanbol.commons.web.base.NavigationLink;
import org.apache.stanbol.commons.web.base.ScriptResource;
import org.apache.stanbol.commons.web.base.WebFragment;
+import org.apache.stanbol.contenthub.servicesapi.store.Store;
import org.apache.stanbol.contenthub.web.resources.CNNImporterResource;
import org.apache.stanbol.contenthub.web.resources.ContenthubStoreResource;
import org.apache.stanbol.contenthub.web.resources.SearchResource;
import org.apache.stanbol.enhancer.servicesapi.EnhancementJobManager;
-import org.apache.stanbol.enhancer.servicesapi.Store;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
Modified: incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/ContenthubStoreResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/ContenthubStoreResource.java?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/ContenthubStoreResource.java (original)
+++ incubator/stanbol/trunk/contenthub/web/src/main/java/org/apache/stanbol/contenthub/web/resources/ContenthubStoreResource.java Mon Jan 2 15:02:46 2012
@@ -84,12 +84,12 @@ import org.apache.stanbol.commons.solr.R
import org.apache.stanbol.commons.solr.managed.ManagedSolrServer;
import org.apache.stanbol.commons.web.base.ContextHelper;
import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
-import org.apache.stanbol.contenthub.core.store.SolrContentItemImpl;
import org.apache.stanbol.contenthub.core.utils.ContentItemIDOrganizer;
import org.apache.stanbol.contenthub.core.utils.JSONUtils;
-import org.apache.stanbol.contenthub.servicesapi.store.SolrContentItem;
-import org.apache.stanbol.contenthub.servicesapi.store.SolrStore;
+import org.apache.stanbol.contenthub.servicesapi.store.solr.SolrContentItem;
+import org.apache.stanbol.contenthub.servicesapi.store.solr.SolrStore;
import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
+import org.apache.stanbol.contenthub.store.solr.SolrContentItemImpl;
import org.apache.stanbol.enhancer.jersey.resource.ContentItemResource;
import org.apache.stanbol.enhancer.servicesapi.ContentItem;
import org.apache.stanbol.enhancer.servicesapi.EngineException;
Modified: incubator/stanbol/trunk/enhancer/bundlelist/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/bundlelist/src/main/bundles/list.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/bundlelist/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/enhancer/bundlelist/src/main/bundles/list.xml Mon Jan 2 15:02:46 2012
@@ -26,23 +26,10 @@
</bundle>
<bundle>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- <bundle>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
</startLevel>
- <!-- Clerezza based SPARQL query engine -->
- <startLevel level="20">
- <bundle>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.clerezza.sparql</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- </startLevel>
<!-- Web Fragment -->
<startLevel level="21">
Modified: incubator/stanbol/trunk/enhancer/engines/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/pom.xml (original)
+++ incubator/stanbol/trunk/enhancer/engines/pom.xml Mon Jan 2 15:02:46 2012
@@ -57,8 +57,6 @@
<module>opencalais</module>
<module>zemanta</module>
- <module>../clerezza/org.apache.stanbol.enhancer.clerezza</module>
- <module>../clerezza/clerezza-sparql</module>
<module>../SemiAutomaticContentEnhancer</module>
</modules>
</project>
Modified: incubator/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/Store.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/Store.java?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/Store.java (original)
+++ incubator/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/Store.java Mon Jan 2 15:02:46 2012
@@ -1,66 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.apache.stanbol.enhancer.servicesapi;
-
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
-
-
-/**
- * Store and retrieve ContentItem instances.
- *
- * Incomplete CRUD for now, we don't need it for our
- * initial use cases.
- */
-public interface Store {
-
- /**
- * Creates a {@link ContentItem} item based on supplied data,
- * using an implementation that suits this store.
- * <p>
- * Calling this method creates an empty data transfer object in
- * memory suitable for later saving using the {@link Store#put(ContentItem)} method.
- * The Store state is unchanged by the call to the
- * {@link #create(String, byte[], String)} method.
- *
- * @param id The value to use {@link ContentItem#getId}. If <code>null</code>
- * is parsed as id, an id need to be computed based on the parsed content (
- * e.g. calculating the stream digest (see also
- * {@link ContentItemHelper#streamDigest(java.io.InputStream, java.io.OutputStream, String)})
- * @param content the binary content
- * @param contentType The Mime-Type of the binary data
- * @return the {@link ContentItem} that was created
- */
- ContentItem create(String id, byte[] content, String contentType);
-
- /** Store supplied {@link ContentItem} and return its id, which
- * is assigned by the store if not defined yet.
- *
- * If the {@link ContentItem} already exists, it is overwritten.
- */
- String put(ContentItem ci);
-
- /** Get a {@link ContentItem} by id, null if non-existing */
- ContentItem get(String id);
-
- /**
- * Get the graph of triples of enhancements related to the content item from
- * this store
- */
- MGraph getEnhancementGraph();
-
-}
Modified: incubator/stanbol/trunk/enhancer/jersey/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/jersey/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/jersey/pom.xml (original)
+++ incubator/stanbol/trunk/enhancer/jersey/pom.xml Mon Jan 2 15:02:46 2012
@@ -91,10 +91,6 @@
</dependency>
<dependency>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.commons.jsonld</artifactId>
</dependency>
<dependency>
Modified: incubator/stanbol/trunk/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/org/apache/stanbol/enhancer/jersey/resource/ContentItemResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/org/apache/stanbol/enhancer/jersey/resource/ContentItemResource/index.ftl?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/org/apache/stanbol/enhancer/jersey/resource/ContentItemResource/index.ftl (original)
+++ incubator/stanbol/trunk/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/org/apache/stanbol/enhancer/jersey/resource/ContentItemResource/index.ftl Mon Jan 2 15:02:46 2012
@@ -20,7 +20,7 @@
<@common.page title="Content Item: ${it.localId} (${it.contentItem.mimeType})" hasrestapi=false>
<h3>Public URI of this resource</h3>
-<pre>${it.contentItem.id}</pre>
+<pre>${it.contentItem.uri.unicodeString}</pre>
<h3>Content preview</h3>
<div class="contentItemPreview">
Modified: incubator/stanbol/trunk/enhancer/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/pom.xml (original)
+++ incubator/stanbol/trunk/enhancer/pom.xml Mon Jan 2 15:02:46 2012
@@ -43,15 +43,10 @@
<modules>
<module>parent</module>
-
<module>generic/servicesapi</module>
- <module>generic/standalone</module>
-
<module>jobmanager</module>
-
<module>jersey</module>
<module>benchmark</module>
-
<module>engines</module>
<module>bundlelist</module>
</modules>
Modified: incubator/stanbol/trunk/launchers/framework/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/framework/src/main/bundles/list.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/framework/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/framework/src/main/bundles/list.xml Mon Jan 2 15:02:46 2012
@@ -71,11 +71,6 @@
</bundle>
<bundle>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- <bundle>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
Modified: incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml Mon Jan 2 15:02:46 2012
@@ -34,23 +34,10 @@
</bundle>
<bundle>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- <bundle>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
</startLevel>
- <!-- Clerezza based SPARQL query engine
- <startLevel level="20">
- <bundle>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.clerezza.sparql</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- </startLevel> -->
<!-- FactStore
<startLevel level="20">
Modified: incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml Mon Jan 2 15:02:46 2012
@@ -83,11 +83,6 @@
</bundle>
<bundle>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- <bundle>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
@@ -97,14 +92,6 @@
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
</startLevel>
- <!-- Clerezza based SPARQL query engine -->
- <startLevel level="20">
- <bundle>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.clerezza.sparql</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- </startLevel>
<!-- *********************************************************************
start level 25 TO 29 reserved for Stanbol plug-ins
Modified: incubator/stanbol/trunk/ontologymanager/store/launchers/fise/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/store/launchers/fise/src/main/bundles/list.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/store/launchers/fise/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/ontologymanager/store/launchers/fise/src/main/bundles/list.xml Mon Jan 2 15:02:46 2012
@@ -175,11 +175,6 @@
</bundle>
<bundle>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- <bundle>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</bundle>
@@ -338,15 +333,6 @@
</startLevel>
- <!-- Clerezza based SPARQL query engine -->
- <startLevel level="20">
- <bundle>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.clerezza.sparql</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </bundle>
- </startLevel>
-
<!-- enhancer plug-ins -->
<startLevel level="20">
<bundle>
Modified: incubator/stanbol/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/parent/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/parent/pom.xml (original)
+++ incubator/stanbol/trunk/parent/pom.xml Mon Jan 2 15:02:46 2012
@@ -468,11 +468,6 @@
</dependency>
<dependency>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
- <version>0.9.0-incubating-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.weightedjobmanager</artifactId>
<version>0.9.0-incubating-SNAPSHOT</version>
</dependency>
@@ -646,7 +641,20 @@
<version>0.9.0-incubating-SNAPSHOT</version>
</dependency>
-
+ <!-- Contenthub -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.contenthub.servicesapi</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <!-- CMS Adapter -->
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.cmsadapter.servicesapi</artifactId>
+ <version>0.9.0-incubating-SNAPSHOT</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.commons.testing.http</artifactId>
Modified: incubator/stanbol/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/pom.xml?rev=1226437&r1=1226436&r2=1226437&view=diff
==============================================================================
--- incubator/stanbol/trunk/pom.xml (original)
+++ incubator/stanbol/trunk/pom.xml Mon Jan 2 15:02:46 2012
@@ -60,7 +60,6 @@
<module>enhancer/parent</module>
<module>enhancer/generic/servicesapi</module>
<module>enhancer/jobmanager</module>
- <module>enhancer/generic/standalone</module>
<module>enhancer/jersey</module>
<module>enhancer/benchmark</module>
<module>enhancer/bundlelist</module>